user3063925
user3063925

Reputation: 365

Realm 0.89 causes UnsatisfiedLinkError

Since upgrading from Realm 0.83.1 to 0.85 or 0.89, I'm unable to run the app. So I'm stuck in 0.83.1 version. I'm getting this weird link error when I run on the device. I'm trying to encrypt the database, but it's only fully supported in 0.85 or higher. Any help would be appreciated!

Here is my Logcat output: Caused by: java.lang.UnsatisfiedLinkError: No implementation found for java.lang.String io.realm.internal.Util.nativeGetTablePrefix() (tried Java_io_realm_internal_Util_nativeGetTablePrefix and Java_io_realm_internal_Util_nativeGetTablePrefix__) at io.realm.internal.Util.nativeGetTablePrefix(Native Method) at io.realm.internal.Util.getTablePrefix(Util.java:47) at io.realm.internal.Table.(Table.java:38) at io.realm.RealmSchema.(RealmSchema.java:40) at io.realm.BaseRealm.(BaseRealm.java:78) at io.realm.Realm.(Realm.java:138) at io.realm.Realm.createAndValidate(Realm.java:269) at io.realm.Realm.createInstance(Realm.java:249) at io.realm.RealmCache.createRealmOrGetFromCache(RealmCache.java:114) at io.realm.Realm.getDefaultInstance(Realm.java:195)

I tried creating an empty project and it seems to work fine, but it doesn't work on my real project. I suspect an issue with multi-dex, but I ran it on a phone with Android M and it failed the same way.

Upvotes: 1

Views: 282

Answers (1)

EpicPandaForce
EpicPandaForce

Reputation: 81539

0.88.0 has changed the way of adding Realm as a dependency. So instead of:

  • build.gradle (app level)

.

 dependencies {
     compile 'io.realm:realm-android:0.87.4'
 }

You have to do:

  • build.gradle (app level)

.

apply-plugin: 'realm-android'
  • build.gradle (project level)

.

buildscript {
    dependencies {
         classpath 'io.realm:realm-gradle-plugin:0.89.0'
    }
}

Upvotes: 2

Related Questions