Search code examples
firebaseunity-game-enginecrashadmob

Unity build crashes (API level 31 and above)


My app was working perfectly fine unitl I had to upgrade the API Target level to 31 or above for Google play store publishing, but when I run the app it crashes upon startup and in the firebase crashlytics it shows this error:

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.

Im using:

  1. Firebase SDK (crashlytics & analytics)
  2. Google admob SDK

Solution

  • Problem was finally solved by updating the google admob unity SDK & the firebase unity SDK.