只是包含在我的代码中的第一行以加载不同的系统库:
public class MyWebTestActivity extends Activity {
static {
System.loadLibrary("ui");
System.loadLibrary("android");
System.loadLibrary("chromium_net"); // - fails UnsatisfiedLinkError: unknown failure
}
...etc..
堆栈跟踪:
04-17 14:04:23.121: W/dalvikvm(5041): Shared lib '/system/lib/libchromium_net.so' already opened by CL 0x0; can't open in 0x2bb4b9f0
04-17 14:04:23.121: W/dalvikvm(5041): Exception Ljava/lang/UnsatisfiedLinkError; thrown while initializing Lmywebtest/MyWebTestActivity;
04-17 14:04:23.121: W/dalvikvm(5041): Class init failed in newInstance call (Lmywebtest/MyWebTestActivity;)
04-17 14:04:23.121: D/AndroidRuntime(5041): Shutting down VM
04-17 14:04:23.121: W/dalvikvm(5041): threadid=1: thread exiting with uncaught exception (group=0x2b4d61f8)
04-17 14:04:23.121: E/AndroidRuntime(5041): FATAL EXCEPTION: main
04-17 14:04:23.121: E/AndroidRuntime(5041): java.lang.ExceptionInInitializerError
04-17 14:04:23.121: E/AndroidRuntime(5041): at java.lang.Class.newInstanceImpl(Native Method)
04-17 14:04:23.121: E/AndroidRuntime(5041): at java.lang.Class.newInstance(Class.java:1319)
04-17 14:04:23.121: E/AndroidRuntime(5041): at android.app.Instrumentation.newActivity(Instrumentation.java:1023)
04-17 14:04:23.121: E/AndroidRuntime(5041): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1871)
04-17 14:04:23.121: E/AndroidRuntime(5041): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
04-17 14:04:23.121: E/AndroidRuntime(5041): at android.app.ActivityThread.access$600(ActivityThread.java:123)
04-17 14:04:23.121: E/AndroidRuntime(5041): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
04-17 14:04:23.121: E/AndroidRuntime(5041): at android.os.Handler.dispatchMessage(Handler.java:99)
04-17 14:04:23.121: E/AndroidRuntime(5041): at android.os.Looper.loop(Looper.java:137)
04-17 14:04:23.121: E/AndroidRuntime(5041): at android.app.ActivityThread.main(ActivityThread.java:4424)
04-17 14:04:23.121: E/AndroidRuntime(5041): at java.lang.reflect.Method.invokeNative(Native Method)
04-17 14:04:23.121: E/AndroidRuntime(5041): at java.lang.reflect.Method.invoke(Method.java:511)
04-17 14:04:23.121: E/AndroidRuntime(5041): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:787)
04-17 14:04:23.121: E/AndroidRuntime(5041): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:554)
04-17 14:04:23.121: E/AndroidRuntime(5041): at dalvik.system.NativeStart.main(Native Method)
04-17 14:04:23.121: E/AndroidRuntime(5041): Caused by: java.lang.UnsatisfiedLinkError: unknown failure
04-17 14:04:23.121: E/AndroidRuntime(5041): at java.lang.Runtime.load(Runtime.java:340)
04-17 14:04:23.121: E/AndroidRuntime(5041): at java.lang.System.load(System.java:521)
04-17 14:04:23.121: E/AndroidRuntime(5041): at mytest.MyWebTestActivity.<clinit>(MyWebTestActivity.java:24)
问题:“共享库 [名称] 已由 CL.. 打开”是什么意思?如何解决?
PS 我尝试过加载其他系统库(例如 android -/system/lib/libandroid.so、..audioalsa、camera_client 等),所有这些库都可以毫无问题地加载。我使用 Android 4.0.3 运行有根的 Xperia 手机。所有图书馆都在电话上。