Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
3 of 5 tasks
buybuyxyz opened this issue Oct 19, 2021 · 4 comments
Closed
3 of 5 tasks

Comments

@buybuyxyz
Copy link

buybuyxyz commented Oct 19, 2021

Checklist

  • the issue is indeed a bug and not a support request
  • issue doesn't already exist: https://github.com/kivy/python-for-android/issues
  • I have a short, runnable example that reproduces the issue
  • I reproduced the problem with the latest development version (p4a.branch = develop)
  • I used the grave accent (aka backticks) to format code or logs when appropriated

Versions

  • Python: 3.8.9
  • OS:Ubuntu 20.04
  • Kivy:2.0.0
  • Cython: 0.29.24
  • OpenJDK: 11.0.11
  • Test equipment: Android 12 phone
  • P4A : develop

Description

// 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.

  • original
                  android:screenOrientation="{{ args.orientation }}"
                  {% if args.activity_launch_mode %}
                  android:launchMode="{{ args.activity_launch_mode }}"
                  {% endif %}
                  >

add
android:exported="false"

  • The following are the things that didn't work after fixing
android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|fontScale|uiMode{% if args.min_sdk_version >= 8 %}|uiMode{% endif %}{% if args.min_sdk_version >= 13 %}|screenSize|smallestScreenSize{% endif %}{% if args.min_sdk_version >= 17 %}|layoutDirection{% endif %}{% if args.min_sdk_version >= 24 %}|density{% endif %}"
                  android:screenOrientation="{{ args.orientation }}"
                  {% if args.activity_launch_mode %}
                  android:launchMode="{{ args.activity_launch_mode }}"
                  {% endif %}
                  android:exported="false"
                  >

  • 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
Copy link
Contributor

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
Copy link
Author

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

@RobertFlatt
Copy link
Contributor

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
Copy link
Member

misl6 commented Feb 10, 2022

Fixed via #2551

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants