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

🐞 Critical: Plugins not compatible with Android Target API Level 31+ (no store submission possible anymore) #578

Open
Markovicho opened this issue Jan 6, 2023 · 3 comments
Labels

Comments

@Markovicho
Copy link

Markovicho commented Jan 6, 2023

Configuration

  • Android OS Version: 12 (or above)
  • Build Taget Level API: 31 (or above)
  • Device model(s): any device

Steps to Reproduce
Use mapbox-android-core ( libtelemetry,libcore etc.) embedded into android application with Target API Level 31. You'll receive errors and crashing application based on this API change.

error message before crash

2022.12.23 12:13:16.783 19432 19454 Error Unity Error initializing telemetry: UnityEngine.AndroidJavaException: java.lang.IllegalArgumentException: com.nmy.unseen: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent. 2022.12.23 12:13:16.783 19432 19454 Error Unity Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles.

Consequences

We recognized this issue some time ago but were fine with using API Level 30 as target. From end of 2022 its not longer possible to submit or update applications which are not targeting API Level 31 or above which is very critical. It's also very interesting that this is not reported already as there should be more developers submitting mapbox apps to the PlayStore. This issue will be criticial for every developer using this mapbox library on Android.

Additional information

For example the class LocationEngineControllerImpl.java is already taking this into account based on a comment/TODO:

flags |= 33554432; //TODO: replace with PendingIntent.FLAG_MUTABLE after Android 12 release

image
refer to : https://github.com/mapbox/mapbox-events-android/blob/main/libtelemetry/src/main/java/com/mapbox/android/telemetry/location/LocationEngineControllerImpl.java

Solution

refer to this solution on stackoverflow:
https://stackoverflow.com/questions/67045607/how-to-resolve-missing-pendingintent-mutability-flag-lint-warning-in-android-a

@Markovicho Markovicho added the bug label Jan 6, 2023
@Markovicho Markovicho changed the title Critical: Plugins not compatible with Android Target API Level 31+ (no store submission possible anymore) 🐞 Critical: Plugins not compatible with Android Target API Level 31+ (no store submission possible anymore) Jan 10, 2023
@anderco
Copy link

anderco commented Feb 1, 2023

Use mapbox-android-core ( libtelemetry,libcore etc.) embedded into android application with Target API Level 31.

Can you confirm what is the version of libcore and libtelemetry being used? Android 12 is supported starting with Mapbox Android Telemetry v8.0.0.

Also, can you provide a full stack trace for the exception?

@Markovicho
Copy link
Author

Markovicho commented Feb 1, 2023

Actually the version of libTelemetry used in Mapbox-Unity-SDK is mentioned as "update to last version" in the changelog so we don' know actually:

click here

The error message is described in :

here

@smart09091
Copy link

Hello Im also currently experiencing this telemetry bug using the unity mapbox package. is there a way to fix this for unity as well? my app has been crashing alot with this being the last error

Error initializing telemetry: UnityEngine.AndroidJavaException: java.lang.IllegalArgumentException: com.opticalethegame.opticaleTest: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent. Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles.

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

No branches or pull requests

3 participants