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
In my case, the code works on one of my teammates' machine. These steps made it work for me too:
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.
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.
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.
Seems to be a bug, check the next link in the issue tracker:
https://issuetracker.google.com/issues/137646829