I get this error when I install my release APK on a 5.x device. The error does not occur when I push the same code from Android Studio, or if I run it on a
My app was working on most platforms but crashing immediately on Android 5.1. I started to suspect the new D8 dex compiler after reading Google info on how great it is. Disabling D8, so it uses the original DX compiler, is the only thing that worked for me. Project clean/invalidate caches didn't fix it. I had some synchronized blocks, but removing them didn't fix it. Turning off instant run didn't fix it. Disabling proguard didn't fix it.
Here is how you disable D8:
-Create a file called gradle.properties in the root of your project, if it doesn't exist
-In it put this line: android.enableD8=false
You'll get deprecated warnings. Hopefully Google actually fixes D8 before they fully remove the deprecated DX. I don't know what in my code triggers it. I'm using Android Studio 3.2.1 with gradle version 4.6. Edit: I've reported this bug and Google developers are actively investigating