2017-04-26 113 views
0

不知道爲什麼我在生成已簽名的apk時出現此錯誤。 未簽名的apk工作正常。生成簽名apk的錯誤(未簽名的apk工作正常)

我的項目建設gradle這個文件

apply plugin: 'com.android.application' 

android { 
    compileSdkVersion 25 
    buildToolsVersion "25.0.2" 
    defaultConfig { 
     applicationId "in.fabits.fabits" 
     minSdkVersion 15 
     targetSdkVersion 25 
     versionCode 1 
     versionName "1.0" 
     testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 
    } 
    buildTypes { 
     release { 
      minifyEnabled true 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
} 
repositories { 

    maven { 
     url "https://jitpack.io" 
    } 
} 


dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 
     exclude group: 'com.android.support', module: 'support-annotations' 
    }) 
    compile 'com.android.support:appcompat-v7:25.2.0' 
    compile 'com.android.support:preference-v7:25.2.0' 
    compile 'com.android.support:design:25.2.0' 
    compile 'com.android.support:cardview-v7:25.2.0' 
    compile 'de.hdodenhof:circleimageview:2.1.0' 
    compile 'com.android.volley:volley:1.0.0' 
    compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5' 
    compile 'com.github.clans:fab:1.6.4' 
    compile 'com.pusher:pusher-java-client:1.4.0' 
    compile 'com.firebase:firebase-jobdispatcher-with-gcm-dep:0.6.0' 
    compile 'com.android.support:support-v4:25.2.0' 
    compile 'com.android.support:support-vector-drawable:25.2.0' 
    compile 'net.yslibrary.keyboardvisibilityevent:keyboardvisibilityevent:2.1.0' 
    compile 'com.daimajia.easing:library:[email protected]' 
    compile 'com.daimajia.androidanimations:library:[email protected]' 
    compile 'com.github.john990:WaveView:v0.9' 
    compile 'com.joanzapata.iconify:android-iconify-fontawesome:2.2.2' 

    testCompile 'junit:junit:4.12' 
} 

錯誤,那是我得到gradle這個構建

Warning:org.slf4j.LoggerFactory: can't find referenced class org.slf4j.impl.StaticLoggerBinder 
Warning:org.slf4j.MDC: can't find referenced class org.slf4j.impl.StaticMDCBinder 
Warning:org.slf4j.MarkerFactory: can't find referenced class org.slf4j.impl.StaticMarkerBinder 
Warning:there were 11 unresolved references to classes or interfaces. 
Warning:Exception while processing task java.io.IOException: Please correct the above warnings first. 
Error:Execution failed for task ':app:transformClassesAndResourcesWithProguardForRelease'. 
> Job failed, see logs for details 

沒有在proguard-rules.pro

回答

1

將這個行添加您的代碼proguard-rules.pro文件。

-dontwarn org.slf4j。**

-dontwarn javax.xml。**

-dontwarn org.apache。**

+0

你在proguard-rules.pro – codenut

+0

意思是你是對的proguard-rules.pro –

+0

你是怎麼決定把這些軟件包。 – codenut