2017-01-31 21 views
0

アンドロイドスタジオを使用してアプリケーションを作成する必要があり署名付きApkを生成する必要がありますが、署名付きApkを生成すると警告が表示され、ビルドできませんでした。署名付きAPKを生成できません

Information:Gradle tasks [:app:assembleRelease] 
Information:0 errors 
Information:0 warnings 
Information:See complete output in console 
Warning:com.kosalgeek.android.photoutil.MainActivity: can't find  referenced class com.kosalgeek.android.photoutil.R$layout 
Warning:com.kosalgeek.android.photoutil.MainActivity: can't find referenced class com.kosalgeek.android.photoutil.R$id 
Warning:com.kosalgeek.android.photoutil.MainActivity: can't find referenced class com.kosalgeek.android.photoutil.R$menu 
Warning:com.kosalgeek.android.photoutil.MainActivity: can't find referenced class com.kosalgeek.android.photoutil.R$id 
Warning:com.kosalgeek.android.photoutil.MainActivity: can't find referenced class com.kosalgeek.android.photoutil.R$layout 
Warning:com.kosalgeek.android.photoutil.MainActivity: can't find referenced class com.kosalgeek.android.photoutil.R$id 
Warning:com.kosalgeek.android.photoutil.MainActivity: can't find referenced class com.kosalgeek.android.photoutil.R$menu 
Warning:com.kosalgeek.android.photoutil.MainActivity: can't find referenced class com.kosalgeek.android.photoutil.R 
Warning:there were 9 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'. 
> java.io.IOException: Please correct the above warnings first. 
Information:BUILD FAILED 
Information:Total time: 1 mins 31.858 secs 

ファイル私はLIBSにphotoutil.jarファイルがあるフォルダが、再び同じエラー が、ここで事前 で問題の感謝を解決するために私を助けてくださいます私のGradleは

apply plugin: 'com.android.application' 

android { 
compileSdkVersion 24 
buildToolsVersion "24.0.3" 
defaultConfig { 
    applicationId "com.example.jijoabraham.informe" 
    minSdkVersion 15 
    targetSdkVersion 24 
    versionCode 1 
    versionName "1.0" 
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 
    multiDexEnabled true 
} 
buildTypes { 
    release { 
     minifyEnabled true 
     proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
    } 
} 
repositories { 
    maven { 
     url "http://dl.bintray.com/lukaville/maven" 

    } 
    maven { url "https://jitpack.io" } 
    } 
    } 
    configurations{ 
    all*.exclude group: 'com.mcxiaoke.volley' 
    } 
    dependencies { 
compile fileTree(include: ['*.jar'], dir: 'libs') 
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 
    exclude group: 'com.android.support', module: 'support-annotations' 
    }) 
    compile files('libs/PhotoUtil.jar') 
    compile 'com.android.support:multidex:1.0.1' 
    compile 'com.android.support:cardview-v7:24.2.1' 
     compile 'com.android.support:recyclerview-v7:24.2.1' 
    compile 'com.android.support:palette-v7:24.2.1' 
    compile 'com.android.support:support-v4:24.2.1' 
    compile 'com.mcxiaoke.volley:library-aar:1.0.0' 
compile 'com.android.support:appcompat-v7:24.2.1' 
compile 'com.android.support:design:24.2.1' 
compile 'com.oguzdev:CircularFloatingActionMenu:1.0.2' 
compile 'com.yqritc:recyclerview-flexibledivider:1.2.4' 
compile 'com.squareup.okhttp3:okhttp:3.3.1' 
compile 'com.nbsp:library:1.09' 
compile 'com.github.PhilJay:MPAndroidChart:v2.0.9' 
compile 'com.google.firebase:firebase-database:9.6.1' 
compile 'com.google.firebase:firebase-core:9.6.1' 
compile 'com.pkmmte.view:circularimageview:1.1' 
testCompile 'junit:junit:4.12' 
} 


    apply plugin: 'com.google.gms.google-services' 

です助けてください私はこれを解決するために事前に問題がありました

+0

プロジェクトをきれいにし、もう一度 –

+0

を試みるIすで​​にきれいに何回かが、任意の変更を取得していないしてください、私は瓶とクリーンと再追加jarファイルを削除して – jijo

+0

助けてください、あなたが含まれていない、おそらくあなたのGradle .Mostを投稿してください'com.kosalgeek.android.photoutil'ライブラリの依存度。 –

答えて

0

あなたのgradleにこれを追加してください。

android { 
     packagingOptions { 
      exclude 'META-INF/DEPENDENCIES.txt' 
      exclude 'META-INF/LICENSE.txt' 
      exclude 'META-INF/maven/pom.properties' 
      exclude 'META-INF/NOTICE.txt' 
      exclude 'META-INF/NOTICE' 
      exclude 'META-INF/LICENSE' 
      exclude 'META-INF/DEPENDENCIES' 
      exclude 'META-INF/notice.txt' 
      exclude 'META-INF/license.txt' 
      exclude 'META-INF/dependencies.txt' 
      exclude 'META-INF/LGPL2.1' 

     } 
    } 

proguard-rules.pro

-dontwarn com.kosalgeek.android.photoutil.** 

を追加し、これが役立つかもしれませminifyEnabled true trueに設定。

+0

ありがとう – jijo

0

リリースビルドでproguardを有効にしていますので、非常に一般的です。

あなたの場合は、lib com.kosalgeek.android.photoutilに関連しています。 Devendraが上記のように-dontwarnを使用してください。

これが機能しない場合は、おそらく、あなたのライブラリの正しいproguardのルールを見つけるべきでしょう。

関連する問題