Ошибка пакета приложения Proguard
Я пытаюсь загрузить приложение в консоль Google Play, но оно говорит Your Android App Bundle contains an invalid Proguard deobfuscation file.
мой файл Proguard
-keepclassmembers class * extends org.greenrobot.greendao.AbstractDao {
public static java.lang.String TABLENAME;
}
-keep class **$Properties
-dontwarn org.greenrobot.greendao.database.**
-dontwarn rx.**
-keepattributes *Annotation*
-keepattributes SourceFile,LineNumberTable
-keep public class * extends java.lang.Exception
-dontwarn org.codehaus.**
-dontwarn com.google.errorprone.annotations.**
-keep class android.support.v7.widget.SearchView { *; }
#Glide
-keep public class * extends com.bumptech.glide.module.AppGlideModule
-keep class com.bumptech.glide.GeneratedAppGlideModuleImpl
Уровень приложения build.gradle:
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'org.greenrobot.greendao'
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'com.google.firebase.firebase-perf'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
def gitSha = 'git rev-parse --short HEAD'.execute().text.trim()
project.logger.debug('git sha: ' + gitSha)
def applicationName = "App name"
android {
signingConfigs {
release {
...
}
}
compileSdkVersion 27
buildToolsVersion '28.0.0'
buildTypes {
release {
applicationIdSuffix ".release"
signingConfig signingConfigs.release
shrinkResources true
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
renameAPK(applicationName,'RELEASE')
}
debug {
applicationIdSuffix ".debug"
multiDexEnabled true
renameAPK(applicationName,'DEBUG')
}
}
defaultConfig {
applicationId "com.app.id"
minSdkVersion 16
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
}
def renameAPK(applicationName,buildType) {
def formattedDate = new Date().format('dd-MM-yy')
project.ext.set("archivesBaseName", "${applicationName}-${buildType}-${formattedDate}".toString())
}
greendao {
schemaVersion 2
}
dependencies {
implementation "com.android.support:appcompat-v7:$rootProject.supportLibraryVersion"
implementation "com.android.support:recyclerview-v7:$rootProject.supportLibraryVersion"
implementation "com.android.support:cardview-v7:$rootProject.supportLibraryVersion"
implementation "com.android.support:design:$rootProject.supportLibraryVersion"
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation "com.squareup.retrofit2:retrofit:$rootProject.retrofitVersion"
implementation "com.squareup.retrofit2:converter-gson:$rootProject.retrofitVersion"
implementation 'com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.9.1'
implementation "com.google.android.gms:play-services-location:15.0.1"
implementation "com.google.firebase:firebase-core:16.0.1"
implementation "com.google.firebase:firebase-messaging:17.1.0"
implementation "com.google.firebase:firebase-perf:16.0.0"
implementation 'com.firebase:firebase-jobdispatcher:0.8.5'
implementation 'io.reactivex.rxjava2:rxjava:2.1.9'
implementation 'io.reactivex.rxjava2:rxandroid:2.0.2'
annotationProcessor "com.jakewharton:butterknife-compiler:$rootProject.butterKnifeVersion"
implementation "com.jakewharton:butterknife:$rootProject.butterKnifeVersion"
implementation "com.google.dagger:dagger:$rootProject.dagger2Version"
annotationProcessor "com.google.dagger:dagger-compiler:$rootProject.dagger2Version"
annotationProcessor "com.google.dagger:dagger-android-processor:$rootProject.dagger2Version"
implementation "com.google.dagger:dagger-android-support:$rootProject.dagger2Version"
compileOnly 'com.google.code.findbugs:jsr305:3.0.2'
implementation 'org.greenrobot:greendao:3.2.2'
implementation('com.crashlytics.sdk.android:crashlytics:2.9.4@aar') {
transitive = true
}
implementation 'javax.annotation:javax.annotation-api:1.3.2'
annotationProcessor "com.github.bumptech.glide:compiler:$rootProject.glideVersion"
implementation "com.github.bumptech.glide:glide:$rootProject.glideVersion"
implementation 'com.joanzapata.iconify:android-iconify-fontawesome:2.2.2'
implementation 'uk.co.chrisjenx:calligraphy:2.2.0'
implementation 'com.jakewharton.timber:timber:4.6.0'
implementation 'us.belka:androidtoggleswitch:1.2.2'
implementation 'net.cachapa.expandablelayout:expandablelayout:2.9.2'
implementation 'com.github.jkwiecien:EasyImage:1.3.1'
implementation 'id.zelory:compressor:2.1.0'
testImplementation 'junit:junit:4.12'
testImplementation "org.mockito:mockito-core:$rootProject.mockitoVersion"
androidTestAnnotationProcessor "com.google.dagger:dagger-compiler:$rootProject.dagger2Version"
testAnnotationProcessor "com.google.dagger:dagger-compiler:$rootProject.dagger2Version"
androidTestAnnotationProcessor "com.google.dagger:dagger-android-processor:$rootProject.dagger2Version"
androidTestImplementation "org.mockito:mockito-core:$rootProject.mockitoVersion"
androidTestImplementation("com.android.support.test.espresso:espresso-core:$rootProject.espressoVersion", {
exclude group: "com.android.support", module: "support-annotations"
})
androidTestImplementation "com.android.support.test.espresso:espresso-intents:$rootProject.espressoVersion"
debugImplementation "com.amitshekhar.android:debug-db:$rootProject.debugDBVersion"
devImplementation "com.amitshekhar.android:debug-db:$rootProject.debugDBVersion"
debugImplementation "com.squareup.leakcanary:leakcanary-android:$rootProject.leakCanaryVersion"
debugImplementation "com.android.support:multidex:$rootProject.multidexVersion"
devImplementation "com.android.support:multidex:$rootProject.multidexVersion"
devImplementation "com.squareup.leakcanary:leakcanary-android:$rootProject.leakCanaryVersion"
releaseImplementation "com.squareup.leakcanary:leakcanary-android-no-op:$rootProject.leakCanaryVersion"
}
apply plugin: 'com.google.gms.google-services'
configurations.all {
resolutionStrategy.force "com.android.support:support-annotations:$rootProject.supportLibraryVersion"
}
и верхний уровень build.gradle
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.0-alpha02'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.google.gms:google-services:3.2.0'
classpath 'org.greenrobot:greendao-gradle-plugin:3.2.2'
classpath 'com.google.firebase:firebase-plugins:1.1.5'
}
}
allprojects {
repositories {
jcenter()
maven { url "https://jitpack.io" }
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
// Define versions in a single place
ext {
// App dependencies
supportLibraryVersion = '27.1.1'
glideVersion = '4.7.1'
retrofitVersion = '2.3.0'
dagger2Version = '2.16'
butterKnifeVersion = '8.8.1'
debugDBVersion = '1.0.1'
playServicesVersion = '12.0.1'
leakCanaryVersion = '1.5.4'
multidexVersion = '1.0.3'
//Test dependencies
junitVersion = '4.12'
espressoVersion = '2.3-alpha'
mockitoVersion = '2.7.1'
}
Спасибо.
1 ответ
Ваш комплект приложений Android содержит недопустимый файл деобфускации Proguard.
Читать Decode an obfuscated stack trace
,
ProGuard создает mapping.txt
файл при каждом запуске, который показывает исходные имена классов, методов и полей, сопоставленные с обфусцированными именами. ProGuard сохраняет файл в приложении <module-name>/build/outputs/mapping/release/ directory
,
Помните, что mapping.txt
файл перезаписывается каждый раз, когда вы создаете сборку релиза с помощью ProGuard, поэтому вы должны тщательно сохранять копию при каждой публикации нового релиза. Сохраняя копию mapping.txt
файл для каждой сборки выпуска, вы сможете отладить проблему, если пользователь отправляет запутанную трассировку стека из старой версии вашего приложения.
Читать Upload a ProGuard mapping file
,