RedLaser Sdk UnsatisfiedLinkError

时间:2012-04-03 14:14:41

标签: android exception unsatisfiedlinkerror

我正在使用Android Licensed RedLaser sdk。我尝试了很多东西,但我仍然得到UnsatisfiedLinkError。请帮帮我。

stacktrace如下:

04-03 14:06:58.280: E/AndroidRuntime(1005): Uncaught handler: thread main exiting due to     uncaught exception
04-03 14:06:58.299: E/AndroidRuntime(1005): java.lang.ExceptionInInitializerError
04-03 14:06:58.299: E/AndroidRuntime(1005):     at com.ebay.redlasersdk.BarcodeEngine.<init>(BarcodeEngine.java:50)
04-03 14:06:58.299: E/AndroidRuntime(1005):     at com.ebay.redlasersdk.scanner.CaptureActivityHandler.<init>(CaptureActivityHandler.java:48)
04-03 14:06:58.299: E/AndroidRuntime(1005):     at com.ebay.redlasersdk.scanner.BarcodeScanActivity.initCamera(BarcodeScanActivity.java:382)
04-03 14:06:58.299: E/AndroidRuntime(1005):     at com.ebay.redlasersdk.scanner.BarcodeScanActivity.surfaceCreated(BarcodeScanActivity.java:246)
04-03 14:06:58.299: E/AndroidRuntime(1005):     at android.view.SurfaceView.updateWindow(SurfaceView.java:454)
04-03 14:06:58.299: E/AndroidRuntime(1005):     at android.view.SurfaceView.dispatchDraw(SurfaceView.java:287)
04-03 14:06:58.299: E/AndroidRuntime(1005):     at android.view.ViewGroup.drawChild(ViewGroup.java:1529)
04-03 14:06:58.299: E/AndroidRuntime(1005):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258)
04-03 14:06:58.299: E/AndroidRuntime(1005):     at android.view.ViewGroup.drawChild(ViewGroup.java:1529)
04-03 14:06:58.299: E/AndroidRuntime(1005):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258)
04-03 14:06:58.299: E/AndroidRuntime(1005):     at android.view.View.draw(View.java:6538)
04-03 14:06:58.299: E/AndroidRuntime(1005):     at android.widget.FrameLayout.draw(FrameLayout.java:352)
04-03 14:06:58.299: E/AndroidRuntime(1005):     at android.view.ViewGroup.drawChild(ViewGroup.java:1531)
04-03 14:06:58.299: E/AndroidRuntime(1005):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258)
04-03 14:06:58.299: E/AndroidRuntime(1005):     at android.view.ViewGroup.drawChild(ViewGroup.java:1529)
04-03 14:06:58.299: E/AndroidRuntime(1005):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258)
04-03 14:06:58.299: E/AndroidRuntime(1005):     at android.view.View.draw(View.java:6538)
04-03 14:06:58.299: E/AndroidRuntime(1005):     at android.widget.FrameLayout.draw(FrameLayout.java:352)
04-03 14:06:58.299: E/AndroidRuntime(1005):     at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:1830)
04-03 14:06:58.299: E/AndroidRuntime(1005):     at android.view.ViewRoot.draw(ViewRoot.java:1349)
04-03 14:06:58.299: E/AndroidRuntime(1005):     at android.view.ViewRoot.performTraversals(ViewRoot.java:1114)
04-03 14:06:58.299: E/AndroidRuntime(1005):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1633)
04-03 14:06:58.299: E/AndroidRuntime(1005):     at android.os.Handler.dispatchMessage(Handler.java:99)
04-03 14:06:58.299: E/AndroidRuntime(1005):     at android.os.Looper.loop(Looper.java:123)
04-03 14:06:58.299: E/AndroidRuntime(1005):     at android.app.ActivityThread.main(ActivityThread.java:4363)
04-03 14:06:58.299: E/AndroidRuntime(1005):     at java.lang.reflect.Method.invokeNative(Native Method)
04-03 14:06:58.299: E/AndroidRuntime(1005):     at java.lang.reflect.Method.invoke(Method.java:521)
04-03 14:06:58.299: E/AndroidRuntime(1005):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
04-03 14:06:58.299: E/AndroidRuntime(1005):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
04-03 14:06:58.299: E/AndroidRuntime(1005):     at dalvik.system.NativeStart.main(Native Method)
04-03 14:06:58.299: E/AndroidRuntime(1005): Caused by: java.lang.UnsatisfiedLinkError: Library redlaser not found
04-03 14:06:58.299: E/AndroidRuntime(1005):     at java.lang.Runtime.loadLibrary(Runtime.java:489)
04-03 14:06:58.299: E/AndroidRuntime(1005):     at java.lang.System.loadLibrary(System.java:557)
04-03 14:06:58.299: E/AndroidRuntime(1005):     at com.ebay.redlasersdk.scanner.NewLaserScanner.<clinit>(NewLaserScanner.java:190)
04-03 14:06:58.299: E/AndroidRuntime(1005):     ... 30 more

1 个答案:

答案 0 :(得分:0)

您似乎需要在应用程序中添加NDK Library。您应该将此库(通常具有.so扩展名)放在项目根目录内的libs/armeabi文件夹中。

如果在此之后仍然出现此错误,您还应该在任何类中使用以下静态代码块以确保您的库已加载:

static {
    System.loadLibrary("your_library_name");
}