簡體   English   中英

生成簽名的APK時出現奇怪的錯誤

[英]Getting strange error while generating signed apk

基本上我正在嘗試生成帶符號的apk,但是它顯示錯誤,但是在構建普通apk時沒有錯誤。我也試圖在SO找到類似的問題,但是它們都沒有幫助。 我不明白為什么會這樣,從昨天開始一直很痛苦。 誰能幫我解決這個問題?

progard-rules.pro:

-dontwarn com.squareup.picasso.**
-keep class com.google.android.gms.** { *; }
-dontwarn com.google.android.gms.**
-keep class org.apache.http.**
-keep interface org.apache.http.**

build.gradle文件:

apply plugin: 'com.android.application'



android {
configurations.all {
    resolutionStrategy.force 'com.google.code.findbugs:jsr305:1.3.9'
}
compileSdkVersion 27
buildToolsVersion '27.0.3'
defaultConfig {
    vectorDrawables.useSupportLibrary = true
    applicationId "community.infinity"
    minSdkVersion 16
    targetSdkVersion 27
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner 
  "android.support.test.runner.AndroidJUnitRunner"
    multiDexEnabled true
}
aaptOptions {
    cruncherEnabled = false
}
dexOptions {
    preDexLibraries false
    javaMaxHeapSize "4g"
}
buildTypes {
    release {
        shrinkResources true
        minifyEnabled true
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 
     'proguard-rules.pro'
    }
    debug {
        ext.enableCrashlytics = false
    }
   }

   compileOptions {
    targetCompatibility 1.8
    sourceCompatibility 1.8
  }

  }

  dependencies {

implementation 'com.google.firebase:firebase-core:16.0.0'
implementation 'com.google.firebase:firebase-messaging:17.0.0'

  implementation fileTree(include: ['*.jar'], dir: 'libs')
  androidTestImplementation('com.android.support.test.espresso:espresso- 
   core:2.2.2', {
    exclude group: 'com.android.support'
    exclude module: 'support-annotations'
    exclude module: 'support-v4'
    exclude module: 'support-v13'
    exclude module: 'recyclerview-v7'
    exclude group: 'com.android.support', module: 'appcompat-v7'
})
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.android.support:support-v4:27.1.1'
implementation ('de.hdodenhof:circleimageview:2.1.0'){
    exclude group: 'com.google.android', module: 'android'
}
implementation ('com.adamstyrc.cookiecutter:cookie-cutter:1.0.2'){
    exclude group: 'com.google.android', module: 'android'
}
implementation ('com.allattentionhere:fabulousfilter:0.0.5'){
    exclude group: 'com.google.android', module: 'android'
}
implementation ('com.github.florent37:diagonallayout:1.0.6'){
    exclude group: 'com.google.android', module: 'android'
}
implementation ('com.flaviofaria:kenburnsview:1.0.7'){
    exclude group: 'com.google.android', module: 'android'
}
implementation 'com.google.code.gson:gson:2.8.0'
implementation ('com.github.pwittchen:swipe:0.1.0'){
    exclude group: 'com.google.android', module: 'android'
}
implementation ('com.github.oxoooo:touch-image-view:1.0.1'){
    exclude group: 'com.google.android', module: 'android'
}
implementation ('com.squareup.okhttp:okhttp-urlconnection:1.6.0'){
    exclude group: 'com.google.android', module: 'android'
}
implementation('io.socket:socket.io-client:0.8.3') {
    // excluding org.json which is provided by Android
    exclude group: 'org.json', module: 'json'
}
implementation 'com.google.gms:google-services:3.3.0'
implementation ('com.iceteck.silicompressorr:silicompressor:2.1'){
    exclude group: 'com.google.android', module: 'android'
}
implementation ('com.fenchtose.nocropper:nocropper:0.2.0'){
    exclude group: 'com.google.android', module: 'android'
}
implementation ('me.relex:circleindicator:1.2.2@aar'){
    exclude group: 'com.google.android', module: 'android'
}
implementation('com.google.guava:guava:23.4-android') {
    exclude group: 'com.android.support'
    exclude module: 'support-annotations'
    exclude module: 'support-v4'
    exclude module: 'support-v13'
    exclude module: 'recyclerview-v7'
    exclude group: 'com.android.support', module: 'appcompat-v7'
}
implementation ('com.orhanobut:hawk:2.0.1'){
    exclude group: 'com.google.android', module: 'android'
}
implementation ('com.zsoltsafrany:needle:1.0.0'){
    exclude group: 'com.google.android', module: 'android'
}
implementation ('com.github.madrapps:pikolo:1.1.6'){
    exclude group: 'com.google.android', module: 'android'
}
implementation ('jp.wasabeef:richeditor-android:1.2.2'){
    exclude group: 'com.google.android', module: 'android'
}
implementation ('com.android.support:palette-v7:27.1.1'){
    exclude group: 'com.google.android', module: 'android'
}
testImplementation 'junit:junit:4.12'
implementation('com.github.bumptech.glide:glide:4.4.0') {
    transitive = true
}
implementation ("com.github.bumptech.glide:recyclerview-integration:4.4.0") {
    // Excludes the support library because it's already included by Glide.
    transitive = false
}
annotationProcessor 'com.github.bumptech.glide:compiler:4.4.0'
implementation ('com.android.support:multidex:1.0.3'){
    exclude group: 'com.google.android', module: 'android'
}
implementation ('com.squareup.retrofit2:retrofit:2.3.0'){
    exclude group: 'com.google.android', module: 'android'
}
implementation ('com.squareup.retrofit2:converter-gson:2.3.0'){
    exclude group: 'com.google.android', module: 'android'
}
implementation ('com.koushikdutta.ion:ion:2.+'){
    exclude group: 'com.google.android', module: 'android'
}
implementation ('com.github.florent37:tutoshowcase:1.0.1'){
    exclude group: 'com.google.android', module:'android'
}
implementation ('com.novoda:merlin:1.1.7'){
    exclude group: 'com.google.android', module:'android'
}
implementation ('com.wang.avi:library:2.1.3'){
    exclude group:'com.google.android',module:'android'
}
implementation ('com.balsikandar.android:crashreporter:1.0.9'){
    exclude group:'com.google.android',module:'android'
}




}

 //It must be there here only
apply plugin: 'com.google.gms.google-services'

錯誤:

com.google.common.util.concurrent.FuturesGetChecked$GetCheckedTypeValidatorHolder$ClassValueValidator$1: can't find superclass or interface java.lang.ClassValue    
com.google.gms.googleservices.GoogleServicesPlugin: can't find superclass or interface org.gradle.api.Plugin    
com.google.gms.googleservices.GoogleServicesPlugin: can't find superclass or interface groovy.lang.GroovyObject 
com.google.gms.googleservices.GoogleServicesPlugin$GoogleServicesPluginConfig: can't find superclass or interface groovy.lang.GroovyObject  
com.google.gms.googleservices.GoogleServicesPlugin$PluginType: can't find superclass or interface groovy.lang.GroovyObject  
com.google.gms.googleservices.GoogleServicesPlugin$Version: can't find superclass or interface groovy.lang.GroovyObject 
com.google.gms.googleservices.GoogleServicesPlugin$VersionRange: can't find superclass or interface groovy.lang.GroovyObject    
com.google.gms.googleservices.GoogleServicesPlugin$_apply_closure1: can't find superclass or interface groovy.lang.Closure  
com.google.gms.googleservices.GoogleServicesPlugin$_apply_closure1: can't find superclass or interface org.codehaus.groovy.runtime.GeneratedClosure 
com.google.gms.googleservices.GoogleServicesPlugin$_apply_closure2: can't find superclass or interface groovy.lang.Closure  
com.google.gms.googleservices.GoogleServicesPlugin$_apply_closure2: can't find superclass or interface org.codehaus.groovy.runtime.GeneratedClosure 
com.google.gms.googleservices.GoogleServicesPlugin$_apply_closure3: can't find superclass or interface groovy.lang.Closure  
com.google.gms.googleservices.GoogleServicesPlugin$_apply_closure3: can't find superclass or interface org.codehaus.groovy.runtime.GeneratedClosure 
com.google.gms.googleservices.GoogleServicesPlugin$_apply_closure4: can't find superclass or interface groovy.lang.Closure  
com.google.gms.googleservices.GoogleServicesPlugin$_apply_closure4: can't find superclass or interface org.codehaus.groovy.runtime.GeneratedClosure 
com.google.gms.googleservices.GoogleServicesPlugin$_countSlashes_closure10: can't find superclass or interface groovy.lang.Closure  
com.google.gms.googleservices.GoogleServicesPlugin$_countSlashes_closure10: can't find superclass or interface org.codehaus.groovy.runtime.GeneratedClosure 
com.google.gms.googleservices.GoogleServicesPlugin$_failOnVersionConflictForGroup_closure12: can't find superclass or interface groovy.lang.Closure 
com.google.gms.googleservices.GoogleServicesPlugin$_failOnVersionConflictForGrou 
 p_closure12: can't find superclass or interface 
 org.codehaus.groovy.runtime.GeneratedClosure   

最后,我在proguard-rules.pro添加了一些dontwarns從而解決了我的問題。

碼:

-dontwarn com.google.gms.**

-dontwarn groovy.**

-dontwarn org.**

-dontwarn java.**
-dontwarn javax.**

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM