我的Android项目工作正常,但当我启用此选项时 minifyEnabled true
,我收到以下错误:
com.android.build.gradle.shrinker.parser.ProguardParserException: ProGuard configuration parser error:
/Users/mss/.gradle/caches/transforms-1/files-1.1/play-services-base-11.8.0.aar/a9e603bf098b2c6866a5bdd73147cdc0/proguard.txt line 3:88 no viable alternative at input '<fields>'
这是我每次尝试使用 minifyEnabled true
运行我的应用程序时收到的错误。有没有解决这个问题的方法。
我在项目中使用的依赖项是:
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support:design:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:support-v4:26.1.0'
implementation 'com.android.support:recyclerview-v7:26.1.0'
implementation 'com.android.support:cardview-v7:26.1.0'
implementation 'com.google.android.gms:play-services-auth:11.8.0'
// Circle Image View
implementation 'de.hdodenhof:circleimageview:2.2.0'
// Firebase Dependencies
implementation 'com.google.firebase:firebase-auth:11.8.0'
implementation 'com.google.firebase:firebase-messaging:11.8.0'
implementation 'com.google.firebase:firebase-crash:11.8.0'
// Firebase UI Dependencies
implementation 'com.firebaseui:firebase-ui-auth:3.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
}
此外, app level build.gradle 文件的配置如下:
buildTypes {
release {
debuggable false
// minifyEnabled true
// shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
debuggable true
// minifyEnabled true
// shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
我评论了两行 minifyEnabled true 和 shrinkResources true ,因为这两行正在产生问题。