coolishbee / universal-sdk-unity

The Universal SDK for Unity provides a modern way of implementing Social Login APIs.
45 stars 11 forks source link

App built with Universal SDK and android target API level 33 unable to start on device #9

Closed marked-one closed 1 year ago

marked-one commented 1 year ago

What did you do?

What did you expect?

app launches normally

What happened actually?

app starts launching and crashes with exception

Your environment?

Screenshots or Log

2022/10/27 12:48:43.301 10544 10600 Error AndroidRuntime FATAL EXCEPTION: WorkManager-WorkManagerTaskExecutor-thread-0
2022/10/27 12:48:43.301 10544 10600 Error AndroidRuntime Process: <my package name>, PID: 10544
2022/10/27 12:48:43.301 10544 10600 Error AndroidRuntime java.lang.IllegalArgumentException: <my package name>: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
2022/10/27 12:48:43.301 10544 10600 Error 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.
2022/10/27 12:48:43.301 10544 10600 Error AndroidRuntime    at android.app.PendingIntent.checkFlags(PendingIntent.java:375)
2022/10/27 12:48:43.301 10544 10600 Error AndroidRuntime    at android.app.PendingIntent.getBroadcastAsUser(PendingIntent.java:651)
2022/10/27 12:48:43.301 10544 10600 Error AndroidRuntime    at android.app.PendingIntent.getBroadcast(PendingIntent.java:638)
2022/10/27 12:48:43.301 10544 10600 Error AndroidRuntime    at androidx.work.impl.utils.ForceStopRunnable.getPendingIntent(ForceStopRunnable.java:147)
2022/10/27 12:48:43.301 10544 10600 Error AndroidRuntime    at androidx.work.impl.utils.ForceStopRunnable.isForceStopped(ForceStopRunnable.java:124)
2022/10/27 12:48:43.301 10544 10600 Error AndroidRuntime    at androidx.work.impl.utils.ForceStopRunnable.run(ForceStopRunnable.java:79)
2022/10/27 12:48:43.301 10544 10600 Error AndroidRuntime    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137)
2022/10/27 12:48:43.301 10544 10600 Error AndroidRuntime    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)
2022/10/27 12:48:43.301 10544 10600 Error AndroidRuntime    at java.lang.Thread.run(Thread.java:1012)
coolishbee commented 1 year ago

Sorry, currently this asset is not supported for target 31 or higher. Support for Android 12 (version 31 and above) is in progress and will be updated in the future.

marked-one commented 1 year ago

Looks like Google is forcing developers to use at least API 31 even for updated apps https://support.google.com/googleplay/android-developer/answer/11926878?hl=en so this looks like a blocking issue.

marked-one commented 1 year ago

For me, adding implementation 'androidx.work:work-runtime:2.7.1' to mainTemplate.gradle & baseProjectTemplate.gradle fixes the issue, and at least the demo app builds and runs on Android 12 with target API 33.

marked-one commented 1 year ago

Also confirmed on my app, and just adding implementation 'androidx.work:work-runtime:2.7.1' to mainTemplate.gradle is enough.

coolishbee commented 1 year ago

It's probably because the worker version uses the pre-androidx dependencies version. It is difficult for me to respond quickly to issues due to the current corona infection. Please understand

marked-one commented 1 year ago

Yes, looks like that. And no problem, health is important! Get well soon!

marked-one commented 1 year ago

In the end, I also had to add implementation 'com.android.billingclient:billing:5.0.0'. I'm not using in-app purchases, but app fails validation in Google console because of old billing library.