简体   繁体   English

Buck-java.lang.UnsatisfiedLinkError:找不到“ libjni.so”。 怎么解决呢?

[英]Buck - java.lang.UnsatisfiedLinkError: couldn't find “libjni.so”. How to solve it?

A runtime exception is happening after executing the command buck install --run demo_app_android following this tutorial and this sample demo 在执行教程和示例演示之后,执行命令buck install --run demo_app_android后发生运行时异常

Then, the following is shown in console 然后,控制台中显示以下内容

Installing apk on emulator-5554 (null).
[-] PROCESSING BUCK FILES...FINISHED 0.0s [100%] 🐌  File removed
[-] DOWNLOADING... (0.00 B/S AVG, TOTAL: 0.00 B, 0 Artifacts)
[-] BUILDING...FINISHED 0.8s [100%] (1/1 JOBS, 1 UPDATED, 0 [0.0%] CACHE MISS)
[+] INSTALLING...2.1s
Successfully ran install apk //android:demo-app on 1 device(s)
Starting activity com.facebook.buck.demo/.App...
Successfully ran start activity on 1 device(s)

Finally, the device shows a message saying Buck Demo App has stopped The app was successfully installed as I can see it on the apps list but it's not working 最终, 设备显示一条消息,提示Buck Demo App has stopped该应用已成功安装,因为我可以在应用列表中看到它,但无法正常工作

Stacktrace: 堆栈跟踪:

E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.facebook.buck.demo, PID: 7265
    java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.facebook.buck.demo-1/base.apk"],nativeLibraryDirectories=[/data/app/com.facebook.buck.demo-1/lib/x86, /system/lib, /vendor/lib]]] couldn't find "libjni.so"
    at java.lang.Runtime.loadLibrary0(Runtime.java:972)
    at java.lang.System.loadLibrary(System.java:1530)
    at com.facebook.buck.demo.Hello.<init>(Hello.java:13)
    at com.facebook.buck.demo.App.onCreate(App.java:24)
    at android.app.Activity.performCreate(Activity.java:6662)
    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2599)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2707)
    at android.app.ActivityThread.-wrap12(ActivityThread.java)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1460)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:154)
    at android.app.ActivityThread.main(ActivityThread.java:6077)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756)

Device specs: 设备规格:

  • Native Android Emulator (also, ran it into a real device with same result) 本机Android模拟器(也将其运行到具有相同结果的真实设备中)
  • Nexus 5 API 24 Nexus 5 API 24

My computer: 我的电脑:

  • MacBook pro mid 2012 MacBook Pro 2012年中

Note: Also, this issue was reported directly to the buck repository but no solution was given yet 注意:此外,此问题已直接报告到buck存储库,但尚未提供解决方案

Any idea about how to solve it? 关于如何解决的任何想法?

Repeating the answer from github: 重复来自github的答案:

You need to install Android NDK from here (version 10e) and set ANDROID_NDK_REPOSITORY to the location of the unpacked NDK (see buckconfig section for more info). 您需要从此处 (版本10e)安装Android NDK,并将ANDROID_NDK_REPOSITORY设置为未打包的 NDK的位置(有关更多信息,请参见buckconfig部分)。

For example, if you unpack NDK to ~/tmp/ndk (so that there is a directory ~/tmp/ndk/android-ndk-r10e ), you need to set ANDROID_NDK_REPOSITORY to ~/tmp/ndk . 例如,如果将NDK解压缩到~/tmp/ndk (因此存在目录~/tmp/ndk/android-ndk-r10e ),则需要将ANDROID_NDK_REPOSITORY设置为~/tmp/ndk

After that delete old cache and rebuild the app: 之后,删除旧的缓存并重建应用程序:

$ buck kill && rm -rf buck-out
$ buck build demo_app_android

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 java.lang.UnsatisfiedLinkError…找不到“ libaacdecoder.so” - java.lang.UnsatisfiedLinkError…couldn't find “libaacdecoder.so” Android单元测试本地本机库:java.lang.UnsatisfiedLinkError:找不到这样的文件 - Android Unit Test local native library: java.lang.UnsatisfiedLinkError: couldn't find so file Android:java.lang.UnsatisfiedLinkError…找不到“ lib…” - Android : java.lang.UnsatisfiedLinkError…couldn't find “lib…” JNI 检测到应用程序错误 java.lang.UnsatisfiedLinkError 在 android.tools.build:Z8ED1A771BC236C287AD93C699BFDD3 中找不到“xxxxx.so”。 - JNI DETECTED ERROR IN APPLICATION java.lang.UnsatisfiedLinkError couldn't find "xxxxx.so" in android.tools.build:gradle 3.6.0 没有System32如何解决“java.lang.UnsatisfiedLinkError:找不到依赖库”? - How to solve “java.lang.UnsatisfiedLinkError: Can't find dependent libraries” without System32? java.lang.UnsatisfiedLinkError:无法加载瘦身 - java.lang.UnsatisfiedLinkError: Couldn't load lept java.lang.UnsatisfiedLinkError: libXrender.so.1 - java.lang.UnsatisfiedLinkError: libXrender.so.1 如何解决? 线程“主”中的异常java.lang.UnsatisfiedLinkError:找不到依赖的库 - How to resolve?. Exception in thread “main” java.lang.UnsatisfiedLinkError: Can't find dependent libraries java.lang.UnsatisfiedLinkError:无法加载andenginephysicsbox2dextension- Android - java.lang.UnsatisfiedLinkError: Couldn't load andenginephysicsbox2dextension- Android java.lang.UnsatisfiedLinkError:无法从加载器中加载findLibrary返回null - java.lang.UnsatisfiedLinkError: Couldn't load from loader findLibrary returned null
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM