Closed gmkado closed 6 years ago
Are you using Android Studio 2 or 3 ? Does your project still build or not ?
With Android Studio 3 Beta (not alpha), I got theses kind of error:
Execution failed for task ':mymodule:compileDebugJavaWithJavac'.
> java.lang.ClassNotFoundException: my.realm.ClassExtendingRealmObject
It's related to how gradle build the project.
What you can do, temporary, is to recreate manually your xxxFields
classes
@gmkado That sounds mostly like a caching problem. When those happens I try to use this list :)
./gradlew clean
./gradlew --stop
rm -r .gradle
Restart Android Studio
Invalidate caches
Restart computer
Each one includes executing the previous ones in reverse order
Gradle can be painful sometimes 😞
Thanks for the suggestions! I'm sing Android Studio 2.3.3 and I managed to get it working again by adding apply plugin "idea"
to my build.gradle and rebuilding (after reading this https://github.com/tbroyer/gradle-apt-plugin/issues/26)
@gmkado Thank you for the solution. So please close the issue :-)
Hi @cmelchior hoping you can help me with an issue. I was using this library and it was working fine, but I recently tried to update my realm plugin to 3.7.1. Unrelatedly this broke my ability to use stetho-realm and I reverted back. In the process I did a lot of gradle fiddling and now my code is in a weird state where Android Studio doesn't recognize the "xxxFields" generated files that your library produces. It still builds fine but can't autocomplete anymore and I suspect won't update if I change the realm models.
I know this is vague, I'm not really sure how I got here. Do you know how to get this back to a working state? I tried "gradlew cleanBuildCache" and "invalidate Caches/Restart" with no luck.