简体   繁体   English

Android ProGuard警告-找不到引用的类“ com.zhihu.matisse.R $ plurals”

[英]Android ProGuard warning — can't find referenced class “com.zhihu.matisse.R$plurals”

Not able to generate signed APk after set minifyEnabled true. 将minifyEnabled设置为true后,将无法生成签名的APk。 when set minifyEnabled enabled false.i have no problem.is it mandatory to set minifyEnabled true? 当设置minifyEnabled enabled false时我没有问题。是否必须将minifyEnabled设置为true? without what's the problem? 没有什么问题?

my ProGuard rules here.. 我的ProGuard规则在这里。

-dontwarn com.squareup.picasso.**
 -dontwarn com.squareup.okhttp.internal.**
 -dontwarn org.apache.commons.logging.**
 -dontwarn okhttp3.internal.platform.*
 -dontwarn java.lang.invoke.*
 -dontwarn com.bumptech.glide.**
 -dontwarn org.apache.http.**
 -dontwarn android.net.http.AndroidHttpClient
 -dontwarn com.google.android.gms.**
 -dontwarn com.android.volley.toolbox.**
 -dontwarn com.bumptech.glide.load.engine.bitmap_recycle.LruBitmapPool
 -dontwarn com.bumptech.glide.load.resource.bitmap.Downsampler
 -dontwarn com.bumptech.glide.load.resource.bitmap.HardwareConfigState
 -dontwarn io.card.**

i got 7 warnings 我有7条警告

com.zhihu.matisse.internal.model.SelectedItemCollection: can't find referenced class com.zhihu.matisse.R$plurals    
ss.com.bannerslider.adapters.SliderRecylcerViewAdapter: can't find referenced method 'void onBindImageSlideView(int,ss.com.bannerslider.viewholder.ImageSlideViewHolder)' in program class ss.com.bannerslider.adapters.SliderAdapter   
ss.com.bannerslider.adapters.SliderRecylcerViewAdapter: can't find referenced field 'ss.com.bannerslider.SlideType CUSTOM' in program class ss.com.bannerslider.SlideType   
ss.com.bannerslider.adapters.SliderRecylcerViewAdapter$2: can't find referenced field 'ss.com.bannerslider.SlideType CUSTOM' in program class ss.com.bannerslider.SlideType 
there were 2 unresolved references to classes or interfaces.    
there were 3 unresolved references to program class members.    
Exception while processing task java.io.IOException: Please correct the above warnings first.   

my gradle files 我的gradle文件

  implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support.constraint:constraint-layout:1.1.2'
    implementation 'com.android.support:design:27.1.1'
    implementation 'com.android.support:support-v4:27.1.1'
    implementation 'com.google.android.gms:play-services-auth:15.0.1'
    implementation 'com.android.support:cardview-v7:27.1.1'
    implementation 'com.google.code.gson:gson:2.8.1'
    implementation 'com.mindorks:placeholderview:0.7.2'
    implementation 'de.hdodenhof:circleimageview:2.2.0'
    implementation 'com.github.rakshakhegde:stepper-indicator:2.0.0-alpha'
    implementation 'com.android.support:recyclerview-v7:27.1.1'
    implementation 'com.android.support:recyclerview-v7:27.1.1'
    implementation 'com.android.support:multidex:1.0.3'
    implementation 'com.basgeekball:awesome-validation:1.3'
    implementation 'com.github.f0ris.sweetalert:library:1.5.3'
    implementation 'com.mcxiaoke.volley:library-aar:1.0.0'
    implementation 'com.daprlabs.aaron:cardstack:0.3.1-beta0'
    implementation 'com.customtoast:CustomToastLib:1.0.0'
    implementation 'com.ss.bannerslider:bannerslider:2.0.0'
    implementation 'com.github.bumptech.glide:glide:4.7.1'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.7.1'
    implementation 'net.steamcrafted:materialiconlib:1.1.5'
    implementation 'com.facebook.android:facebook-android-sdk:[4,5)'
    implementation 'co.lujun:androidtagview:1.1.4'
    implementation 'jp.wasabeef:glide-transformations:3.3.0'

    implementation 'org.apache.commons:commons-io:1.3.2'
    implementation 'com.google.firebase:firebase-core:16.0.1'
    implementation 'com.google.firebase:firebase-database:16.0.1'
    implementation 'com.google.firebase:firebase-storage:16.0.1'
    implementation 'com.google.firebase:firebase-auth:16.0.2'

    implementation 'com.google.firebase:firebase-messaging:17.1.0'
    implementation 'com.squareup.picasso:picasso:2.5.2'
    implementation 'com.google.android.gms:play-services-maps:15.0.1'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    implementation 'com.github.armcha:SpaceNavigationView:1.6.0'
    implementation 'com.borax12.materialdaterangepicker:library:1.9'
    implementation 'com.appyvet:materialrangebar:1.4.3'
    implementation 'com.amitshekhar.android:android-networking:1.0.2'

    implementation 'com.google.android.gms:play-services-maps:15.0.1'
    implementation 'com.google.android.gms:play-services-places:15.0.1'
    implementation 'com.zhihu.android:matisse:0.5.0-beta3'
    implementation 'com.intuit.sdp:sdp-android:1.0.5'
    implementation 'com.vanniktech:emoji-one:0.5.1'

please help me .. the help will be appreciated... 请帮助我..帮助将不胜感激...

For release version of APK, it is highly recommended to set minifyEnabled be true, this is not only to minimise the final size of your apk, but also help obfuscate your sensitive packages/classes into some messy form of code so that it won't be reverse engineered easily. 对于APK的发行版,强烈建议将minifyEnabled设置为true,这不仅可以最大程度地减少apk的最终大小,而且还可以将敏感的包/类混淆成某种混乱的代码形式,从而不会易于反向工程。

According to your error messages below: 根据下面的错误消息:

com.zhihu.matisse.internal.model.SelectedItemCollection: can't find referenced class com.zhihu.matisse.R$plurals com.zhihu.matisse.internal.model.SelectedItemCollection:找不到引用的类com.zhihu.matisse.R $ plurals

Means you miss the R package references which usually is the resource class from the android aar library, ie the zhihu , check if you are including this lib properly. 意味着您错过了R包引用,该引用通常是android aar库中的资源类,即zhihu ,请检查您是否正确包含了此lib。

Workaround for this problem is as below to find your own strings.xml and put below declaration to cheat proguard. 解决此问题的方法如下,找到您自己的strings.xml ,并在声明下方放置以欺骗proguard。

<plurals name="error_over_count">
        <item quantity="one">You can only select one media file</item>
        <item quantity="many">You can only select up to %1$d media files</item>
</plurals>

ss.com.bannerslider.adapters.SliderRecylcerViewAdapter: can't find referenced method 'void onBindImageSlideView(int,ss.com.bannerslider.viewholder.ImageSlideViewHolder)' in program class ss.com.bannerslider.adapters.SliderAdapter ss.com.bannerslider.adapters.SliderRecylcerViewAdapter:在程序类ss.com.bannerslider.adapters.SliderAdapter中找不到引用的方法'void onBindImageSlideView(int,ss.com.bannerslider.viewholder.ImageSlideViewHolder)'
ss.com.bannerslider.adapters.SliderRecylcerViewAdapter: can't find referenced field 'ss.com.bannerslider.SlideType CUSTOM' in program class ss.com.bannerslider.SlideType ss.com.bannerslider.adapters.SliderRecylcerViewAdapter:在程序类ss.com.bannerslider.SlideType中找不到引用字段“ ss.com.bannerslider.SlideType CUSTOM”
ss.com.bannerslider.adapters.SliderRecylcerViewAdapter$2: can't find referenced field 'ss.com.bannerslider.SlideType CUSTOM' in program class ss.com.bannerslider.SlideType there were 2 unresolved references to classes or interfaces. ss.com.bannerslider.adapters.SliderRecylcerViewAdapter $ 2:在程序类ss.com.bannerslider.SlideType中找不到引用字段“ ss.com.bannerslider.SlideType CUSTOM”,有2个未解析的对类或接口的引用。 there were 3 unresolved references to program class members. 程序类成员有3个未解决的引用。 Exception while processing task java.io.IOException: Please correct the above warnings first. 处理任务java.io.IOException时发生异常:请首先更正以上警告。

Means you miss the onBindImageSlideView package references which usually is from other libraries, check if you are including that lib properly. 意味着您错过了通常来自其他库的onBindImageSlideView包引用,请检查您是否正确包含了该库。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Proguard警告:com.example.android.PaymentGateway:在类com.example.android.R $ id中找不到引用字段'int container_pg' - Proguard Warning : com.example.android.PaymentGateway: can't find referenced field 'int container_pg' in class com.example.android.R$id ProGuard:找不到引用的类com.google.android.gms.R - ProGuard: can't find referenced class com.google.android.gms.R Android ProGuard:找不到引用的类 - Android ProGuard: can't find referenced class Proguard android找不到引用的类 - Proguard android can't find referenced class Proguard警告:在Observable上找不到引用的类 - Proguard Warning: can't find referenced class on Observable Proguard 警告“找不到引用的 class packagename.R$string ”与 gradle 3.3.0 - Proguard warning “Can't find referenced class packagename.R$string ” with gradle 3.3.0 如何在Android Eclipse ProGuard规则中修复警告“无法找到引用的类”? - How to fix warning 'can't find referenced class' in Android Eclipse ProGuard Rule? ProGuard:找不到引用的类(到R.java) - ProGuard: can't find referenced class (to R.java) ADT R22 - Proguard - 找不到引用的类 - ADT R22 - Proguard - Can't find referenced class Android - Maven Build - Proguard - 找不到引用的类 - Android - Maven Build - Proguard - can't find referenced class
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM