After migration to AndroidX, exception at start up: java.lang.ClassNotFoundException: “Didn't find class androidx.core.app.CoreComponentFactory”

后端 未结 3 742
半阙折子戏
半阙折子戏 2020-12-30 01:05

After migration to AndroidX i have the following exception at startup:

LoadedApk: Unable to instantiate appComponentFactory
    java.lang.ClassNotFoundExcept         


        
相关标签:
3条回答
  • 2020-12-30 01:28

    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.

    0 讨论(0)
  • 2020-12-30 01:33

    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.

    0 讨论(0)
  • 2020-12-30 01:46

    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.

    0 讨论(0)
提交回复
热议问题