android gradle插件3.0.0-alpha2:错误膨胀类android.support.v7.widget.FitWindowsLinearLayout [英] android gradle plugin 3.0.0-alpha2: Error inflating class android.support.v7.widget.FitWindowsLinearLayout

查看:394
本文介绍了android gradle插件3.0.0-alpha2:错误膨胀类android.support.v7.widget.FitWindowsLinearLayout的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

将android gradle插件从 3.0.0-alpha1 升级到 3.0.0-alpha 2 后,我的应用程序不再启动:堆栈跟踪的一部分:

after upgrading the android gradle plugin from 3.0.0-alpha1 to 3.0.0-alpha2 my application does not start anymore: part of the stacktrace:

05-27 09:14:57.692 3015-3015/com.tmtron.dscontrol2app.debug E/AndroidRuntime: FATAL EXCEPTION: main
  Process: com.tmtron.dscontrol2app.debug, PID: 3015
  java.lang.RuntimeException: Unable to start activity ComponentInfo{com.tmtron.dscontrol2app.debug/com.tmtron.dscontrol2.gui.MainActivity}: android.view.InflateException: Binary XML file line #17: Binary XML file line #17: Error inflating class android.support.v7.widget.FitWindowsLinearLayout
   Caused by: android.view.InflateException: Binary XML file line #17: Binary XML file line #17: Error inflating class android.support.v7.widget.FitWindowsLinearLayout
   Caused by: android.view.InflateException: Binary XML file line #17: Error inflating class android.support.v7.widget.FitWindowsLinearLayout
   Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v7.widget.FitWindowsLinearLayout" on path: DexPathList[[zip file "/data/app/com.tmtron.dscontrol2app.debug-ZE45jTeV6eTnNIeveAjAbw==/base.apk", zip file "/data/app/com.tmtron.dscontrol2app.debug-ZE45jTeV6eTnNIeveAjAbw==/split_lib_dependencies_apk.apk", zip file "/data/app/com.tmtron.dscontrol2app.debug-ZE45jTeV6eTnNIeveAjAbw==/split_lib_slice_0_apk.apk", zip file "/data/app/com.tmtron.dscontrol2app.debug-..."/data/app/com.tmtron.dscontrol2app.debug-ZE45jTeV6eTnNIeveAjAbw==/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/com.tmtron.dscontrol2app.debug-ZE45jTeV6eTnNIeveAjAbw==/lib/x86, /system/lib, /system/vendor/lib]]
      at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:93)
      at com.tmtron.dscontrol2.gui.MainActivity.onCreate(MainActivity.java:41)
      at android.app.Activity.performCreate(Activity.java:6954)
05-27 09:14:57.693 3015-3015/com.tmtron.dscontrol2app.debug E/AndroidRuntime:     
    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1213)

似乎不再找到类android.support.v7.widget.FitWindowsLinearLayout.

有什么想法吗?

顺便说一句:我已经尝试进行各种清理,使缓存失效,重新启动等操作,如本

BTW: I have already tried to do all kinds of cleanup, invalidate-caches, restart, etc. as mentioned in this SO.

推荐答案

我认为这是暂时的错误. 由于某些原因,Proguard会删除此类,因此会发生此异常. 目前,最简单的解决方案可能是在build.gradle文件中禁用Proguard.如果仍要保留它,则必须更改您的proguard设置.

I think this is a temporarily bug. Proparbly Proguard removes this class because of some reason, therefore this exception occurs. For now the easiest solution might be to disable Proguard in the build.gradle file. If you still want to keep it, you will have to change your proguard settings.

这就是我所做的事,对我有用:

This is what I did and what worked for me:

-dontwarn android.support.v7.**
-keep class android.support.v7.widget.** { *; }

由于我在约束和设计库方面也遇到了问题,因此我添加了以下内容:

As I also had issues with constraint and design libray I added this:

-dontwarn android.support.constraint.** -keep class android.support.constraint.** { *; } -dontwarn android.support.design.** -keep class android.support.design.** { *; }

-dontwarn android.support.constraint.** -keep class android.support.constraint.** { *; } -dontwarn android.support.design.** -keep class android.support.design.** { *; }

我希望它能对您有所帮助:)

I hope it helps you:)

这篇关于android gradle插件3.0.0-alpha2:错误膨胀类android.support.v7.widget.FitWindowsLinearLayout的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆