2017-06-14 68 views
4

運行時異常正在執行命令 buck install --run demo_app_android以下this教程和this樣品演示Buck - java.lang.UnsatisfiedLinkError:找不到「libjni.so」。如何解決它?

然後後發生,下面是在控制檯中顯示

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) 

最後,設備顯示消息,指出Buck Demo App has stopped 該應用程序已成功安裝,因爲我可以在應用程序列表中看到它,但它不起作用

堆棧跟蹤:

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) 

設備規格:

  • 機Android仿真器(也,運行它與相同的結果的真實設備)
  • Nexus 5的API 24

我的電腦:

  • MacBook親2012年中

注:而且,這個問題直接報告給buck repository但液體不給尚未

有關如何解決它的任何想法?

回答

1

重複從GitHub答案:

你需要從here(版本10E)安裝Android NDK,並設置ANDROID_NDK_REPOSITORY解壓縮的NDK的位置(詳情參見buckconfig部分)。

例如,如果你解壓NDK到~/tmp/ndk(以便有一個目錄~/tmp/ndk/android-ndk-r10e),你需要設置ANDROID_NDK_REPOSITORY~/tmp/ndk

之後刪除舊的緩存並重建應用程序:

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

最好的,謝謝! – Antonio

相關問題