0

我正在测试我的一个 android 应用程序,它在模拟器上运行良好,但是当我使用实际设备运行时,它一直停止并显示消息说打开重试(模拟器和实际设备都是 api 24 和 version7.0 实际设备是 s7)。这个应用程序基于 back4app 解析的后端。请尝试解决这个问题

这是我得到的错误日志

05-22 17:26:21.519 6097-7568/? E/ActivityManager: applyOptionsLocked: 
pendingOptions.getStartX()=23pendingOptions.getStartY()=1168
05-22 17:26:21.531 1883-1883/? E/Zygote: v2
05-22 17:26:21.532 1883-1883/? E/Zygote: accessInfo : 0
05-22 17:26:22.503 1883-1883/? E/AndroidRuntime: FATAL EXCEPTION: main
                                             Process: 
classify.domain.com.prinsprem, PID: 1883

java.lang.RuntimeException: Canvas: trying to draw too 
large(201326592bytes) bitmap.
at android.view.DisplayListCanvas.throwIfCannotDraw(DisplayListCanvas.java:260)
                                                 at 
 android.graphics.Canvas.drawBitmap(Canvas.java:1420)
                                                 at 
 android.graphics.drawable.BitmapDrawable.draw(BitmapDrawable.java:545)
 at android.widget.ImageView.onDraw(ImageView.java:1286)
                                                 at android.view.View.draw(View.java:18319)
                                                 at android.view.View.updateDisplayListIfDirty(View.java:17297)
                                                 at android.view.View.draw(View.java:18081)
                                                 at android.view.ViewGroup.drawChild(ViewGroup.java:3966)
                                                 at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3752)
                                                 at android.view.View.updateDisplayListIfDirty(View.java:17292)
                                                 at android.view.View.draw(View.java:18081)
                                                 at android.view.ViewGroup.drawChild(ViewGroup.java:3966)
                                                 at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3752)
                                                 at android.view.View.updateDisplayListIfDirty(View.java:17292)
                                                 at android.view.View.draw(View.java:18081)
                                                 at android.view.ViewGroup.drawChild(ViewGroup.java:3966)
                                                 at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3752)
                                                 at android.view.View.updateDisplayListIfDirty(View.java:17292)
                                                 at android.view.View.draw(View.java:18081)
                                                 at android.view.ViewGroup.drawChild(ViewGroup.java:3966)
                                                 at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3752)
                                                 at android.view.View.updateDisplayListIfDirty(View.java:17292)
                                                 at android.view.View.draw(View.java:18081)
                                                 at android.view.ViewGroup.drawChild(ViewGroup.java:3966)
                                                 at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3752)
                                                 at android.view.View.updateDisplayListIfDirty(View.java:17292)
                                                 at android.view.View.draw(View.java:18081)
                                                 at android.view.ViewGroup.drawChild(ViewGroup.java:3966)
                                                 at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3752)
                                                 at android.view.View.draw(View.java:18322)
                                                 at com.android.internal.policy.DecorView.draw(DecorView.java:854)
                                                 at android.view.View.updateDisplayListIfDirty(View.java:17297)
                                                 at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:666)
                                                 at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:672)
                                                 at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:780)
                                                 at android.view.ViewRootImpl.draw(ViewRootImpl.java:3112)
                                                 at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2908)
                                                 at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2502)
                                                 at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1509)
                                                 at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7051)
                                                 at android.view.Choreographer$CallbackRecord.run(Choreographer.java:927)
                                                 at android.view.Choreographer.doCallbacks(Choreographer.java:702)
                                                 at android.view.Choreographer.doFrame(Choreographer.java:638)
                                                 at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:913)
                                                 at android.os.Handler.handleCallback(Handler.java:751)
                                                 at android.os.Handler.dispatchMessage(Handler.java:95)
                                                 at android.os.Looper.loop(Looper.java:154)
                                                 at android.app.ActivityThread.main(ActivityThread.java:6692)
                                                 at java.lang.reflect.Method.invoke(Native Method)
                                                 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1468)
                                                 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1358)
4

1 回答 1

0

此错误清楚地表明您正在尝试渲染一个非常大的图像,您可以做的是通过任何图像编辑器应用程序重新缩放图像以减小其大小,并将其复制到您的可绘制文件夹中。它会解决你的问题。

于 2017-05-23T11:25:48.083 回答