gpt4 book ai didi

安卓市场崩溃报告

转载 作者:行者123 更新时间:2023-11-30 04:27:21 25 4
gpt4 key购买 nike

我有来自市场的 Android 崩溃报告,但我不知道该怎么做。我不明白错误是关于布局还是关于未被我的项目文件中的某个 Activity 捕获的异常。请帮忙:

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.fab.MyMotivApp/com.fab.MyMotivApp.Options}: android.view.InflateException: Binary XML file line #2: Error inflating class android.widget.RelativeLayout
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1647)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
at android.app.ActivityThread.access$1500(ActivityThread.java:117)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3683)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class android.widget.RelativeLayout
at android.view.LayoutInflater.createView(LayoutInflater.java:518)
at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:568)
at android.view.LayoutInflater.inflate(LayoutInflater.java:386)
at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:207)
at android.app.Activity.setContentView(Activity.java:1657)
at com.fab.MyMotivApp.Options.onCreate(Options.java:16)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
... 11 more
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.constructNative(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:415)
at android.view.LayoutInflater.createView(LayoutInflater.java:505)
... 21 more
Caused by: java.lang.OutOfMemoryError: bitmap size exceeds VM budget
at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:460)
at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:336)
at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:697)
at android.content.res.Resources.loadDrawable(Resources.java:1709)
at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
at android.view.View.<init>(View.java:1951)
at android.view.View.<init>(View.java:1899)
at android.view.ViewGroup.<init>(ViewGroup.java:286)
at android.widget.RelativeLayout.<init>(RelativeLayout.java:173)
... 24 more

最佳答案

您在扩充 XML 布局文件时遇到问题。然而,罪魁祸首是:

Caused by: java.lang.OutOfMemoryError: bitmap size exceeds VM budget

基本上,它是在告诉您图像太大,无法满足内存限制(请记住,这些是资源关键型设备)。

可能的解决方案之一是 this famous answer .

当然,您可以尝试调整图像大小。您可以应用一些技巧(优化等)。

关于安卓市场崩溃报告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8264582/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com