question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

java.lang.NoSuchMethodError: No virtual method add(Lio/realm/Property;)Lio/realm/RealmObjectSchema; in class Lio/realm/RealmObjectSchema

See original GitHub issue

** ERROR**:

Process: ch999.app.UI, PID: 7374
 java.lang.NoSuchMethodError: No virtual method add(Lio/realm/Property;)Lio/realm/RealmObjectSchema; in class Lio/realm/RealmObjectSchema; or its super classes (declaration of 'io.realm.RealmObjectSchema' appears in /data/app/ch999.app.UI-2/split_lib_dependencies_apk.apk:classes36.dex)
                                                                at io.realm.DirectDataRealmProxy.createRealmObjectSchema(DirectDataRealmProxy.java:706)
                                                                at io.realm.BaseRealmModuleMediator.createRealmObjectSchema(BaseRealmModuleMediator.java:58)
                                                                at io.realm.internal.modules.CompositeMediator.createRealmObjectSchema(CompositeMediator.java:66)
                                                                at io.realm.Realm.initializeRealm(Realm.java:440)
                                                                at io.realm.Realm.createAndValidateFromCache(Realm.java:401)
                                                                at io.realm.Realm.createInstance(Realm.java:364)
                                                                at io.realm.RealmCache.doCreateRealmOrGetFromCache(RealmCache.java:346)
                                                                at io.realm.RealmCache.createRealmOrGetFromCache(RealmCache.java:284)
                                                                at io.realm.Realm.getInstance(Realm.java:293)
                                                                at com.ch999.util.BaseInfo.<init>(BaseInfo.java:59)
                                                                at com.ch999.util.BaseInfo.getInstance(BaseInfo.java:64)
                                                                at ch999.app.UI.JiujiApplication.setUp(JiujiApplication.java:80)
                                                                at ch999.app.UI.JiujiApplication.access$000(JiujiApplication.java:46)
                                                                at ch999.app.UI.JiujiApplication$1.run(JiujiApplication.java:58)
                                                                at java.lang.Thread.run(Thread.java:761)
classpath 'com.android.tools.build:gradle:2.3.3'
classpath "io.realm:realm-gradle-plugin:2.3.1"

2.3.2 perfectly normal before, then I through the APT to introduce third-party tools, began to appear error, access to information, I remove the “apply plugin: 'android - APT” and “annotationProcessor” instead, start now has been an error, version of the drop is not normal, be badly in need of help

Version of Realm and tooling

Realm version(s): 3.3.2

Android Studio version: 2.3.3

Which Android version and device:

nexus5 oneplus android 7.1.1

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:19 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
Zhuindencommented, Nov 7, 2019

This sounds like something you should either be able to fix with a clean/rebuild, or you are using another Realm-based library that is using an outdated version of Realm and relies on outdated internal code.

For example, an old version of Realm-Stetho could easily cause this problem.

1reaction
zaki50commented, Jun 23, 2017

@sdaduanbilei As the output says, com.ch999:BaseRes:2.1.6 originally has a dependency to io.realm:realm-android-library:2.3.1 but updated to io.realm:realm-android-library:3.3.2 by the final app.

That means com.ch999:BaseRes:2.1.6 was compiled with io.realm:realm-android-library:2.3.1 and contains generated code for that version.

You can’t mix multiple versions of Realm since generated code does not have a compatibility across versions.

To solve this, you need to recompile com.ch999:BaseRes:2.1.6 with Realm 3.3.2.

Read more comments on GitHub >

github_iconTop Results From Across the Web

java.lang.NoSuchMethodError: No virtual method
I really get stuck in resolving this error when i try to use two library having common class. E/AndroidRuntime: FATAL EXCEPTION: main ...
Read more >
No virtual method limit(I)Ljava/nio/ByteBuffer; on Android ...
With this information I expect that it can run on android OS 5 / API 21. But instead I found this error. Caused...
Read more >
Seemingly random "NoSuchMethodError: No virtual method"
These classes all exist, and Ive been able to run the project many times with them over the course of the last few...
Read more >
Mobile App Monitoring FAQ - IBM
What does the NoSuchMethodError: No virtual method log(Ljava/lang/String;)V in class Lokhttp3/internal/Platform; runtime error mean? What does the android.os.
Read more >
No virtual method load(Ljava/lang/String;)Lcom/squareup ...
Android Question java.lang.NoSuchMethodError: No virtual method load(Ljava/lang/String;)Lcom/squareup/picasso/Request.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found