android api31

We’re using Unity 2018.4.2f1 and the Android minimum API target was just updated to API31.
This leaves us in a bit of a bind because now we hit this error after we updated our target api in the project settings:

11-05 03:14:43.645 26374 26407 E AndroidRuntime: FATAL EXCEPTION: pool-16-thread-1 11-05 03:14:43.645 26374 26407 E AndroidRuntime: Process: com.sample.proj, PID: 22274 11-05 03:14:43.645 26374 26407 E AndroidRuntime: java.lang.IllegalArgumentException: com.n3twork.legendary: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent. 11-05 03:14:43.645 26374 26407 E AndroidRuntime: 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. 11-05 03:14:43.645 26374 26407 E AndroidRuntime: at android.app.PendingIntent.checkFlags(PendingIntent.java:401) 11-05 03:14:43.645 26374 26407 E AndroidRuntime: at android.app.PendingIntent.getBroadcastAsUser(PendingIntent.java:671) 11-05 03:14:43.645 26374 26407 E AndroidRuntime: at android.app.PendingIntent.getBroadcast(PendingIntent.java:658) 11-05 03:14:43.645 26374 26407 E AndroidRuntime: at androidx.work.impl.utils.ForceStopRunnable.getPendingIntent(ForceStopRunnable.java:174) 11-05 03:14:43.645 26374 26407 E AndroidRuntime: at androidx.work.impl.utils.ForceStopRunnable.isForceStopped(ForceStopRunnable.java:108) 11-05 03:14:43.645 26374 26407 E AndroidRuntime: at androidx.work.impl.utils.ForceStopRunnable.run(ForceStopRunnable.java:86)

We see that we’re using some androidx libraries (firebase for push notifications), but trying to update them gets us:

ClassNotFoundException: Didn't find class "androidx.startup.InitializationProvider" on path

Is there anyone that has gone through this and has some pointers?
Thank you!

Edit: Some things we’ve tried that seem to be positive but not quite fully working yet:

Removed all 3rd parties
Updated build tools version in our custom android project (specified in the build.gradle files).
Set androidx.work:work-runtime to 2.7.1 (this fixes PendingIntent in some of our used libraries).
rm -Rf Temp/gradleOut
gradle clean and cleanBuildCache
Change this in the settings:
Player Settings—>Other Settings–>Write Permission–>External(SDCard)
(I guess external is required since we have a large game and want to install on external if it exists, we have to ask for storage permission now or else this version of unity will silently fail by not calling update and other functions after the first start() call.)
Use a postprocessbuild script to disable bitcode
Update to xcode 14.1

This seems to make android work for one of our engineers but now they are stuck with an iOS build that fails without any clear error.

One of our team members is seeing some local success after the following changes:
Removed all 3rd parties
Updated build tools version in our custom android project (specified in the build.gradle files).
Set androidx.work:work-runtime to 2.7.1 (this fixes PendingIntent in some of our used libraries).
rm -Rf Temp/gradleOut
gradle clean and cleanBuildCache
Change this in the settings:
Player Settings—>Other Settings–>Write Permission–>External(SDCard)
(I guess external is required since we have a large game and want to install on external if it exists, we have to ask for storage permission now or else this version of unity will silently fail by not calling update and other functions after the first start() call.)
Use a postprocessbuild script to disable bitcode
Update to xcode 14.1