android gradle plugin 3.0.0-alpha2: Error inflating class android.support.v7.widget.FitWindowsLinearLayout

后端 未结 2 1079
甜味超标
甜味超标 2021-02-04 13:03

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:

相关标签:
2条回答
  • 2021-02-04 13:28

    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.** { *; }

    I hope it helps you:)

    0 讨论(0)
  • 2021-02-04 13:45

    UPDATE
    This bug has already been fixed - it works for me with gradle plugin 3.0.0-alpha4

    ORIGINAL answer (kept for reference)

    Actually I didn't have ProGuard enabled for my debug builds, but the Shrinker of the Android Gradle Plugin (which uses the same proguard files.

    Temporary workaround for the issue: add the following instructions to the proguard-rules.pro file:

    -keep class android.support.v7.widget.** { *; }
    -keep class android.support.v4.widget.** { *; }
    -keep class android.support.design.** { *; }
    -keep class com.bluelinelabs.conductor.** { *; }
    
    0 讨论(0)
提交回复
热议问题