After migration to AndroidX i have the following exception at startup:
LoadedApk: Unable to instantiate appComponentFactory
java.lang.ClassNotFoundExcept
Looks CoreComponentFactory
class is getting encrypted. Try adding the above class to proguard-rules.
-keep class androidx.core.app.CoreComponentFactory { *; }
So the CoreComponentFactory
won't be the encrypted anymore.
I hit this error while trying to run a debug
android app on an AVD emulator.
Wiping the data from the emulator (from the AVD Manager) fixed the issue.
After reviewing an Android Issue Tracker bug report from this question, I saw a mention about multidex support. I had no multidex flags specified in my project, so I tried setting the flag to false on all modules in my project, and the exception went away.
This was not a permanent solution; the problem returned a few builds later.