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
python-for-android packages wrong manifest for ANDROIDAPI="19", doesn't include configChanges="...|screenSize" which leads to app crash on rotation
#1342
python-for-android packages the wrong manifest for me for my specified ANDROIDAPI="19" version: the included AndroidManifest.xml specifies android:configChanges="keyboardHidden|orientation and missing "screenSize", which leads to app crash on rotation. When manually editing /usr/local/lib/python3.6/dist-packages/pythonforandroid/bootstraps/sdl2/build/templates/AndroidManifest.tmpl.xml to take out the conditional and hardcoding "screenSize" into the android:configChanges=... value, then it works. So it seems something is bugged with how that template is being handled.
To reproduce, try a p4a build line with --requirements=python3crystax,pysdl2,sdl2 --orientation user --window and any simple SDL2 code, e.g. the one in that comment here: #1338 (comment)
The text was updated successfully, but these errors were encountered:
Ok I am taking a wild guess here, but maybe this happens:
ANDROIDAPI="19" sets target API to 19, but doesn't change the minimum level
The minimum API appears to default to something low, maybe 12 or something even less, where screenSize in the manifest is not a valid option - therefore, AndroidManifest.tmpl.xml is written in such a way that it won't be included with that low API level
For an app with the API target level (not minimum level) 19, the Android system will possibly expect it to be aware of configChanges and somehow expect it to set screenSize as an option at runtime, but the p4a/kivy wrapper doesn't appear to be designed to do this. It probably assumes the manifest will take care of everything, which may simply not be possible with minlevel=<superlow> and targetlevel=19 in combination.
As a result, configChanges doesn't include screenSize when defining ANDROIDAPI=19 and nothing is done about this at runtime, such that a screenSize change event will be handled as activity abort() (which is the default when not explicitly changed to be handled as config change). Therefore, the app terminates with --orientation=user and any orientation change.
However, at no point p4a gives a warning about this, so this seems like quite an oversight!
I suggest that either, 1. enabling orientation changes with that combination of minimum and target API level should just work, or 2. it should raise the minimum level automatically to something that works if it's not specified, or 3. p4a should abort with an error if that combination of target and minimum levels is used.
python-for-android packages the wrong manifest for me for my specified ANDROIDAPI="19" version: the included
AndroidManifest.xml
specifiesandroid:configChanges="keyboardHidden|orientation
and missing "screenSize", which leads to app crash on rotation. When manually editing/usr/local/lib/python3.6/dist-packages/pythonforandroid/bootstraps/sdl2/build/templates/AndroidManifest.tmpl.xml
to take out the conditional and hardcoding "screenSize" into theandroid:configChanges=...
value, then it works. So it seems something is bugged with how that template is being handled.To reproduce, try a
p4a
build line with--requirements=python3crystax,pysdl2,sdl2 --orientation user --window
and any simple SDL2 code, e.g. the one in that comment here: #1338 (comment)The text was updated successfully, but these errors were encountered: