开发者社区> 问答> 正文

我的Android应用支持7.0版和更高版本,但不支持版本6和5

其实我不知道是什么问题。我尝试过但不了解确切的问题!

compileSdkVersion 28,
minSdkVersion 21,
targetSdkVersion 28.

仅在android版本6和5中才出现此问题,但我的应用程序在android 7.0及更高版本中正常运行。

这是Logcat错误消息

12-03 09:23:44.932 6025-6025/? I/art: Not late-enabling -Xcheck:jni (already on) 12-03 09:23:45.029 6025-6025/io.destreza.erp_dashboard W/System: ClassLoader referenced unknown path: /data/app/io.destreza.erp_dashboard-1/lib/x86 12-03 09:23:45.075 6025-6025/io.destreza.erp_dashboard D/FirebaseApp: com.google.firebase.auth.FirebaseAuth is not linked. Skipping initialization. 12-03 09:23:45.076 6025-6025/io.destreza.erp_dashboard D/FirebaseApp: com.google.firebase.crash.FirebaseCrash is not linked. Skipping initialization. 12-03 09:23:45.076 6025-6025/io.destreza.erp_dashboard D/FirebaseApp: com.google.android.gms.measurement.AppMeasurement is not linked. Skipping initialization. 12-03 09:23:45.076 6025-6025/io.destreza.erp_dashboard I/FirebaseInitProvider: FirebaseApp initialization successful 12-03 09:23:45.116 6025-6025/io.destreza.erp_dashboard W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable 12-03 09:23:45.149 6025-6025/io.destreza.erp_dashboard I/art: Rejecting re-init on previously-failed class java.lang.Class<android.support.v4.view.ViewCompat$OnUnhandledKeyEventListenerWrapper> 12-03 09:23:45.149 6025-6025/io.destreza.erp_dashboard I/art: Rejecting re-init on previously-failed class java.lang.Class<android.support.v4.view.ViewCompat$OnUnhandledKeyEventListenerWrapper> 12-03 09:23:45.194 6025-6025/io.destreza.erp_dashboard W/ResourceType: Failure getting entry for 0x7f07009e (t=6 e=158) (error -75) 12-03 09:23:45.195 6025-6025/io.destreza.erp_dashboard D/AndroidRuntime: Shutting down VM 12-03 09:23:45.196 6025-6025/io.destreza.erp_dashboard E/AndroidRuntime: FATAL EXCEPTION: main
    Process: io.destreza.erp_dashboard, PID: 6025
    java.lang.RuntimeException: Unable to start activity ComponentInfo{io.destreza.erp_dashboard/io.destreza.erp_dashboard.activities.main.MainActivity}: android.view.InflateException: Binary XML file line #53: Binary XML file line #53: Error inflating class ImageView
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
        at android.app.ActivityThread.-wrap11(ActivityThread.java)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
        at android.os.Handler.dispatchMessage(Handler.java:102)
        at android.os.Looper.loop(Looper.java:148)
        at android.app.ActivityThread.main(ActivityThread.java:5417)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
     Caused by: android.view.InflateException: Binary XML file line #53: Binary XML file line #53: Error inflating class ImageView
        at android.view.LayoutInflater.inflate(LayoutInflater.java:539)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
        at android.support.v7.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:469)
        at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)
        at io.destreza.erp_dashboard.activities.main.MainActivity.onCreate(MainActivity.java:115)
        at android.app.Activity.performCreate(Activity.java:6237)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476) 
        at android.app.ActivityThread.-wrap11(ActivityThread.java) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344) 
        at android.os.Handler.dispatchMessage(Handler.java:102) 
        at android.os.Looper.loop(Looper.java:148) 
        at android.app.ActivityThread.main(ActivityThread.java:5417) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 
     Caused by: android.view.InflateException: Binary XML file line #53: Error inflating class ImageView
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:782)
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:835)
        at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:838)
        at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:838)
        at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:423) 
        at android.view.LayoutInflater.inflate(LayoutInflater.java:374) 
        at android.support.v7.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:469) 
        at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140) 
        at io.destreza.erp_dashboard.activities.main.MainActivity.onCreate(MainActivity.java:115) 
        at android.app.Activity.performCreate(Activity.java:6237) 
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107) 
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369) 
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476) 
        at android.app.ActivityThread.-wrap11(ActivityThread.java) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344) 
        at android.os.Handler.dispatchMessage(Handler.java:102) 
        at android.os.Looper.loop(Looper.java:148) 
        at android.app.ActivityThread.main(ActivityThread.java:5417) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 
     Caused by: android.content.res.Resources$NotFoundException: Resource "io.destreza.erp_dashboard:drawable/logo_main" (7f07009e) is not a Drawable (color or path): TypedValue{t=0x1/d=0x7f07009e a=-1 r=0x7f07009e}
        at android.content.res.Resources.loadDrawableForCookie(Resources.java:2602)
        at android.content.res.Resources.loadDrawable(Resources.java:2540)
        at android.content.res.TypedArray.getDrawable(TypedArray.java:870)
        at android.view.View.<init>(View.java:3948)
        at android.widget.ImageView.<init>(ImageView.java:145)
        at android.widget.ImageView.<init>(ImageView.java:140)
        at android.support.v7.widget.AppCompatImageView.<init>(AppCompatImageView.java:72)
        at android.support.v7.widget.AppCompatImageView.<init>(AppCompatImageView.java:68)
        at android.support.v7.app.AppCompatViewInflater.createImageView(AppCompatViewInflater.java:182)
        at android.support.v7.app.AppCompatViewInflater.createView(AppCompatViewInflater.java:106)
        at android.support.v7.app.AppCompatDelegateImpl.createView(AppCompatDelegateImpl.java:1266)
        at android.support.v7.app.AppCompatDelegateImpl.onCreateView(AppCompatDelegateImpl.java:1316)
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:746)
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704) 
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:835) 
        at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798) 
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:838) 
        at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798) 
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:838) 
        at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798) 
        at android.view.LayoutInflater.inflate(LayoutInflater.java:515) 
        at android.view.LayoutInflater.inflate(LayoutInflater.java:423) 
        at android.view.LayoutInflater.inflate(LayoutInflater.java:374) 
        at android.support.v7.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:469) 
        at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140) 
        at io.destreza.erp_dashboard.activities.main.MainActivity.onCreate(MainActivity.java:115) 
        at android.app.Activity.performCreate(Activity.java:6237) 
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107) 
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369) 
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476) 
        at android.app.ActivityThread.-wrap11(ActivityThread.java) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344) 
        at android.os.Handler.dispatchMessage(Handler.java:102) 
        at android.os.Looper.loop(Looper.java:148) 
        at android.app.ActivityThread.main(ActivityThread.java:5417) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)  12-03 09:24:15.098 6025-6044/io.destreza.erp_dashboard E/FirebaseInstanceId: Token retrieval failed: SERVICE_NOT_AVAILABLE 12-03 09:25:15.188 6025-6044/io.destreza.erp_dashboard E/FirebaseInstanceId: Token retrieval failed: SERVICE_NOT_AVAILABLE 12-03 09:26:45.255 6025-6044/io.destreza.erp_dashboard E/FirebaseInstanceId: Token retrieval failed: SERVICE_NOT_AVAILABLE 12-03 09:28:45.594 6025-6025/io.destreza.erp_dashboard I/Process: Sending signal. PID: 6025 SIG: 9 [app has been stoped!][1]

展开
收起
Puppet 2019-12-04 18:33:01 1732 0
1 条回答
写回答
取消 提交回答
  • 这个是解析xml布局文件出错了,查看布局文件里面 ImageView 是否使用了高api的属性定义。

    2019-12-13 14:41:16
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
58同城Android客户端Walle框架演进与实践之路 立即下载
Android组件化实现 立即下载
蚂蚁聚宝Android秒级编译——Freeline 立即下载