微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

如何解决Android Studio中的致命异常错误

如何解决如何解决Android Studio中的致命异常错误

我创建了一个android APP并尝试在各种设备上运行测试,在对多个设备运行测试后,其中一些没有带来错误,但是在某些设备中,我遇到了以下致命错误

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.schools.mackhandy/com.schools.mackhandy.SplashActivity}: android.view.InflateException: Binary XML file line #10: Error inflating class ImageView
     FATAL EXCEPTION: main
Process: com.schools.mackhandy,PID: 18210
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.schools.mackhandy/com.schools.mackhandy.SplashActivity}: android.view.InflateException: Binary XML file line #10: Error inflating class ImageView
    at android.app.ActivityThread.performlaunchActivity(ActivityThread.java:2406)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2466)
    at android.app.ActivityThread.access$1200(ActivityThread.java:152)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1341)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:135)
    at android.app.ActivityThread.main(ActivityThread.java:5538)
    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:960)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
Caused by: android.view.InflateException: Binary XML file line #10: Error inflating class ImageView
    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:782)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:825)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:523)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:425)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:368)
    at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:555)
    at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:161)
    at com.schools.mackhandy.SplashActivity.onCreate(SplashActivity.java:19)
    at android.app.Activity.performCreate(Activity.java:6013)
    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1108)
    at android.app.ActivityThread.performlaunchActivity(ActivityThread.java:2359)
    ... 10 more
Caused by: android.content.res.Resources$NotFoundException: Resource "com.schools.mackhandy:drawable/splash_logo" (7f070085)  is not a Drawable (color or path): TypedValue{t=0x1/d=0x7f070085 a=-1 r=0x7f070085}
    at android.content.res.Resources.loadDrawableForCookie(Resources.java:2412)
    at android.content.res.Resources.loadDrawable(Resources.java:2350)
    at android.content.res.HwResources.loadDrawable(HwResources.java:589)
    at android.content.res.TypedArray.getDrawable(TypedArray.java:788)
    at android.widget.ImageView.<init>(ImageView.java:146)
    at android.widget.ImageView.<init>(ImageView.java:135)
    at androidx.appcompat.widget.AppCompatimageView.<init>(AppCompatimageView.java:72)
    at androidx.appcompat.widget.AppCompatimageView.<init>(AppCompatimageView.java:68)
    at androidx.appcompat.app.AppCompatViewInflater.createImageView(AppCompatViewInflater.java:187)
    at androidx.appcompat.app.AppCompatViewInflater.createView(AppCompatViewInflater.java:107)
    at androidx.appcompat.app.AppCompatDelegateImpl.createView(AppCompatDelegateImpl.java:1407)
    at androidx.appcompat.app.AppCompatDelegateImpl.onCreateView(AppCompatDelegateImpl.java:1457)
    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:744)
    ... 20 more

请帮助我如何解决此问题

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。