Skip to content
This repository was archived by the owner on Mar 16, 2026. It is now read-only.
This repository was archived by the owner on Mar 16, 2026. It is now read-only.

🐞 FLAG_IMMUTABLE or FLAG_MUTABLE causing app crashes in Unity Android Build #585

@smart09091

Description

@smart09091

Configuration

  • SDK Version Mapbox v2.1.1
  • Android OS Version Android 13
  • Device model(s): Poco F3
  • App: Unity Mapbox SDK

Steps to Reproduce
It happens intermittently but whenever my app is doing anything mapbox related like get map information, I get this error
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. it doesnt happen as often but we've noticed that this is usually the last error being logged whenever the app crashes. I've tried to set the target API level of our android app to 30 for the meantime and the errors have disappeared but I dont think this is a good solution especially if we're going to release our app on the playstore

Expected
Is there a fix for unity that addresses this? I've seen a few issues that suggest editing .jar files to add the FLAG_IMMUTABLE line of code but I dont know how to implement these fixes for the unity app. Can I ask for help on how to remedy this or if there's already a fix for this, could someone point me in the right direction?

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions