Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

华为荣耀6测试 image classification奔溃 #6

Closed
3050311118 opened this issue Aug 28, 2019 · 6 comments
Closed

华为荣耀6测试 image classification奔溃 #6

3050311118 opened this issue Aug 28, 2019 · 6 comments
Assignees

Comments

@3050311118
Copy link

手机是华为荣耀6
配置信息
型号H60-L02
RAM 3GB
android版本4.4.2 API19
打开APP正常,点击 image classification按钮时产生奔溃现象

logcat信息:
08-28 21:28:01.205 29289-29289/com.baidu.paddle.lite.demo I/dalvikvm: Could not find method android.widget.Button.getAutoSizeMaxTextSize, referenced from method android.support.v7.widget.AppCompatButton.getAutoSizeMaxTextSize
08-28 21:28:01.205 29289-29289/com.baidu.paddle.lite.demo W/dalvikvm: VFY: unable to resolve virtual method 14718: Landroid/widget/Button;.getAutoSizeMaxTextSize ()I
08-28 21:28:01.205 29289-29289/com.baidu.paddle.lite.demo I/dalvikvm: Could not find method android.widget.Button.getAutoSizeMinTextSize, referenced from method android.support.v7.widget.AppCompatButton.getAutoSizeMinTextSize
08-28 21:28:01.205 29289-29289/com.baidu.paddle.lite.demo W/dalvikvm: VFY: unable to resolve virtual method 14719: Landroid/widget/Button;.getAutoSizeMinTextSize ()I
08-28 21:28:01.210 29289-29289/com.baidu.paddle.lite.demo I/dalvikvm: Could not find method android.widget.Button.getAutoSizeStepGranularity, referenced from method android.support.v7.widget.AppCompatButton.getAutoSizeStepGranularity
08-28 21:28:01.210 29289-29289/com.baidu.paddle.lite.demo W/dalvikvm: VFY: unable to resolve virtual method 14720: Landroid/widget/Button;.getAutoSizeStepGranularity ()I
08-28 21:28:01.210 29289-29289/com.baidu.paddle.lite.demo I/dalvikvm: Could not find method android.widget.Button.getAutoSizeTextAvailableSizes, referenced from method android.support.v7.widget.AppCompatButton.getAutoSizeTextAvailableSizes
08-28 21:28:01.210 29289-29289/com.baidu.paddle.lite.demo W/dalvikvm: VFY: unable to resolve virtual method 14721: Landroid/widget/Button;.getAutoSizeTextAvailableSizes ()[I
08-28 21:28:01.210 29289-29289/com.baidu.paddle.lite.demo I/dalvikvm: Could not find method android.widget.Button.getAutoSizeTextType, referenced from method android.support.v7.widget.AppCompatButton.getAutoSizeTextType
08-28 21:28:01.210 29289-29289/com.baidu.paddle.lite.demo W/dalvikvm: VFY: unable to resolve virtual method 14722: Landroid/widget/Button;.getAutoSizeTextType ()I
08-28 21:28:01.210 29289-29289/com.baidu.paddle.lite.demo I/dalvikvm: Could not find method android.widget.Button.setAutoSizeTextTypeUniformWithConfiguration, referenced from method android.support.v7.widget.AppCompatButton.setAutoSizeTextTypeUniformWithConfiguration
08-28 21:28:01.210 29289-29289/com.baidu.paddle.lite.demo W/dalvikvm: VFY: unable to resolve virtual method 14728: Landroid/widget/Button;.setAutoSizeTextTypeUniformWithConfiguration (IIII)V
08-28 21:28:01.210 29289-29289/com.baidu.paddle.lite.demo I/dalvikvm: Could not find method android.widget.Button.setAutoSizeTextTypeUniformWithPresetSizes, referenced from method android.support.v7.widget.AppCompatButton.setAutoSizeTextTypeUniformWithPresetSizes
08-28 21:28:01.210 29289-29289/com.baidu.paddle.lite.demo W/dalvikvm: VFY: unable to resolve virtual method 14729: Landroid/widget/Button;.setAutoSizeTextTypeUniformWithPresetSizes ([II)V
08-28 21:28:01.210 29289-29289/com.baidu.paddle.lite.demo I/dalvikvm: Could not find method android.widget.Button.setAutoSizeTextTypeWithDefaults, referenced from method android.support.v7.widget.AppCompatButton.setAutoSizeTextTypeWithDefaults
08-28 21:28:01.210 29289-29289/com.baidu.paddle.lite.demo W/dalvikvm: VFY: unable to resolve virtual method 14730: Landroid/widget/Button;.setAutoSizeTextTypeWithDefaults (I)V
08-28 21:28:01.220 29289-29289/com.baidu.paddle.lite.demo I/dalvikvm: Could not find method android.graphics.Color.getModel, referenced from method android.support.v4.graphics.ColorUtils.compositeColors
08-28 21:28:01.220 29289-29289/com.baidu.paddle.lite.demo W/dalvikvm: VFY: unable to resolve virtual method 1026: Landroid/graphics/Color;.getModel ()Landroid/graphics/ColorSpace$Model;
08-28 21:28:01.255 29289-29289/com.baidu.paddle.lite.demo I/dalvikvm: Could not find method android.graphics.drawable.Drawable.applyTheme, referenced from method android.support.v4.graphics.drawable.DrawableCompat.applyTheme
08-28 21:28:01.255 29289-29289/com.baidu.paddle.lite.demo W/dalvikvm: VFY: unable to resolve virtual method 1199: Landroid/graphics/drawable/Drawable;.applyTheme (Landroid/content/res/Resources$Theme;)V
08-28 21:28:01.255 29289-29289/com.baidu.paddle.lite.demo I/dalvikvm: Could not find method android.graphics.drawable.Drawable.canApplyTheme, referenced from method android.support.v4.graphics.drawable.DrawableCompat.canApplyTheme
08-28 21:28:01.255 29289-29289/com.baidu.paddle.lite.demo W/dalvikvm: VFY: unable to resolve virtual method 1200: Landroid/graphics/drawable/Drawable;.canApplyTheme ()Z
08-28 21:28:01.255 29289-29289/com.baidu.paddle.lite.demo I/dalvikvm: Could not find method android.graphics.drawable.Drawable.getColorFilter, referenced from method android.support.v4.graphics.drawable.DrawableCompat.getColorFilter
08-28 21:28:01.255 29289-29289/com.baidu.paddle.lite.demo W/dalvikvm: VFY: unable to resolve virtual method 1211: Landroid/graphics/drawable/Drawable;.getColorFilter ()Landroid/graphics/ColorFilter;
08-28 21:28:01.255 29289-29289/com.baidu.paddle.lite.demo I/dalvikvm: Could not find method android.graphics.drawable.Drawable.inflate, referenced from method android.support.v4.graphics.drawable.DrawableCompat.inflate
08-28 21:28:01.255 29289-29289/com.baidu.paddle.lite.demo W/dalvikvm: VFY: unable to resolve virtual method 1228: Landroid/graphics/drawable/Drawable;.inflate (Landroid/content/res/Resources;Lorg/xmlpull/v1/XmlPullParser;Landroid/util/AttributeSet;Landroid/content/res/Resources$Theme;)V
08-28 21:28:01.255 29289-29289/com.baidu.paddle.lite.demo I/dalvikvm: Could not find method android.graphics.drawable.Drawable.setHotspot, referenced from method android.support.v4.graphics.drawable.DrawableCompat.setHotspot
08-28 21:28:01.255 29289-29289/com.baidu.paddle.lite.demo W/dalvikvm: VFY: unable to resolve virtual method 1249: Landroid/graphics/drawable/Drawable;.setHotspot (FF)V
08-28 21:28:01.255 29289-29289/com.baidu.paddle.lite.demo I/dalvikvm: Could not find method android.graphics.drawable.Drawable.setHotspotBounds, referenced from method android.support.v4.graphics.drawable.DrawableCompat.setHotspotBounds
08-28 21:28:01.255 29289-29289/com.baidu.paddle.lite.demo W/dalvikvm: VFY: unable to resolve virtual method 1250: Landroid/graphics/drawable/Drawable;.setHotspotBounds (IIII)V
08-28 21:28:01.255 29289-29289/com.baidu.paddle.lite.demo I/dalvikvm: Could not find method android.graphics.drawable.Drawable.setLayoutDirection, referenced from method android.support.v4.graphics.drawable.DrawableCompat.setLayoutDirection
08-28 21:28:01.255 29289-29289/com.baidu.paddle.lite.demo W/dalvikvm: VFY: unable to resolve virtual method 1251: Landroid/graphics/drawable/Drawable;.setLayoutDirection (I)Z
08-28 21:28:01.255 29289-29289/com.baidu.paddle.lite.demo I/dalvikvm: Could not find method android.graphics.drawable.Drawable.setTint, referenced from method android.support.v4.graphics.drawable.DrawableCompat.setTint
08-28 21:28:01.255 29289-29289/com.baidu.paddle.lite.demo W/dalvikvm: VFY: unable to resolve virtual method 1254: Landroid/graphics/drawable/Drawable;.setTint (I)V
08-28 21:28:01.255 29289-29289/com.baidu.paddle.lite.demo I/dalvikvm: Could not find method android.graphics.drawable.Drawable.setTintList, referenced from method android.support.v4.graphics.drawable.DrawableCompat.setTintList
08-28 21:28:01.255 29289-29289/com.baidu.paddle.lite.demo W/dalvikvm: VFY: unable to resolve virtual method 1255: Landroid/graphics/drawable/Drawable;.setTintList (Landroid/content/res/ColorStateList;)V
08-28 21:28:01.255 29289-29289/com.baidu.paddle.lite.demo I/dalvikvm: Could not find method android.graphics.drawable.Drawable.setTintMode, referenced from method android.support.v4.graphics.drawable.DrawableCompat.setTintMode
08-28 21:28:01.255 29289-29289/com.baidu.paddle.lite.demo W/dalvikvm: VFY: unable to resolve virtual method 1256: Landroid/graphics/drawable/Drawable;.setTintMode (Landroid/graphics/PorterDuff$Mode;)V
08-28 21:28:01.255 29289-29289/com.baidu.paddle.lite.demo I/dalvikvm: Could not find method android.widget.CompoundButton.getButtonDrawable, referenced from method android.support.v4.widget.CompoundButtonCompat.getButtonDrawable
08-28 21:28:01.255 29289-29289/com.baidu.paddle.lite.demo W/dalvikvm: VFY: unable to resolve virtual method 14755: Landroid/widget/CompoundButton;.getButtonDrawable ()Landroid/graphics/drawable/Drawable;
08-28 21:28:01.260 29289-29289/com.baidu.paddle.lite.demo I/dalvikvm: Could not find method android.widget.CompoundButton.getButtonTintList, referenced from method android.support.v4.widget.CompoundButtonCompat.getButtonTintList
08-28 21:28:01.260 29289-29289/com.baidu.paddle.lite.demo W/dalvikvm: VFY: unable to resolve virtual method 14756: Landroid/widget/CompoundButton;.getButtonTintList ()Landroid/content/res/ColorStateList;
08-28 21:28:01.260 29289-29289/com.baidu.paddle.lite.demo I/dalvikvm: Could not find method android.widget.CompoundButton.getButtonTintMode, referenced from method android.support.v4.widget.CompoundButtonCompat.getButtonTintMode
08-28 21:28:01.260 29289-29289/com.baidu.paddle.lite.demo W/dalvikvm: VFY: unable to resolve virtual method 14757: Landroid/widget/CompoundButton;.getButtonTintMode ()Landroid/graphics/PorterDuff$Mode;
08-28 21:28:01.260 29289-29289/com.baidu.paddle.lite.demo I/dalvikvm: Could not find method android.widget.CompoundButton.setButtonTintList, referenced from method android.support.v4.widget.CompoundButtonCompat.setButtonTintList
08-28 21:28:01.260 29289-29289/com.baidu.paddle.lite.demo W/dalvikvm: VFY: unable to resolve virtual method 14773: Landroid/widget/CompoundButton;.setButtonTintList (Landroid/content/res/ColorStateList;)V
08-28 21:28:01.260 29289-29289/com.baidu.paddle.lite.demo I/dalvikvm: Could not find method android.widget.CompoundButton.setButtonTintMode, referenced from method android.support.v4.widget.CompoundButtonCompat.setButtonTintMode
08-28 21:28:01.260 29289-29289/com.baidu.paddle.lite.demo W/dalvikvm: VFY: unable to resolve virtual method 14774: Landroid/widget/CompoundButton;.setButtonTintMode (Landroid/graphics/PorterDuff$Mode;)V
08-28 21:28:02.450 29289-29289/com.baidu.paddle.lite.demo E/dalvikvm: dlopen("/data/app-lib/com.baidu.paddle.lite.demo-1/libpaddle_lite_jni.so") failed: dlopen failed: could not load library "libhiai.so" needed by "libpaddle_lite_jni.so"; caused by cannot locate symbol "__register_atfork" referenced by "libhiai.so"...
08-28 21:28:02.450 29289-29289/com.baidu.paddle.lite.demo W/dalvikvm: Exception Ljava/lang/UnsatisfiedLinkError; thrown while initializing Lcom/baidu/paddle/lite/PaddlePredictor;
08-28 21:28:02.450 29289-29289/com.baidu.paddle.lite.demo W/dalvikvm: threadid=1: thread exiting with uncaught exception (group=0x4159bc50)

@hong19860320
Copy link
Collaborator

hong19860320 commented Aug 28, 2019

谢谢,从log上看是libhiai.so在该平台上加载不到__register_atfor这个符号,我们向华为反映下情况。

@hong19860320 hong19860320 self-assigned this Aug 28, 2019
@3050311118
Copy link
Author

今天重新更新代码,测试了下,还是出现错误
09-01 10:16:07.244 10374-10374/com.baidu.paddle.lite.demo W/dalvikvm: VFY: unable to resolve virtual method 1368: Landroid/graphics/drawable/Drawable;.setTintMode (Landroid/graphics/PorterDuff$Mode;)V
09-01 10:16:07.724 10374-10422/com.baidu.paddle.lite.demo E/dalvikvm: dlopen("/data/app-lib/com.baidu.paddle.lite.demo-1/libpaddle_lite_jni.so") failed: dlopen failed: could not load library "libhiai.so" needed by "libpaddle_lite_jni.so"; caused by cannot locate symbol "__register_atfork" referenced by "libhiai.so"...
09-01 10:16:07.724 10374-10422/com.baidu.paddle.lite.demo W/dalvikvm: Exception Ljava/lang/UnsatisfiedLinkError; thrown while initializing Lcom/baidu/paddle/lite/PaddlePredictor;
09-01 10:16:07.724 10374-10422/com.baidu.paddle.lite.demo W/dalvikvm: threadid=12: thread exiting with uncaught exception (group=0x415bdc50)
09-01 10:16:08.129 10374-10374/com.baidu.paddle.lite.demo E/WindowManager: android.view.WindowLeaked: Activity com.baidu.paddle.lite.demo.ImgClassifyActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView{4332c960 V.E..... R.....ID 0,0-1026,288} that was originally added here
at android.view.ViewRootImpl.(ViewRootImpl.java:375)
at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:258)
at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:69)
at android.app.Dialog.show(Dialog.java:289)
at android.app.ProgressDialog.show(ProgressDialog.java:116)
at android.app.ProgressDialog.show(ProgressDialog.java:104)
at com.baidu.paddle.lite.demo.ImgClassifyActivity.loadModel(ImgClassifyActivity.java:138)
at com.baidu.paddle.lite.demo.ImgClassifyActivity.onResume(ImgClassifyActivity.java:274)
at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1200)
at android.app.Activity.performResume(Activity.java:5430)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3007)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3063)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2349)
at android.app.ActivityThread.access$1100(ActivityThread.java:139)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1255)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5294)
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:864)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:680)
at dalvik.system.NativeStart.main(Native Method)

@hong19860320
Copy link
Collaborator

hong19860320 commented Sep 6, 2019

由于demo中的NPU功能依赖于华为kirin810&990芯片的手机,因此,HIAI的库有可能在你机器上不能正常工作。如果只想测试CPU功能,建议按照 https://github.com/PaddlePaddle/Paddle-Lite/wiki/source_compilehttps://github.com/PaddlePaddle/Paddle-Lite-Demo 步骤在tiny publish模式下编译armv7&v8的libpaddle_lite_jni.so和PaddlePredictor.jar,替换本demo中的libpaddle_lite_jni.so和PaddlePredictor.jar。

@3050311118
Copy link
Author

10-07 09:05:12.301 18760-18760/com.baidu.paddle.lite.demo W/dalvikvm: VFY: unable to resolve virtual method 1368: Landroid/graphics/drawable/Drawable;.setTintList (Landroid/content/res/ColorStateList;)V
10-07 09:05:12.301 18760-18760/com.baidu.paddle.lite.demo I/dalvikvm: Could not find method android.graphics.drawable.Drawable.setTintMode, referenced from method android.support.v4.graphics.drawable.DrawableCompat.setTintMode
10-07 09:05:12.301 18760-18760/com.baidu.paddle.lite.demo W/dalvikvm: VFY: unable to resolve virtual method 1369: Landroid/graphics/drawable/Drawable;.setTintMode (Landroid/graphics/PorterDuff$Mode;)V
10-07 09:05:12.726 18760-18849/com.baidu.paddle.lite.demo E/dalvikvm: dlopen("/data/app-lib/com.baidu.paddle.lite.demo-1/libpaddle_lite_jni.so") failed: dlopen failed: could not load library "libhiai.so" needed by "libpaddle_lite_jni.so"; caused by cannot locate symbol "__register_atfork" referenced by "libhiai.so"...
10-07 09:05:12.726 18760-18849/com.baidu.paddle.lite.demo W/dalvikvm: Exception Ljava/lang/UnsatisfiedLinkError; thrown while initializing Lcom/baidu/paddle/lite/PaddlePredictor;
10-07 09:05:12.726 18760-18849/com.baidu.paddle.lite.demo W/dalvikvm: threadid=12: thread exiting with uncaught exception (group=0x41c7fc50)
10-07 09:05:13.146 18760-18760/com.baidu.paddle.lite.demo E/WindowManager: android.view.WindowLeaked: Activity com.baidu.paddle.lite.demo.ImgClassifyActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView{4398c0a0 V.E..... R......D 0,0-1026,288} that was originally added here
at android.view.ViewRootImpl.(ViewRootImpl.java:375)
at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:258)
at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:69)
at android.app.Dialog.show(Dialog.java:289)
at android.app.ProgressDialog.show(ProgressDialog.java:116)
at android.app.ProgressDialog.show(ProgressDialog.java:104)
at com.baidu.paddle.lite.demo.CommonActivity.loadModel(CommonActivity.java:113)
at com.baidu.paddle.lite.demo.ImgClassifyActivity.onResume(ImgClassifyActivity.java:210)
at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1200)
at android.app.Activity.performResume(Activity.java:5430)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3007)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3063)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2349)
at android.app.ActivityThread.access$1100(ActivityThread.java:139)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1255)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5294)
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:864)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:680)
at dalvik.system.NativeStart.main(Native Method)

@3050311118
Copy link
Author

华为荣耀6今天测试,还是出现奔溃现象
10-07 09:05:12.726 18760-18849/com.baidu.paddle.lite.demo E/dalvikvm: dlopen("/data/app-lib/com.baidu.paddle.lite.demo-1/libpaddle_lite_jni.so") failed: dlopen failed: could not load library "libhiai.so" needed by "libpaddle_lite_jni.so"; caused by cannot locate symbol "__register_atfork" referenced by "libhiai.so"...

是不是因为不支持安卓4?

@hong19860320
Copy link
Collaborator

hong19860320 commented Oct 7, 2019

华为荣耀6今天测试,还是出现奔溃现象
10-07 09:05:12.726 18760-18849/com.baidu.paddle.lite.demo E/dalvikvm: dlopen("/data/app-lib/com.baidu.paddle.lite.demo-1/libpaddle_lite_jni.so") failed: dlopen failed: could not load library "libhiai.so" needed by "libpaddle_lite_jni.so"; caused by cannot locate symbol "__register_atfork" referenced by "libhiai.so"...

是不是因为不支持安卓4?

之前的回复已经解释了为什么会出现这个问题,也给出了解决方案。

由于demo中的libpaddle_lite_jni.so依赖于华为NPU libhiai.so库,而libhiai.so要求设备的安卓系统版本较高,才会出现crash现象,建议按照 https://github.com/PaddlePaddle/Paddle-Lite/wiki/source_compilehttps://github.com/PaddlePaddle/Paddle-Lite-Demo 步骤在tiny publish模式下编译armv7&v8的libpaddle_lite_jni.so和PaddlePredictor.jar,或直接使用release预编译好的armv7&v8的libpaddle_lite_jni.so和PaddlePredictor.jar https://github.com/PaddlePaddle/Paddle-Lite/releases ,替换本demo中的libpaddle_lite_jni.so和PaddlePredictor.jar。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants