android-12
How does setExpedited work and is it as good&reliable as a foreground service?
Conceptually Foreground Services & Expedited Work are not the same thing. Only a OneTimeWorkRequest can be run expedited as these are time sensitive. Any Worker can request to be run in the foreground. That might succeed depending on the app’s foreground state. A Worker can try to run its work in the foreground using setForeground[Async]() … Read more
Google Chrome browser in Android 12 emulator doesn’t load any webpages (internet is working!)
It’s caused by vulkan. To fix it, you must turn vulkan off on emulator or chrome. # Here’s how to disable Vulkan apps to talk to the emulator. # Add the following lines to ~/.android/advancedFeatures.ini (create this file if it doesn’t exist already): Vulkan = off GLDirectMem = on If you want to use both … Read more
Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent, On AlarmPingSender
Add the following to your build.gradle(app) dependencies. dependencies { // For Java implementation ‘androidx.work:work-runtime:2.7.1’ // For Kotlin implementation ‘androidx.work:work-runtime-ktx:2.7.1’ }
Fatal Android 12: Exception: startForegroundService() not allowed due to mAllowStartForeground false
Apps that target Android 12 (API level 31) or higher can’t start foreground services while running in the background, except for a few special cases. If an app tries to start a foreground service while the app is running in the background, and the foreground service doesn’t satisfy one of the exceptional cases, the system … Read more
Why am I seeing EGL_emulation app_time_stats in the log when running on an Android 12 emulator?
Right click on D/EGL_emulation … in your RUN console window Click “Fold Lines Like This” Edit the filter that’s just been added to only contain D/EGL_emulation. All these lines will be removed from the RUN console window now
Manifest merger failed targeting Android 12 [duplicate]
The issue was caused by 3 activities missing the android:exported attribute in the androidx.test:core library version 1.3.0. Upgrading to version 1.4.0-beta01 fixed the issue. If you are getting errors after targeting Android 12, the easiest way to debug this is to: downgrade to a prior sdk version rebuild project after a successful build, open your … Read more
How to configure Toast icon in Android 12?
For me a simple restart of the device did the trick. I had not restarted my test phone after the update to Android 12 at all. I experienced the same odd bug that a generic app icon was shown in Toasts issued by my app. I tried changing the Manifest as Mickaël‘s answer suggested. No … Read more
Android 12 Splash Screen Icon Not Displaying
TL;DR kill the app and run from the launcher, icon does not show up when run from Android Studio. Adding my comment here as an answer for better visibility. I did figure out how to get it to show. I was following this tutorial to set up a base project to recreate the issue and … Read more
Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified
If using java or react-native then paste this inside app/build.gradle dependencies { // … implementation ‘androidx.work:work-runtime:2.7.1’ } If using Kotlin then use this dependencies { // … implementation ‘androidx.work:work-runtime-ktx:2.7.0’ } and if anybody still facing the crash issue for android 12 then make sure you add following in AndroidMenifest.xml <activity … android:exported=”true” // in most … Read more