Didn't find class “androidx.core.app.CoreComponentFactory”

前端 未结 10 1169
一向
一向 2020-12-03 06:40

I don\'t know what to do about the following errors, I\'ve searched the web but not found anything:

java.lang.ClassNotFoundException: Didn\'t find class \"an         


        
相关标签:
10条回答
  • 2020-12-03 07:12

    In my case, the code works on one of my teammates' machine. These steps made it work for me too:

    1. Close project
    2. Remove the project from the list in the welcome screen
    3. Open the project again

    This is a solution to another problem, that I also found here in SO. It's worth a try when Invalidate and Restart doesn't solve it for you.

    0 讨论(0)
  • 2020-12-03 07:12

    After reviewing the Android Issue Tracker bug report mentioned previously, 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)
  • 2020-12-03 07:18

    See java.lang.ClassNotFoundException: Didn't find class "com.my_app_name.androidx".

    Remove from AndroidManifest:

    <application
        ...
        android:appComponentFactory="androidx"
        tools:replace="android:appComponentFactory"
    >
    

    These lines appeared a year ago after migrating to AndroidX. I removed them, now it doesn't show the exception.

    0 讨论(0)
  • 2020-12-03 07:21

    Seems to be a bug, check the next link in the issue tracker:

    https://issuetracker.google.com/issues/137646829

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