3

UPDATE #4: I have updated to Android Studio 4.2.1 and Realm 10.5.0 and the problem still occurs. Same line numbers on the exception as below.

UPDATE #3: Looking at the full stack trace (which you can see here), it appears this is an issue with Realm. I am using the 10.4.0 annotations processor, perhaps it is not yet fully compatible with AS 4.2?

Caused by: kotlin.KotlinNullPointerException
        at io.realm.processor.ModuleMetaData.getClassListFromModule(ModuleMetaData.kt:337)
        at io.realm.processor.ModuleMetaData.validateNamingPolicies(ModuleMetaData.kt:170)
        at io.realm.processor.ModuleMetaData.preProcess(ModuleMetaData.kt:113)
        at io.realm.processor.RealmProcessor.preProcessModules(RealmProcessor.kt:241)
        at io.realm.processor.RealmProcessor.process(RealmProcessor.kt:178)

The other odd thing - is now I realize that if I run an incremental build that fails, then run it again without making any code changes, it succeeds.

UPDATE #2:

Well that "fix" didn't actually fix anything. Just seemed to make it possible to get through one incremental build without an error, but now back to the same problem.

UPDATE:

I decided to completely remove my AS installation, then downloaded 4.2 and reinstalled. This came with its own set of issues (Sdk wasn't installed initially and when I tried to use the Sdk manager to do so, I got errors about it being corrupted), but I resolved those.

The error below occurred again, maddingly enough, but this time it had an extra line about my Application class using a deprecated API. Running lint showed no issues, but the suggestion was to include a compiler option to include lint while running the build, which I did. This gave me a new error, and when I then removed the -X command, all of a sudden I am not seeing this error anymore...

So I am not sure what "fixed" it, other than jogging the compile step with my argument then removing it.

I just updated to Android Studio 4.2 from 4.1.3, and also updated Gradle (6.7.1), Gradle plug-in(4.2.0), etc. Everything shows up to date.

I can do a full rebuild with no errors. However, if I make a single innocuous change and attempt an incremental build, I always get an error like this:

enter image description here

Doing a full build then works correctly.

I have tried:

  1. Invalidate cache restart
  2. Exit AS, delete the .gradle directory and restart, perform a full rebuild

Nothing seems to help.

Obviously some problem with the upgrade path, but I don't know how to fix! Help!

tfrysinger
  • 1,306
  • 11
  • 26
  • 1
    Same issue for me; using the same versions of Android Studio / gradle / realm as you. It compiles fine, then the next build breaks, then the next one works, etc. Sorry, I don't have a solution here :( – etienne May 10 '21 at 14:33
  • Have you figured out how to update your build.gradle file to have it download 10.5.0? – tfrysinger May 10 '21 at 15:42
  • Nope. I saw your post on the developer forum, though :) – etienne May 11 '21 at 09:02
  • 1
    I got word that 10.5.0 is now on mavenCentral(), which I can now reference in my build but I am still seeing this error... – tfrysinger May 13 '21 at 19:15
  • 1
    I have been facing the same issue for a few weeks. I have Realm in my project also and get the same error. Have you found any fix or got any word from Realm developers? – Akres Jun 09 '21 at 14:25
  • I asked on their forum, you can see the thread here: https://developer.mongodb.com/community/forums/t/repository-other-than-jcenter-to-get-realm-adapters-4-0-0/106236/6. You might chime in there, and also add a comment via the github link they posted in that same thread. – tfrysinger Jun 09 '21 at 15:33

0 Answers0