[PyQt] pyqtdeploy android app crashing at import main module

Phil Thompson phil at riverbankcomputing.com
Tue Sep 2 09:05:32 BST 2014

On 01/09/2014 11:17 pm, bootch at nc.rr.com wrote:
> Trying to pyqtdeploy a hello_world example app (that runs in Python on
> Linux) to android API 14 deploying to real hardware.

Have you tried running it on the emulator first?

> I harnessed pyqtdeploy_start.cpp.  At 'if
> (PyImport_ImportFrozenModule(CONST_CAST(main_module)) < 0)' is true
> and it calls py_error and quits.  I think -1 that means it found the
> module but threw an exception while initializing it.  As far as I can
> determine the exception is a BaseException (that seems strange.)
> I don't understand the code sets the filename for the module
> ":/__main__.pyo".  I thought the colon notation was a Qt concept ( but
> I suppose qrcimporter must understand it.)  I can't find that file in
> the Qt Creator project anywhere, not in Resources.  I suppose it was
> found and I should harness the initialization somehow.

Qt Creator project?

> (I harnessed by calling qWarning() (instead of fprintf(stderr)), which
> logs to android logcat.  I think stdout/stderr don't work on Android
> unless the app redirects them to a file, early.  Neither does
> PyErr_Print() seem to make the error visible.)

There is a way (on the emulator at least) to switch stdout/stderr to 
logcat, see...



More information about the PyQt mailing list