New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

couldn't find "librealm-jni.so" #1421

Closed
DenisBronx opened this Issue Aug 25, 2015 · 91 comments

Comments

Projects
None yet
@DenisBronx

DenisBronx commented Aug 25, 2015

After the last android updates i found this error in every project i use realm

this is the stacktrace:

08-25 16:03:40.457 16017-16017/it.fortech.fortechmobilepayment E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: it.fortech.fortechmobilepayment, PID: 16017
java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/it.fortech.fortechmobilepayment-2/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]] couldn't find "librealm-jni.so"
at java.lang.Runtime.loadLibrary(Runtime.java:366)
at java.lang.System.loadLibrary(System.java:988)
at io.realm.internal.RealmCore.loadLibrary(RealmCore.java:114)
at io.realm.internal.SharedGroup.(SharedGroup.java:35)
at io.realm.Realm.(Realm.java:205)
at io.realm.Realm.createAndValidate(Realm.java:594)
at io.realm.Realm.create(Realm.java:564)
at io.realm.Realm.getInstance(Realm.java:411)
at io.realm.Realm.getInstance(Realm.java:368)
at io.realm.Realm.getInstance(Realm.java:349)
at it.fortech.fortechmobilepayment.account.LoginActivity.onCreate(LoginActivity.java:55)
at android.app.Activity.performCreate(Activity.java:5990)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387)
at android.app.ActivityThread.access$800(ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)

Tested on Nexus 5 device
Android Studio 1.3
OS X 10.10.5

@beeender

This comment has been minimized.

Show comment
Hide comment
@beeender

beeender Aug 25, 2015

Contributor

@DenisBronx Can you get into the /data/data/<package_name>/lib to see if the librealm-jni.so is there?

Contributor

beeender commented Aug 25, 2015

@DenisBronx Can you get into the /data/data/<package_name>/lib to see if the librealm-jni.so is there?

@DenisBronx

This comment has been minimized.

Show comment
Hide comment
@DenisBronx

DenisBronx Aug 25, 2015

schermata 2015-08-25 alle 16 45 25

yes, and i get the same error in the emulator (i don't know the file explorer very well but i assume the lib folder is empty)

DenisBronx commented Aug 25, 2015

schermata 2015-08-25 alle 16 45 25

yes, and i get the same error in the emulator (i don't know the file explorer very well but i assume the lib folder is empty)

@beeender

This comment has been minimized.

Show comment
Hide comment
@beeender

beeender Aug 25, 2015

Contributor

@DenisBronx It is a symbolic link point to the anther directory. Please help to check if /data/app-lib/it.fortech.fotechmobilepayment contains the librealm-jni.so . That directory should have sub directories like x86 arm etc.

Contributor

beeender commented Aug 25, 2015

@DenisBronx It is a symbolic link point to the anther directory. Please help to check if /data/app-lib/it.fortech.fotechmobilepayment contains the librealm-jni.so . That directory should have sub directories like x86 arm etc.

@DenisBronx

This comment has been minimized.

Show comment
Hide comment
@DenisBronx

DenisBronx Aug 25, 2015

@beeender it is empty i believe
schermata 2015-08-25 alle 16 55 41

DenisBronx commented Aug 25, 2015

@beeender it is empty i believe
schermata 2015-08-25 alle 16 55 41

@luca992

This comment has been minimized.

Show comment
Hide comment
@luca992

luca992 Aug 25, 2015

any updates?

luca992 commented Aug 25, 2015

any updates?

@joey-harward

This comment has been minimized.

Show comment
Hide comment
@joey-harward

joey-harward Aug 25, 2015

I think I'm having the same problem. Did you find a solution?

joey-harward commented Aug 25, 2015

I think I'm having the same problem. Did you find a solution?

@luca992

This comment has been minimized.

Show comment
Hide comment
@luca992

luca992 Aug 26, 2015

Finally figured out my issue like 5 hours later.... -_-
make sure your gradle version is not:

classpath 'com.android.tools.build:gradle:+'

I changed mine to the latest and it works like before

classpath 'com.android.tools.build:gradle:1.3.1'

luca992 commented Aug 26, 2015

Finally figured out my issue like 5 hours later.... -_-
make sure your gradle version is not:

classpath 'com.android.tools.build:gradle:+'

I changed mine to the latest and it works like before

classpath 'com.android.tools.build:gradle:1.3.1'

@DenisBronx

This comment has been minimized.

Show comment
Hide comment
@DenisBronx

DenisBronx Aug 26, 2015

thanks @luca992, it works!

DenisBronx commented Aug 26, 2015

thanks @luca992, it works!

@beeender

This comment has been minimized.

Show comment
Hide comment
@beeender

beeender Aug 26, 2015

Contributor

It is quite strange since we don't depend on any version of gradle or the android plugin…
Anyway, it is good to see that this problem is solved!
I am closing this issue now, thanks for the feedback!

Contributor

beeender commented Aug 26, 2015

It is quite strange since we don't depend on any version of gradle or the android plugin…
Anyway, it is good to see that this problem is solved!
I am closing this issue now, thanks for the feedback!

@beeender beeender closed this Aug 26, 2015

@FishOSU

This comment has been minimized.

Show comment
Hide comment
@FishOSU

FishOSU Aug 26, 2015

Both my coworker and I are seeing this independently and changing the gradle version did not help.

EDIT: It turns out that we had an outdated gradle version referenced at a level above. Updating that fixed everything.

FishOSU commented Aug 26, 2015

Both my coworker and I are seeing this independently and changing the gradle version did not help.

EDIT: It turns out that we had an outdated gradle version referenced at a level above. Updating that fixed everything.

@joey-harward

This comment has been minimized.

Show comment
Hide comment
@joey-harward

joey-harward Aug 26, 2015

thanks @luca992, I actually had to set my gradle version to 1.3.0 for it work

joey-harward commented Aug 26, 2015

thanks @luca992, I actually had to set my gradle version to 1.3.0 for it work

@chrisjenx

This comment has been minimized.

Show comment
Hide comment
@chrisjenx

chrisjenx Aug 31, 2015

Has this been reported to b.android.com, this seems to be a build issue with build tools 1.4.0-beta.

chrisjenx commented Aug 31, 2015

Has this been reported to b.android.com, this seems to be a build issue with build tools 1.4.0-beta.

@windzie

This comment has been minimized.

Show comment
Hide comment
@windzie

windzie Sep 13, 2015

This same, build issue with build tools 1.4.0-beta

windzie commented Sep 13, 2015

This same, build issue with build tools 1.4.0-beta

@hohnamkung

This comment has been minimized.

Show comment
Hide comment
@hohnamkung

hohnamkung Sep 16, 2015

This problem still happen in build tools 1.4.0-beta2. Is there a any progress?

hohnamkung commented Sep 16, 2015

This problem still happen in build tools 1.4.0-beta2. Is there a any progress?

@lvialle

This comment has been minimized.

Show comment
Hide comment
@lvialle

lvialle Sep 21, 2015

I left a bug report on the Android Developer Tools Google+ Community as I had the same issue:
https://plus.google.com/+LudovicVialle/posts/7BRvbb3uKCY

I tried the Jar, same issue, the .so are not copied for any ABI. I think this is an issue within the latest build tools and Gradle.

lvialle commented Sep 21, 2015

I left a bug report on the Android Developer Tools Google+ Community as I had the same issue:
https://plus.google.com/+LudovicVialle/posts/7BRvbb3uKCY

I tried the Jar, same issue, the .so are not copied for any ABI. I think this is an issue within the latest build tools and Gradle.

@cmelchior

This comment has been minimized.

Show comment
Hide comment
@cmelchior

cmelchior Sep 24, 2015

Contributor

Reopening this just so it is more visible, in case anyone else run into this problem. However it doesn't sound like it is something we can do much about at this time unfortunately.

This bug report on the bug tracker https://code.google.com/p/android/issues/detail?id=182061 seems to indicate it is fixed but not yet released for some reason.

Contributor

cmelchior commented Sep 24, 2015

Reopening this just so it is more visible, in case anyone else run into this problem. However it doesn't sound like it is something we can do much about at this time unfortunately.

This bug report on the bug tracker https://code.google.com/p/android/issues/detail?id=182061 seems to indicate it is fixed but not yet released for some reason.

@cmelchior cmelchior reopened this Sep 24, 2015

@cmelchior cmelchior added the T:Bug label Sep 24, 2015

@kneth kneth added the Pending label Sep 28, 2015

@shadow7

This comment has been minimized.

Show comment
Hide comment
@shadow7

shadow7 Sep 30, 2015

I have a similar error message:

java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.shareyourproxy-1/base.apk"],nativeLibraryDirectories=[/data/app/com.shareyourproxy-1/lib/arm, /vendor/lib, /system/lib]]] couldn't find "librealm-jni.so"

Like the error says, "lib/arm/librealm-jni.so" is missing from the compiled dependencies. I've tried downloading the realm-0.82.2.jar on the website to use as a local copy. I've extracted the contents of the jar and copied the contents of "lib/armeabi/librealm-jni.so" into the previously mentioned folder hierarchy to attempt to mitigate the error. When I repackage the jar, I can't use it to import any io.realm packages in my java like I could with the original unmodified jar.

I'm using:
Android Studio 1.4 RC-2
buildToolsVersion '23.0.1'
'com.android.tools.build:gradle:1.3.2' <-- I've tried many versions explicitly

shadow7 commented Sep 30, 2015

I have a similar error message:

java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.shareyourproxy-1/base.apk"],nativeLibraryDirectories=[/data/app/com.shareyourproxy-1/lib/arm, /vendor/lib, /system/lib]]] couldn't find "librealm-jni.so"

Like the error says, "lib/arm/librealm-jni.so" is missing from the compiled dependencies. I've tried downloading the realm-0.82.2.jar on the website to use as a local copy. I've extracted the contents of the jar and copied the contents of "lib/armeabi/librealm-jni.so" into the previously mentioned folder hierarchy to attempt to mitigate the error. When I repackage the jar, I can't use it to import any io.realm packages in my java like I could with the original unmodified jar.

I'm using:
Android Studio 1.4 RC-2
buildToolsVersion '23.0.1'
'com.android.tools.build:gradle:1.3.2' <-- I've tried many versions explicitly

@kranthipamarthi

This comment has been minimized.

Show comment
Hide comment
@kranthipamarthi

kranthipamarthi Sep 30, 2015

Had the same issue, used 'com.android.tools.build:gradle:1.2.3' to resolve.

And my app was using latest google+ integration (version 8.1.0) and I had to revert to older version of google+ library to resolve the issue.

kranthipamarthi commented Sep 30, 2015

Had the same issue, used 'com.android.tools.build:gradle:1.2.3' to resolve.

And my app was using latest google+ integration (version 8.1.0) and I had to revert to older version of google+ library to resolve the issue.

@lvialle

This comment has been minimized.

Show comment
Hide comment
@lvialle

lvialle Oct 1, 2015

1.4.0-beta3 gradle plugin should fix it based on the release notes:
https://sites.google.com/a/android.com/tools/tech-docs/new-build-system#release-notes

I did not tested yet.

lvialle commented Oct 1, 2015

1.4.0-beta3 gradle plugin should fix it based on the release notes:
https://sites.google.com/a/android.com/tools/tech-docs/new-build-system#release-notes

I did not tested yet.

@kevinvanmierlo

This comment has been minimized.

Show comment
Hide comment
@kevinvanmierlo

kevinvanmierlo Oct 1, 2015

@lvialle No it isn't fixed yet, unfortunately. I just tried it like an hour ago.

kevinvanmierlo commented Oct 1, 2015

@lvialle No it isn't fixed yet, unfortunately. I just tried it like an hour ago.

@JonathonFry

This comment has been minimized.

Show comment
Hide comment
@JonathonFry

JonathonFry Oct 1, 2015

@lvialle Yeah still not fixed for me either on 1.4.0-beta3 :)

JonathonFry commented Oct 1, 2015

@lvialle Yeah still not fixed for me either on 1.4.0-beta3 :)

@tajchert

This comment has been minimized.

Show comment
Hide comment
@tajchert

tajchert Oct 1, 2015

Same here with 1.4.0-beta3, dang can't use onProvideAssistContent() without it.

tajchert commented Oct 1, 2015

Same here with 1.4.0-beta3, dang can't use onProvideAssistContent() without it.

@tbsandee

This comment has been minimized.

Show comment
Hide comment
@tbsandee

tbsandee Oct 1, 2015

Contributor

Same on 1.4.0-beta4. It's a shame, the 1.4.0 plugin fixes a a showstoppper bug in another area for us. It's like whack-a-mole with this stuff. :/

Contributor

tbsandee commented Oct 1, 2015

Same on 1.4.0-beta4. It's a shame, the 1.4.0 plugin fixes a a showstoppper bug in another area for us. It's like whack-a-mole with this stuff. :/

@balachandarlinks

This comment has been minimized.

Show comment
Hide comment
@balachandarlinks

balachandarlinks Oct 1, 2015

This is really an annoying show stopper for my app :( Not fixed in 1.4.0-beta4 as well !

balachandarlinks commented Oct 1, 2015

This is really an annoying show stopper for my app :( Not fixed in 1.4.0-beta4 as well !

@cmelchior

This comment has been minimized.

Show comment
Hide comment
@azizj1

This comment has been minimized.

Show comment
Hide comment
@azizj1

azizj1 Oct 7, 2015

beta6 doesn't work either :|

azizj1 commented Oct 7, 2015

beta6 doesn't work either :|

@azizj1

This comment has been minimized.

Show comment
Hide comment
@azizj1

azizj1 Oct 7, 2015

Solved! For me the problem wasn't the com.android.tools.build:gradle:1.3.0 or 1.3.1, it was
classpath 'com.google.gms:google-services:1.4.0-beta3' !

So my project gradle looks like this:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.1'
classpath 'com.google.gms:google-services:1.3.0-beta1'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4'
}
}

allprojects {
repositories {
jcenter()
}
}

Didn't have to change com.google.android.gms:play-services-plus. Mine is still at com.google.android.gms:play-services-plus:8.1.0

Furthermore, I'm having bunch of issues with com.google.gms:google-services:1.4.0-beta3 - every now and then i'll get this error:

Error:Execution failed for task ':app:transformClassesWithDexForDebug'.

com.android.build.transform.api.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home/bin/java'' finished with non-zero exit value 2

and the building and running of app is super slow.

But anyways, I digress. I solved my issue by replacing
classpath 'com.google.gms:google-services:1.4.0-beta3'

with
classpath 'com.google.gms:google-services:1.3.0-beta1'

Tested on both 4.4.2 and 5.0.2 (physical devices)

azizj1 commented Oct 7, 2015

Solved! For me the problem wasn't the com.android.tools.build:gradle:1.3.0 or 1.3.1, it was
classpath 'com.google.gms:google-services:1.4.0-beta3' !

So my project gradle looks like this:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.1'
classpath 'com.google.gms:google-services:1.3.0-beta1'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4'
}
}

allprojects {
repositories {
jcenter()
}
}

Didn't have to change com.google.android.gms:play-services-plus. Mine is still at com.google.android.gms:play-services-plus:8.1.0

Furthermore, I'm having bunch of issues with com.google.gms:google-services:1.4.0-beta3 - every now and then i'll get this error:

Error:Execution failed for task ':app:transformClassesWithDexForDebug'.

com.android.build.transform.api.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home/bin/java'' finished with non-zero exit value 2

and the building and running of app is super slow.

But anyways, I digress. I solved my issue by replacing
classpath 'com.google.gms:google-services:1.4.0-beta3'

with
classpath 'com.google.gms:google-services:1.3.0-beta1'

Tested on both 4.4.2 and 5.0.2 (physical devices)

@yshrsmz

This comment has been minimized.

Show comment
Hide comment
@yshrsmz

yshrsmz Oct 8, 2015

In my case,

classpath 'com.android.databinding:dataBinder:1.0-rc3

caused the problem.
Reverting to rc2 solved the issue.

yshrsmz commented Oct 8, 2015

In my case,

classpath 'com.android.databinding:dataBinder:1.0-rc3

caused the problem.
Reverting to rc2 solved the issue.

@zaki50

This comment has been minimized.

Show comment
Hide comment
@zaki50

zaki50 Oct 8, 2015

Contributor

@yshrsmz I confirmed that. dataBinder:1.0-rc3 replaces com.android.tools.build:gradle plugin with version 1.4.0-beta5

Contributor

zaki50 commented Oct 8, 2015

@yshrsmz I confirmed that. dataBinder:1.0-rc3 replaces com.android.tools.build:gradle plugin with version 1.4.0-beta5

@pastelsky

This comment has been minimized.

Show comment
Hide comment
@pastelsky

pastelsky Oct 10, 2015

Okay, rolling back to classpath 'com.android.databinding:dataBinder:1.0-rc2 does solve the issue but it seems to break the data binding library itself on gradle 1.4.0-6beta (which is needed for vector drawables 😔). Its so frustrating.

pastelsky commented Oct 10, 2015

Okay, rolling back to classpath 'com.android.databinding:dataBinder:1.0-rc2 does solve the issue but it seems to break the data binding library itself on gradle 1.4.0-6beta (which is needed for vector drawables 😔). Its so frustrating.

@dalinaum

This comment has been minimized.

Show comment
Hide comment
@dalinaum

dalinaum Oct 12, 2015

Contributor

@zaki50 Do you know why dataBinder:1.0-rc3 causes couldn't find "librealm-jni.so"? It's a very interesting.

Contributor

dalinaum commented Oct 12, 2015

@zaki50 Do you know why dataBinder:1.0-rc3 causes couldn't find "librealm-jni.so"? It's a very interesting.

@zaki50

This comment has been minimized.

Show comment
Hide comment
@zaki50

zaki50 Oct 12, 2015

Contributor

@dalinaum dataBinder:1.0-rc3 replaces com.android.tools.build:gradle plugin with version 1.4.0-beta5, and com.android.tools.build:gradle 1.4.0-beta3 or newer has a bug which does not include .so files into apk file.

Contributor

zaki50 commented Oct 12, 2015

@dalinaum dataBinder:1.0-rc3 replaces com.android.tools.build:gradle plugin with version 1.4.0-beta5, and com.android.tools.build:gradle 1.4.0-beta3 or newer has a bug which does not include .so files into apk file.

@dalinaum

This comment has been minimized.

Show comment
Hide comment
@dalinaum

dalinaum Oct 12, 2015

Contributor

@zaki50 Thanks for your kind explanation :)

Contributor

dalinaum commented Oct 12, 2015

@zaki50 Thanks for your kind explanation :)

@Chris59160

This comment has been minimized.

Show comment
Hide comment
@Chris59160

Chris59160 Oct 15, 2015

THe bug is still there with com.google.gms:google-services:1.4.0-beta3 . Trying to use google analytics, I have to put com.google.gms:google-services:1.3.1 to make sure Realm can be instantiated

Chris59160 commented Oct 15, 2015

THe bug is still there with com.google.gms:google-services:1.4.0-beta3 . Trying to use google analytics, I have to put com.google.gms:google-services:1.3.1 to make sure Realm can be instantiated

@kouroshfar

This comment has been minimized.

Show comment
Hide comment
@kouroshfar

kouroshfar Feb 13, 2016

I'm using android studio 1.5.1 and don't use version 2. actually i don't have instant run.
I use gradle version 1.5.0 and Realm 0.87.4, but not fixed yet :|

kouroshfar commented Feb 13, 2016

I'm using android studio 1.5.1 and don't use version 2. actually i don't have instant run.
I use gradle version 1.5.0 and Realm 0.87.4, but not fixed yet :|

@kouroshfar

This comment has been minimized.

Show comment
Hide comment
@kouroshfar

kouroshfar Feb 13, 2016

I have tested with android studio 2.0 beta 4, android gradle plugin 2.0.0-beta4, and Realm 0.87.4 and I see the same issue with loading .so files. :/

kouroshfar commented Feb 13, 2016

I have tested with android studio 2.0 beta 4, android gradle plugin 2.0.0-beta4, and Realm 0.87.4 and I see the same issue with loading .so files. :/

@marcelohd

This comment has been minimized.

Show comment
Hide comment
@marcelohd

marcelohd Feb 14, 2016

without instant run?

marcelohd commented Feb 14, 2016

without instant run?

@kouroshfar

This comment has been minimized.

Show comment
Hide comment
@kouroshfar

kouroshfar Feb 14, 2016

@marcelohd Yes. When i disabled instant run, then throw old exception (couldn't find "librealm-jni.so")!

kouroshfar commented Feb 14, 2016

@marcelohd Yes. When i disabled instant run, then throw old exception (couldn't find "librealm-jni.so")!

@dalinaum

This comment has been minimized.

Show comment
Hide comment
@dalinaum

dalinaum Feb 15, 2016

Contributor

Hello @kouroshfar What devices did you test on? Can you reproduce this problem?

Contributor

dalinaum commented Feb 15, 2016

Hello @kouroshfar What devices did you test on? Can you reproduce this problem?

@kouroshfar

This comment has been minimized.

Show comment
Hide comment
@kouroshfar

kouroshfar Feb 16, 2016

Hello @dalinaum . I'm using Sony Z3 for debug. I'm testing my test app on genymotion, but reproduce this problem and not solved.

kouroshfar commented Feb 16, 2016

Hello @dalinaum . I'm using Sony Z3 for debug. I'm testing my test app on genymotion, but reproduce this problem and not solved.

@dalinaum dalinaum reopened this Feb 19, 2016

@cmelchior

This comment has been minimized.

Show comment
Hide comment
@cmelchior

cmelchior Feb 22, 2016

Contributor

Hi @kouroshfar
Sorry for the late reply. Note that you need to uninstall the old app even after disabling Instant Run, as the byte code might still be wrong on the device. Are you still seeing this problem then?

Contributor

cmelchior commented Feb 22, 2016

Hi @kouroshfar
Sorry for the late reply. Note that you need to uninstall the old app even after disabling Instant Run, as the byte code might still be wrong on the device. Are you still seeing this problem then?

@marcelohd

This comment has been minimized.

Show comment
Hide comment
@marcelohd

marcelohd Feb 22, 2016

Hi @cmelchior,
I will check, possible can happen in my code too

marcelohd commented Feb 22, 2016

Hi @cmelchior,
I will check, possible can happen in my code too

@shalperin

This comment has been minimized.

Show comment
Hide comment
@shalperin

shalperin Mar 4, 2016

couldn't find "librealm-jni.so"
Build tools com.android.tools.build:gradle:2.0.0-beta6 (android studio 2)
"resolved" by disabling instant run.

shalperin commented Mar 4, 2016

couldn't find "librealm-jni.so"
Build tools com.android.tools.build:gradle:2.0.0-beta6 (android studio 2)
"resolved" by disabling instant run.

@Queatz

This comment has been minimized.

Show comment
Hide comment
@Queatz

Queatz Mar 6, 2016

Got around it by disabling Instant Run.

Queatz commented Mar 6, 2016

Got around it by disabling Instant Run.

@cmelchior

This comment has been minimized.

Show comment
Hide comment
@cmelchior

cmelchior Mar 7, 2016

Contributor

Hi @kouroshfar
Google introduced some fixes to this problem in beta6 (Realm uses native code): http://tools.android.com/recent/androidstudio20beta6availableinthecanarychannel

I'll close this issue now, but feel free to reopen if you see this on beta6 or above.

Contributor

cmelchior commented Mar 7, 2016

Hi @kouroshfar
Google introduced some fixes to this problem in beta6 (Realm uses native code): http://tools.android.com/recent/androidstudio20beta6availableinthecanarychannel

I'll close this issue now, but feel free to reopen if you see this on beta6 or above.

@hardysim

This comment has been minimized.

Show comment
Hide comment
@hardysim

hardysim Mar 7, 2016

Hey, I have the same problem with Android Studio 2.0 Beta 6. Only disabling InstantRun is working.

hardysim commented Mar 7, 2016

Hey, I have the same problem with Android Studio 2.0 Beta 6. Only disabling InstantRun is working.

@kneth kneth reopened this Mar 8, 2016

@Queatz

This comment has been minimized.

Show comment
Hide comment
@Queatz

Queatz Mar 8, 2016

beta6 not working for me either, still need to disabled Instant Run.

Queatz commented Mar 8, 2016

beta6 not working for me either, still need to disabled Instant Run.

@marcelohd

This comment has been minimized.

Show comment
Hide comment
@marcelohd

marcelohd Mar 8, 2016

Any version starting Android Studio 2.0 (Preview), only build with instant run disable.

marcelohd commented Mar 8, 2016

Any version starting Android Studio 2.0 (Preview), only build with instant run disable.

@kneth

This comment has been minimized.

Show comment
Hide comment
@kneth

kneth Mar 9, 2016

Contributor

Let's close it as it is scheduled but out of our hands.

Contributor

kneth commented Mar 9, 2016

Let's close it as it is scheduled but out of our hands.

@kneth kneth closed this Mar 9, 2016

@iBotasky

This comment has been minimized.

Show comment
Hide comment
@iBotasky

iBotasky Sep 30, 2016

@kneth I got the same issue, I'm trying to update the Realm from 0.87 to 2.0.0 , but i can't run the app with the problem com.getkeepsafe.relinker.MissingLibraryException: lib/armeabi/librealm-jni.so;
And my gradle version is 'com.android.tools.build:gradle:2.2.0'. I also try to disbinding the instant run and add classpath 'com.google.gms:google-services:1.3.0-beta1' in Gradle, but it doesn't work too.

iBotasky commented Sep 30, 2016

@kneth I got the same issue, I'm trying to update the Realm from 0.87 to 2.0.0 , but i can't run the app with the problem com.getkeepsafe.relinker.MissingLibraryException: lib/armeabi/librealm-jni.so;
And my gradle version is 'com.android.tools.build:gradle:2.2.0'. I also try to disbinding the instant run and add classpath 'com.google.gms:google-services:1.3.0-beta1' in Gradle, but it doesn't work too.

@beeender

This comment has been minimized.

Show comment
Hide comment
@beeender

beeender Sep 30, 2016

Contributor

@Botasky369 Do you have any other library which has a .so file? We removed armeabi so in 2.0.0 which will cause this problem if your other library has an armeabi so file.

Contributor

beeender commented Sep 30, 2016

@Botasky369 Do you have any other library which has a .so file? We removed armeabi so in 2.0.0 which will cause this problem if your other library has an armeabi so file.

@iBotasky

This comment has been minimized.

Show comment
Hide comment
@iBotasky

iBotasky Sep 30, 2016

@beeender Yes, I found some .so in my /data/data/packagename/lib file, some like libamapv304.so/libamapv304ex.so/libBugTags.so and others . But there is not librealm-jni.so.
So you mean that we have to delete the armeabi file in our project?

iBotasky commented Sep 30, 2016

@beeender Yes, I found some .so in my /data/data/packagename/lib file, some like libamapv304.so/libamapv304ex.so/libBugTags.so and others . But there is not librealm-jni.so.
So you mean that we have to delete the armeabi file in our project?

@beeender

This comment has been minimized.

Show comment
Hide comment
@beeender

beeender Sep 30, 2016

Contributor

@Botasky369 It depends. If all the libs have armeabi-v7a so files, you can safely exclude those armeabi version since all arm devices in the market today should support armeabi-v7a well.

Contributor

beeender commented Sep 30, 2016

@Botasky369 It depends. If all the libs have armeabi-v7a so files, you can safely exclude those armeabi version since all arm devices in the market today should support armeabi-v7a well.

@iBotasky

This comment has been minimized.

Show comment
Hide comment
@iBotasky

iBotasky Sep 30, 2016

@beeender I delete the armabi file in my project, But it also doesn't work.

iBotasky commented Sep 30, 2016

@beeender I delete the armabi file in my project, But it also doesn't work.

@iBotasky

This comment has been minimized.

Show comment
Hide comment
@iBotasky

iBotasky Sep 30, 2016

@beeender I have clean and rebulid the projiect.

iBotasky commented Sep 30, 2016

@beeender I have clean and rebulid the projiect.

@beeender

This comment has been minimized.

Show comment
Hide comment
@beeender

beeender Sep 30, 2016

Contributor

@Botasky369 can you decompress you final apk file, and show the list and structure of lib dir inside the apk?

Contributor

beeender commented Sep 30, 2016

@Botasky369 can you decompress you final apk file, and show the list and structure of lib dir inside the apk?

@iBotasky

This comment has been minimized.

Show comment
Hide comment
@iBotasky

iBotasky Sep 30, 2016

@beeender That's Bad, I don't know why. I can decompress the apk before I update the AndroidSutdio to 2.2
image

iBotasky commented Sep 30, 2016

@beeender That's Bad, I don't know why. I can decompress the apk before I update the AndroidSutdio to 2.2
image

@iBotasky

This comment has been minimized.

Show comment
Hide comment
@iBotasky

iBotasky Sep 30, 2016

@beeender Well, I found there has some code was suspicious at the gradle, and I delete it, and the app can run normal.Thx.
The code delete:
image
Thank again. You can close my isssue.

iBotasky commented Sep 30, 2016

@beeender Well, I found there has some code was suspicious at the gradle, and I delete it, and the app can run normal.Thx.
The code delete:
image
Thank again. You can close my isssue.

@rahulkumarit

This comment has been minimized.

Show comment
Hide comment
@rahulkumarit

rahulkumarit Feb 21, 2018

compile 'io.realm:realm-android:0.87.4'
I have added but getting in error in run time..

rahulkumarit commented Feb 21, 2018

compile 'io.realm:realm-android:0.87.4'
I have added but getting in error in run time..

@Zhuinden

This comment has been minimized.

Show comment
Hide comment
@Zhuinden

Zhuinden Feb 21, 2018

Contributor

Hello, 0.87.4 is super old, the latest version is 4.3.4 5.1.0

please read https://realm.io/docs/java/latest/

Contributor

Zhuinden commented Feb 21, 2018

Hello, 0.87.4 is super old, the latest version is 4.3.4 5.1.0

please read https://realm.io/docs/java/latest/

@rhonyabdullah

This comment has been minimized.

Show comment
Hide comment
@rhonyabdullah

rhonyabdullah May 7, 2018

Hello, this is appear again if i'm using proguard on my release buildTypes:

java.lang.RuntimeException: Unable to create application com.myapps.android.app.Myapps: com.getkeepsafe.relinker.MissingLibraryException: lib/x86/librealm-jni.so
        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5794)
        at android.app.ActivityThread.-wrap1(Unknown Source:0)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1661)
        at android.os.Handler.dispatchMessage(Handler.java:105)
        at android.os.Looper.loop(Looper.java:164)
        at android.app.ActivityThread.main(ActivityThread.java:6541)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
     Caused by: com.getkeepsafe.relinker.MissingLibraryException: lib/x86/librealm-jni.so
        at com.getkeepsafe.relinker.ApkLibraryInstaller.installLibrary(SourceFile:85)
        at com.getkeepsafe.relinker.ReLinkerInstance.loadLibraryInternal(SourceFile:180)
        at com.getkeepsafe.relinker.ReLinkerInstance.loadLibrary(SourceFile:136)
        at com.getkeepsafe.relinker.ReLinker.loadLibrary(SourceFile:70)
        at com.getkeepsafe.relinker.ReLinker.loadLibrary(SourceFile:57)
        at io.realm.internal.RealmCore.a(SourceFile:60)
        at io.realm.Realm.a(SourceFile:258)
        at com.myapps.android.app.Myapps.initRealm(SourceFile:102)
        at com.myapps.android.app.Myapps.onCreate(SourceFile:82)

rhonyabdullah commented May 7, 2018

Hello, this is appear again if i'm using proguard on my release buildTypes:

java.lang.RuntimeException: Unable to create application com.myapps.android.app.Myapps: com.getkeepsafe.relinker.MissingLibraryException: lib/x86/librealm-jni.so
        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5794)
        at android.app.ActivityThread.-wrap1(Unknown Source:0)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1661)
        at android.os.Handler.dispatchMessage(Handler.java:105)
        at android.os.Looper.loop(Looper.java:164)
        at android.app.ActivityThread.main(ActivityThread.java:6541)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
     Caused by: com.getkeepsafe.relinker.MissingLibraryException: lib/x86/librealm-jni.so
        at com.getkeepsafe.relinker.ApkLibraryInstaller.installLibrary(SourceFile:85)
        at com.getkeepsafe.relinker.ReLinkerInstance.loadLibraryInternal(SourceFile:180)
        at com.getkeepsafe.relinker.ReLinkerInstance.loadLibrary(SourceFile:136)
        at com.getkeepsafe.relinker.ReLinker.loadLibrary(SourceFile:70)
        at com.getkeepsafe.relinker.ReLinker.loadLibrary(SourceFile:57)
        at io.realm.internal.RealmCore.a(SourceFile:60)
        at io.realm.Realm.a(SourceFile:258)
        at com.myapps.android.app.Myapps.initRealm(SourceFile:102)
        at com.myapps.android.app.Myapps.onCreate(SourceFile:82)
@Zhuinden

This comment has been minimized.

Show comment
Hide comment
@Zhuinden

Zhuinden May 7, 2018

Contributor

Well if Relinker can't find it, it's not there. You might have an abiFilter set up and it removes x86.

Contributor

Zhuinden commented May 7, 2018

Well if Relinker can't find it, it's not there. You might have an abiFilter set up and it removes x86.

@rhonyabdullah

This comment has been minimized.

Show comment
Hide comment
@rhonyabdullah

rhonyabdullah May 8, 2018

So what should i do ? Is this correct if i'm doing this:

android {
packagingOptions {
        exclude 'lib/x86_64/librealm-jni.so'
    }
}

rhonyabdullah commented May 8, 2018

So what should i do ? Is this correct if i'm doing this:

android {
packagingOptions {
        exclude 'lib/x86_64/librealm-jni.so'
    }
}
@Zhuinden

This comment has been minimized.

Show comment
Hide comment
@Zhuinden

Zhuinden May 8, 2018

Contributor

Do you have any other native libraries that are 32-bit only?

Contributor

Zhuinden commented May 8, 2018

Do you have any other native libraries that are 32-bit only?

@rhonyabdullah

This comment has been minimized.

Show comment
Hide comment
@rhonyabdullah

rhonyabdullah May 8, 2018

No, i don't have.

rhonyabdullah commented May 8, 2018

No, i don't have.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment