Hi guys
Yes I found the solution.
First, you should know how to debug your device because chances are it will not be exactly the same error.
So to debug after you build/install a debug version of your app on an Android 12 Device
BEFORE opening your app use a terminal console software on your PC WITH A SEARCH FUNCTION
I use personally Tilix
- Enable USB debug on device
- Connect with USB
- On PC type:
adb devices
- Get IN your device with
adb shell
- Once inside the device:
logcat *:E
- Then open quickly your app and let it crash with the black screen
- A wall of error will show up on the terminal. Use the search function and type the ID of your app like: com.my.app
- Then try to pinpoint YOUR errors
For ME, I had 3 problems:
-
The screen was Black/White/Blank because Ionic Native Storage was out of date. Android Level 30+ uses a new storage system. For me, it was blocking my Authorization Token stored. So gave me a black screen. If you update your package it should work.
-
My app was still crashing due to Multidex. Here’s the problem/solution: https://forum.ionicframework.com/t/java-lang-runtimeexception-unable-to-instantiate-application-android-hardware-bluetooth/224599
-
And finally in the
logcat
if you see android.permission.BLABLABLA like
android.permission.BLUETOOTH_CONNECT
android.permission.BLUETOOTH_SCAN
It’s most likely you’ll need to add permissions in your config.xml
AND IMPORTANT FOR ANDROID API 30+
Android Permissions | Android Device and Ionic App Permissions
It will FORCE an android modal popup a permission modal to allow whatever native function you need. You MUST use this on API 30+
Good luck