SandroMachado / openalpr-android

Android Automatic License Plate Recognition library (http://www.openalpr.com) ported for android.
Apache License 2.0
770 stars 272 forks source link

[x86 Architecture] The system is crashing after take picture #12

Open kykm1307 opened 8 years ago

kykm1307 commented 8 years ago

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)
SandroMachado commented 8 years ago

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

JerzyPuchalski commented 8 years ago

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.

kykm1307 commented 8 years ago

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

SandroMachado commented 8 years ago

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

kykm1307 commented 8 years ago

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

SandroMachado commented 8 years ago

Yup

kykm1307 commented 8 years ago

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

JerzyPuchalski commented 8 years ago

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

SandroMachado commented 8 years ago

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

kykm1307 commented 8 years ago

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?

SandroMachado commented 8 years ago

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?

vitaliibudnyi commented 8 years ago

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.

yoX64 commented 5 years ago

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:

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)

vitaliibudnyi commented 5 years ago

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.