openalpr-android icon indicating copy to clipboard operation
openalpr-android copied to clipboard

[x86 Architecture] The system is crashing after take picture

Open kykm1307 opened this issue 10 years ago • 14 comments

Hi, the application is crashing everytime after I take picture and select it. Below is the log cat of it. It crash even with the sample apk downloaded. Any solution for it. Thanks.

01-27 13:14:11.493 18971-18971/org.openalpr.app E/dalvikvm: dlopen("/data/app-lib/org.openalpr.app-2/libopenalpr-native.so") failed: dlopen failed: "/data/app-lib/org.openalpr.app-2/libopenalpr-native.so" has unexpected e_machine: 40
01-27 13:14:11.493 18971-18971/org.openalpr.app W/dalvikvm: Exception Ljava/lang/UnsatisfiedLinkError; thrown while initializing Lorg/openalpr/AlprJNIWrapper;
01-27 13:14:11.493 18971-18971/org.openalpr.app D/AndroidRuntime: Shutting down VM
01-27 13:14:11.493 18971-18971/org.openalpr.app W/dalvikvm: threadid=1: thread exiting with uncaught exception (group=0x430f3140)
01-27 13:14:11.503 18971-18971/org.openalpr.app E/AndroidRuntime: FATAL EXCEPTION: main
                                                                  Process: org.openalpr.app, PID: 18971
                                                                  java.lang.UnsatisfiedLinkError: dlopen failed: "/data/app-lib/org.openalpr.app-2/libopenalpr-native.so" has unexpected e_machine: 40
                                                                      at java.lang.Runtime.loadLibrary(Runtime.java:364)
                                                                      at java.lang.System.loadLibrary(System.java:526)
                                                                      at org.openalpr.AlprJNIWrapper.<clinit>(AlprJNIWrapper.java:13)
                                                                      at org.openalpr.Alpr$Factory.create(Alpr.java:48)
                                                                      at org.openalpr.app.AlprFragment$AlprTask.onPreExecute(AlprFragment.java:60)
                                                                      at android.os.AsyncTask.executeOnExecutor(AsyncTask.java:587)
                                                                      at android.os.AsyncTask.execute(AsyncTask.java:535)
                                                                      at org.openalpr.app.AlprFragment.onCreate(AlprFragment.java:37)
                                                                      at android.app.Fragment.performCreate(Fragment.java:1678)
                                                                      at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:859)
                                                                      at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1062)
                                                                      at android.app.BackStackRecord.run(BackStackRecord.java:685)
                                                                      at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1447)
                                                                      at android.app.Activity.performStart(Activity.java:5420)
                                                                      at android.app.Activity.performRestart(Activity.java:5477)
                                                                      at android.app.Activity.performResume(Activity.java:5482)
                                                                      at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2945)
                                                                      at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2984)
                                                                      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1335)
                                                                      at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                      at android.os.Looper.loop(Looper.java:149)
                                                                      at android.app.ActivityThread.main(ActivityThread.java:5257)
                                                                      at java.lang.reflect.Method.invokeNative(Native Method)
                                                                      at java.lang.reflect.Method.invoke(Method.java:515)
                                                                      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
                                                                      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:609)
                                                                      at dalvik.system.NativeStart.main(Native Method)

kykm1307 avatar Jan 27 '16 05:01 kykm1307

@kykm1307 can you please specify the device you are using to try the application? I this can be related somehow with the #1.

SandroMachado avatar Jan 27 '16 22:01 SandroMachado

I suppose it's a problem between the architecture the lib was compiled for and your device's architecture. Knowing the device model might help.

JerzyPuchalski avatar Jan 28 '16 10:01 JerzyPuchalski

@JerzyPuchalski im using asus zenfone 5 and android 4.4.2 version. And i compile using android studio

kykm1307 avatar Jan 28 '16 12:01 kykm1307

@kykm1307 I think @JerzyPuchalski is right, Asus Zenfone 5 is x86 architecture, unfortunately the library is only compiled to ARM.

SandroMachado avatar Jan 29 '16 00:01 SandroMachado

@SandroMachado what u mean is it related with architecture of the processor?

kykm1307 avatar Jan 29 '16 00:01 kykm1307

Yup

SandroMachado avatar Jan 29 '16 00:01 SandroMachado

@SandroMachado ok. Then any way that i can fix this?

kykm1307 avatar Jan 29 '16 00:01 kykm1307

@kykm1307 would need to compile all libs from this folder on x86. Seems doable @SandroMachado?

JerzyPuchalski avatar Jan 29 '16 09:01 JerzyPuchalski

It is not easy to compile the openalpr. I will need to configure the whole environment to be able to generate the x86.

SandroMachado avatar Jan 29 '16 10:01 SandroMachado

I believe so. But even i use other mobile device. When the first time i run it and snap picture, it will crash too. Second time onward will work fine unless i rotate the screen in middle of recognizing. Btw, did u guys come across with anpr? It is same with this?

kykm1307 avatar Jan 29 '16 11:01 kykm1307

The rotate issue is not related with this one and I thought it was fixed by #7, looks like it is not. But this is just a demo app, that issue is not related with the library.

Can you past here the crash log of the first time you take a picture?

SandroMachado avatar Jan 29 '16 23:01 SandroMachado

Asus Zenfone 5 is x86 architecture, unfortunately the library is only compiled to ARM.

@JerzyPuchalski I thought that x86 devices can handle armeabi, armeabi-v7a and x86 ABIs. Perhaps there is another reason.

vitaliibudnyi avatar Jun 13 '16 08:06 vitaliibudnyi

I don't know if it's related to the architecture, but I can confirm that the app is crashing after the image is processed.

Additional info:

  • Android 5.0.1
  • Samsung S4

Error: 12-13 11:45:22.410 29107-29107/com.sandro.openalprsample E/WindowManager: android.view.WindowLeaked: Activity com.sandro.openalprsample.MainActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView{1d759a79 V.E..... R......D 0,0-1272,483} that was originally added here at android.view.ViewRootImpl.<init>(ViewRootImpl.java:465) at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:277) at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:69) at android.app.Dialog.show(Dialog.java:312) at android.app.ProgressDialog.show(ProgressDialog.java:137) at android.app.ProgressDialog.show(ProgressDialog.java:120) at com.sandro.openalprsample.MainActivity.onActivityResult(MainActivity.java:71) at android.app.Activity.dispatchActivityResult(Activity.java:6549) at android.app.ActivityThread.deliverResults(ActivityThread.java:4063) at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3389) at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3434) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2772) at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:4471) at android.app.ActivityThread.access$1000(ActivityThread.java:177) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1455) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:145) at android.app.ActivityThread.main(ActivityThread.java:5951) 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:1400) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1195)

yoX64 avatar Dec 13 '18 09:12 yoX64

Architecture for sure. I clearly remember how the same .apk worked out on one device (something like Sony Xperia with Qualcomm processor) and crashed during loading native libs on the other (Alcatel One Touch POP C5 with MTK). Despite both were ARMv7.

vitaliibudnyi avatar Dec 13 '18 22:12 vitaliibudnyi