You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello_world():
return 'Hello World!'
if __name__ == '__main__':
app.run(port=5000)
And I use python-for-android apk --private ~/workspace/mobile/webview/ --package=org.example.myapp --name "test" --version 0.1 --bootstrap=webview --requirements=flask --port 5000 for creating the APK. when I run the app on Android 4.4.2: logcat stucks at V/python (13767): extracting _load.html here:
An error occurred while trying to load the application libraries. Please try again and/or reinstall.
Error: Couldn't load main from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/org/example.myapp-1.apk"],nativeLibraryDirectories=[/data/app-lib/org.example.myapp-1, /vendor/lib, /system/lib]]]: findLibrary returned null
Hmm, I don't really know what could cause this. Just to check, have you successfully built and run an sdl2 app with the same version of p4a, and is it up to date?
I've just checked the flask build and it does work for me, so it seems p4a isn't just broken right now.
Your error seems to relate to a failure to load libmain.so, which occurs before any of the python stuff really gets going - that's why you don't get a clear log when checking only python. I don't know why the libmain load would fail though. You could locat the python-for-android dist dir that has been produced and check what is in its libs folder, just in case - it should be libmain.so and libpython2.7.so.
Activity
inclement commentedon Sep 3, 2017
Could you post the full logcat output when you run it on the device?
eteamin commentedon Sep 3, 2017
There is no
adb logcat -s pythonwhen I run it! There is only log for unpacking on first time run. And here it is:inclement commentedon Sep 3, 2017
Leave out the "-s python".
eteamin commentedon Sep 3, 2017
eteamin commentedon Sep 3, 2017
Also I've run apps built with
sdl2andpygameon this phone before and they've worked well.inclement commentedon Sep 3, 2017
Hmm, I don't really know what could cause this. Just to check, have you successfully built and run an sdl2 app with the same version of p4a, and is it up to date?
eteamin commentedon Sep 3, 2017
Yes. I just built this using the build command in it's doc with the current version of python-for-android and it works fine.
inclement commentedon Sep 3, 2017
I've just checked the flask build and it does work for me, so it seems p4a isn't just broken right now.
Your error seems to relate to a failure to load libmain.so, which occurs before any of the python stuff really gets going - that's why you don't get a clear log when checking only python. I don't know why the libmain load would fail though. You could locat the python-for-android dist dir that has been produced and check what is in its libs folder, just in case - it should be libmain.so and libpython2.7.so.
eteamin commentedon Sep 3, 2017
I tested the app on a Lenovo TB3-730M (Android 6) and the same error appears. The files you metioned are not there!
inclement commentedon Jan 31, 2019
Closing in favour of #1644, which tracks the current issues with the webview bootstrap following the many recent changes.