kivy / python-for-android

Turn your Python application into an Android APK
https://python-for-android.readthedocs.io
MIT License
8.33k stars 1.84k forks source link

With the target API 31, I got an error on Android 12 phone and cannot install it. #2511

Closed buybuyxyz closed 2 years ago

buybuyxyz commented 2 years ago

Checklist

Versions

// REPLACE ME: What are you trying to get done, what has happened, what went wrong, and what did you expect?

buildozer.spec

Command:

buildozer android debug deploy run

Spec file:

........
android.api = 30
.........
....

....
....

Logs

.......
adb: failed to install /home/youtube/kivy_buildozer/apps/products/mytest/bin/mytest-0.0.1-arm64-v8a-debug.apk: Failure [INSTALL_PARSE_FAILED_MANIFEST_MALFORMED: Failed parse during installPackageLI: /data/app/vmdl1588071693.tmp/base.apk (at Binary XML file line #80): com.google.android.gms.measurement.AppMeasurementInstallReferrerReceiver: Targeting S+ (version 31 and above) requires that an explicit value for android:exported be defined when intent filters are present]
Performing Streamed Install
.......

I edit python-for-android/pythonforandroid/bootstraps/sdl2/build/templates/AndroidManifest.tmpl.xml, but I cannot success.


* I dropped the target API to 30 and it was installed.

* After a while, I think that the time will come when API31 is at least, so I would appreciate it if you could tell me how to install with target API31 as well.
HyTurtle commented 2 years ago

It would appear that you'd need to add that for all the activities/services/receivers that have intent filters - currently that would be in 3 places by my count in that xml.

buybuyxyz commented 2 years ago

Thank you very much for your help. I'll try it!

RobertFlatt commented 2 years ago

And by the look of it, at least one of those must be android:exported="true" https://developer.android.com/guide/topics/manifest/activity-element#exported

misl6 commented 2 years ago

Fixed via #2551