2017-03-02 22 views
2

を発生させながら、私は私のAndroidアプリの署名APKを生成しようとしているとタスクは、私は、このエラーを与えて失敗した残っている:タスク ':app:transformClassesAndResourcesWithProguardForRelease'の実行に失敗しました。署名APK

-keep public class com.mikepenz.fastadapter 
-keep public class com.squareup.picasso 
-keep public class rx.internal.util.unsafe 

ここbuild.gradleだ:

Information:Gradle tasks [:app:assembleRelease] 
Warning:com.mikepenz.fastadapter_extensions.items.SingleLineItem: can't find referenced class com.mikepenz.materialize.holder.StringHolder 
Warning:com.mikepenz.fastadapter_extensions.items.SingleLineItem: can't find referenced class com.mikepenz.materialize.holder.ImageHolder 
Warning:com.mikepenz.fastadapter_extensions.items.SingleLineItem: can't find referenced class com.mikepenz.materialize.holder.StringHolder 
Warning:com.mikepenz.fastadapter_extensions.items.SingleLineItem: can't find referenced class com.mikepenz.materialize.holder.ImageHolder 
Warning:com.mikepenz.fastadapter_extensions.items.SingleLineItem: can't find referenced class com.mikepenz.materialize.holder.StringHolder 
Warning:com.mikepenz.fastadapter_extensions.items.SingleLineItem: can't find referenced class com.mikepenz.materialize.holder.ImageHolder 
Warning:com.mikepenz.fastadapter_extensions.items.SingleLineItem: can't find referenced class com.mikepenz.materialize.holder.StringHolder 
Warning:com.mikepenz.fastadapter_extensions.items.SingleLineItem: can't find referenced class com.mikepenz.materialize.holder.ImageHolder 
Warning:com.mikepenz.fastadapter_extensions.items.ThreeLineItem: can't find referenced class com.mikepenz.materialize.holder.StringHolder 
Warning:com.mikepenz.fastadapter_extensions.items.ThreeLineItem: can't find referenced class com.mikepenz.materialize.holder.ImageHolder 
Warning:com.mikepenz.fastadapter_extensions.items.ThreeLineItem: can't find referenced class com.mikepenz.materialize.holder.StringHolder 
Warning:com.mikepenz.fastadapter_extensions.items.ThreeLineItem: can't find referenced class com.mikepenz.materialize.holder.ImageHolder 
Warning:com.mikepenz.fastadapter_extensions.items.ThreeLineItem: can't find referenced class com.mikepenz.materialize.holder.StringHolder 
Warning:com.mikepenz.fastadapter_extensions.items.ThreeLineItem: can't find referenced class com.mikepenz.materialize.holder.ImageHolder 
Warning:com.mikepenz.fastadapter_extensions.items.ThreeLineItem: can't find referenced class com.mikepenz.materialize.holder.StringHolder 
Warning:com.mikepenz.fastadapter_extensions.items.ThreeLineItem: can't find referenced class com.mikepenz.materialize.holder.ImageHolder 
Warning:com.mikepenz.fastadapter_extensions.items.TwoLineItem: can't find referenced class com.mikepenz.materialize.holder.StringHolder 
Warning:com.mikepenz.fastadapter_extensions.items.TwoLineItem: can't find referenced class com.mikepenz.materialize.holder.ImageHolder 
Warning:com.mikepenz.fastadapter_extensions.items.TwoLineItem: can't find referenced class com.mikepenz.materialize.holder.StringHolder 
Warning:com.mikepenz.fastadapter_extensions.items.TwoLineItem: can't find referenced class com.mikepenz.materialize.holder.ImageHolder 
Warning:com.mikepenz.fastadapter_extensions.items.TwoLineItem: can't find referenced class com.mikepenz.materialize.holder.StringHolder 
Warning:com.mikepenz.fastadapter_extensions.items.TwoLineItem: can't find referenced class com.mikepenz.materialize.holder.ImageHolder 
Warning:com.mikepenz.fastadapter_extensions.items.TwoLineItem: can't find referenced class com.mikepenz.materialize.holder.StringHolder 
Warning:com.mikepenz.fastadapter_extensions.items.TwoLineItem: can't find referenced class com.mikepenz.materialize.holder.ImageHolder 
Warning:com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.OkHttpClient 
Warning:com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.Cache 
Warning:com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.OkHttpClient 
Warning:com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.CacheControl 
Warning:com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.CacheControl$Builder 
Warning:com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.Request$Builder 
Warning:com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.OkHttpClient 
Warning:com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.Call 
Warning:com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.Response 
Warning:com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.ResponseBody 
Warning:com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.Response 
Warning:com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.ResponseBody 
Warning:com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.OkHttpClient 
Warning:com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.Cache 
Warning:com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.CacheControl 
Warning:com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.CacheControl$Builder 
Warning:com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.Request$Builder 
Warning:com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.Response 
Warning:com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.Cache 
Warning:com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.CacheControl 
Warning:com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.Request 
Warning:com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.Call 
Warning:com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.Response 
Warning:com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.ResponseBody 
Warning:com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.OkHttpClient 
Warning:com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.CacheControl$Builder 
Warning:com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.CacheControl 
Warning:com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.Request$Builder 
Warning:com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.Response 
Warning:com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.ResponseBody 
Warning:com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.Cache 
Warning:rx.internal.util.unsafe.BaseLinkedQueueConsumerNodeRef: can't find referenced class sun.misc.Unsafe 
Warning:rx.internal.util.unsafe.BaseLinkedQueueProducerNodeRef: can't find referenced class sun.misc.Unsafe 
Warning:rx.internal.util.unsafe.ConcurrentCircularArrayQueue: can't find referenced class sun.misc.Unsafe 
Warning:rx.internal.util.unsafe.ConcurrentSequencedCircularArrayQueue: can't find referenced class sun.misc.Unsafe 
Warning:rx.internal.util.unsafe.MpmcArrayQueueConsumerField: can't find referenced class sun.misc.Unsafe 
Warning:rx.internal.util.unsafe.MpmcArrayQueueProducerField: can't find referenced class sun.misc.Unsafe 
Warning:rx.internal.util.unsafe.MpscLinkedQueue: can't find referenced class sun.misc.Unsafe 
Warning:rx.internal.util.unsafe.SpmcArrayQueueConsumerField: can't find referenced class sun.misc.Unsafe 
Warning:rx.internal.util.unsafe.SpmcArrayQueueProducerField: can't find referenced class sun.misc.Unsafe 
Warning:rx.internal.util.unsafe.SpscArrayQueue: can't find referenced class sun.misc.Unsafe 
Warning:rx.internal.util.unsafe.SpscUnboundedArrayQueue: can't find referenced class sun.misc.Unsafe 
Warning:rx.internal.util.unsafe.UnsafeAccess: can't find referenced class sun.misc.Unsafe 
Warning:there were 145 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 
Information:BUILD FAILED 
Information:Total time: 19.342 secs 
Information:1 error 
Information:69 warnings 
Information:See complete output in console 

ここに私のproguard-rules.proファイルですファイル:

apply plugin: 'com.android.application' 

//Put Fabric plugin after Android plugin 
apply plugin: 'io.fabric' 

android { 
    compileSdkVersion 25 
    buildToolsVersion "25.0.0" 

    defaultConfig { 
     applicationId "com.abc.xxx" 
     minSdkVersion 16 
     targetSdkVersion 25 
     versionCode 1 
     versionName "0.1" 
     multiDexEnabled true 
     vectorDrawables.useSupportLibrary = true 
    } 
    buildTypes { 
     release { 
      minifyEnabled true 
      shrinkResources true 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
    repositories { 
     mavenCentral() 
     maven { 
      url "https://jitpack.io" 
     } 
     maven { url 'https://maven.fabric.io/public' } 
    } 
    dexOptions { 
     javaMaxHeapSize "4g" 
    } 
} 

dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    compile('com.mikepenz:fastadapter:[email protected]') { 
     transitive = true 
    } 
    compile('com.crashlytics.sdk.android:crashlytics:[email protected]') { 
     transitive = true; 
    } 
    compile 'com.android.support:appcompat-v7:25.0.0' 
    compile 'com.android.support:design:25.0.0' 
    compile 'com.android.support:cardview-v7:25.0.0' 
    compile 'com.android.support:recyclerview-v7:25.0.0' 
    compile 'com.mikepenz:fastadapter-extensions:[email protected]' 
    compile 'de.hdodenhof:circleimageview:2.1.0' 
    compile 'com.google.android.gms:play-services:10.2.0' 
    compile 'com.google.android.gms:play-services-location:10.2.0' 
    compile 'com.google.firebase:firebase-auth:10.2.0' 
    compile 'com.android.support:support-v4:25.0.0' 
    compile 'com.google.firebase:firebase-database:10.2.0' 
    compile 'com.firebase:geofire-android:2.1.0' 
    compile 'com.squareup.picasso:picasso:2.5.2' 
    compile 'com.google.firebase:firebase-storage:10.2.0' 
    compile 'com.google.firebase:firebase-core:10.2.0' 
    compile 'com.google.firebase:firebase-invites:10.2.0' 
    compile 'hani.momanii.supernova_emoji_library:supernova-emoji-library:0.0.2' 
    compile 'me.himanshusoni.chatmessageview:chat-message-view:1.0.3' 
    compile 'com.github.bumptech.glide:glide:3.7.0' 
    compile 'com.firebaseui:firebase-ui:0.4.1' 
    compile 'pl.charmas.android:android-reactive-location:[email protected]' 
    compile 'io.reactivex:rxjava:1.2.0' 
    compile 'io.reactivex:rxandroid:1.2.1' 
    compile 'com.facebook.android:facebook-android-sdk:[4,5)' 
    compile 'com.android.support:support-vector-drawable:25.0.0' 
    compile 'com.github.coyarzun89:fabtransitionactivity:0.2.0' 
    compile 'org.adw.library:discrete-seekbar:1.0.1' 
    compile 'com.codemybrainsout.rating:ratingdialog:1.0.7' 
    compile 'com.github.paolorotolo:appintro:4.1.0' 
    testCompile 'junit:junit:4.12' 
} 

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

なぜ私はこれらの警告とエラーを取得し、私はどのようにそれらを取り除くことができますか?

私はウェブを検索してこれをdocと読んでみましたが、まだ解明できません。

私にこれを手伝ってください。

+0

あなたはprogaurdルールを設定して、trueに設定しましたか? – Noorul

+0

@Ahamedはい、編集された質問 –

+0

がfalseを設定してこの問題を解決します。あなたのAPKサイズは大きくなります。このエラーは長時間前に起こりました。 – Noorul

答えて

1

あなたの問題には、picassoによって使用されるokhttpのproguardの例外が含まれているようです。追加

# OkHttp 
-keepattributes Signature 
-keepattributes *Annotation* 
-keep class com.squareup.okhttp.** { *; } 
-keep interface com.squareup.okhttp.** { *; } 
-dontwarn com.squareup.okhttp.** 

は、あなたが使用している可能性があり、他のライブラリのProGuardの設定のためのhereを参照してください。

+0

'squareup'ライブラリのために解決しましたが、' Warning:rx.internal.util.unsafe.BaseLinkedQueueConsumerNodeR ef:参照されるクラスsun.misc.Unsafe'とそれに関連する警告は見つかりませんでしたか?あなたが提供したリンクには、この図書館の言及はありません。 –

+0

これはおそらくrxjavaです。 – JohnWowUs

+0

'-dontwarn com.squareup.okhttp。**'を削除しましたので、私は警告が出ていないことを知りました。それは問題が解決されないことを意味しますか?どのようにアプリケーションに影響を与えることができますか? –

1

Warning:com.mikepenz.fastadapter_extensions.items.SingleLineItem: 

についてルール

-dontwarn sun.misc.Unsafe 
-dontwarn com.google.common.collect.MinMaxPriorityQueue 

Check this link it my help you

下に追加ルール

-keep class com.mikepenz.materialize.holder.** { *; } 

From Comment discussion @user1140237 it solved it for mikepenz library but what about Warning:rx.internal.util.unsafe.BaseLinkedQueueConsumerNodeR‌​ef: can't find referenced class sun.misc.Unsafe and related warnings?

の下に適用します

ok httpまたはsquare関連については、JohnWowUsの回答に従います

+0

'-dontwarn'だけを使って問題を解決しないと、アプリやユーザーの体験にどのような影響がありますか? –

+0

@HammadNasir解決されていない参照やその他の重要な問題について、まったく警告しないことを指定します。オプションのフィルタは正規表現です。 ProGuardは、名前が一致するクラスに関する警告を出力しません。無視する警告は危険です。たとえば、未解決のクラスまたはクラスメンバーが実際に処理に必要な場合、処理されたコードは正しく機能しません。あなたがやっていることがわかっている場合にのみ、このオプションを使用してください!プロガードの詳細については、https://www.guardsquare.com/jp/proguard/manual/usageを参照してください。 – user1140237

関連する問題