I have these warnings? How to solve it?
I tried to do -dontwarn kotlinx.coroutines.flow.**inlined**
It solves the warning, but I think my app crashes.
Warning: kotlinx.coroutines.flow.FlowKt__BuildersKt$asFlow$$inlined$unsafeFlow$10$1: can't find enclosing method 'java.lang.Object collect$$forInline(kotlinx.coroutines.flow.FlowCollector,kotlin.coroutines.Continuation)' in program class kotlinx.coroutines.flow.FlowKt__BuildersKt$asFlow$$inlined$unsafeFlow$10
Warning: kotlinx.coroutines.flow.FlowKt__BuildersKt$asFlow$$inlined$unsafeFlow$2$1: can't find enclosing method 'java.lang.Object collect$$forInline(kotlinx.coroutines.flow.FlowCollector,kotlin.coroutines.Continuation)' in program class kotlinx.coroutines.flow.FlowKt__BuildersKt$asFlow$$inlined$unsafeFlow$2
Warning: kotlinx.coroutines.flow.FlowKt__BuildersKt$asFlow$$inlined$unsafeFlow$3$1: can't find enclosing method 'java.lang.Object collect$$forInline(kotlinx.coroutines.flow.FlowCollector,kotlin.coroutines.Continuation)' in program class kotlinx.coroutines.flow.FlowKt__BuildersKt$asFlow$$inlined$unsafeFlow$3
Warning: kotlinx.coroutines.flow.FlowKt__BuildersKt$asFlow$$inlined$unsafeFlow$4$1: can't find enclosing method 'java.lang.Object collect$$forInline(kotlinx.coroutines.flow.FlowCollector,kotlin.coroutines.Continuation)' in program class kotlinx.coroutines.flow.FlowKt__BuildersKt$asFlow$$inlined$unsafeFlow$4
Warning: kotlinx.coroutines.flow.FlowKt__BuildersKt$asFlow$$inlined$unsafeFlow$5$1: can't find enclosing method 'java.lang.Object collect$$forInline(kotlinx.coroutines.flow.FlowCollector,kotlin.coroutines.Continuation)' in program class kotlinx.coroutines.flow.FlowKt__BuildersKt$asFlow$$inlined$unsafeFlow$5
Warning: kotlinx.coroutines.flow.FlowKt__BuildersKt$asFlow$$inlined$unsafeFlow$6$1: can't find enclosing method 'java.lang.Object collect$$forInline(kotlinx.coroutines.flow.FlowCollector,kotlin.coroutines.Continuation)' in program class kotlinx.coroutines.flow.FlowKt__BuildersKt$asFlow$$inlined$unsafeFlow$6
Warning: kotlinx.coroutines.flow.FlowKt__BuildersKt$asFlow$$inlined$unsafeFlow$7$1: can't find enclosing method 'java.lang.Object collect$$forInline(kotlinx.coroutines.flow.FlowCollector,kotlin.coroutines.Continuation)' in program class kotlinx.coroutines.flow.FlowKt__BuildersKt$asFlow$$inlined$unsafeFlow$7
-dontwarn does what it says. This might rather be something alike:
-keep class kotlinx.coroutines.**
I updated from kotlinx-coroutines-android:1.3.2 to :1.3.7, at which point all of those warnings went away.
I did get a few new ones, and needed to add the following to remove them:
-dontwarn kotlinx.coroutines.debug.**
Related
I have to upgrade my build tool to com.android.tools.build:gradle:3.1.3 with gradle 4.4. My project worked well with proguard previously. But after upgrading, there are a lot of issues as the one below:
MainActivity: can't find referenced method 'void setAlpha(float)' in program class android.view.View
...can't find referenced method 'void execute(java.lang.Runnable)' in program class android.os.AsyncTask
...can't find referenced method 'void overridePendingTransition(int,int)'
...can't find referenced method 'boolean canPause()' in program class android.widget.VideoView
Warning: library class android.app.AlarmManager$AlarmClockInfo depends on program class android.os.Parcelable$Creator
Warning: library class android.graphics.drawable.AdaptiveIconDrawable extends or implements program class android.graphics.drawable.Drawable
What did I miss in my proguard file?
After taking a lot of time looking at the log cat, I saw that every referenced method was Added in API level 11 or above (I am using if/else check) and my min sdk was 15. Any suggestion?
Proguard version is updated with the buildtools, maybe this is an issue with that Proguard version. Have you tried to downgrade (or updgrade) manually your Proguard version to see if the error still occurs ?
override it like this
buildscript {
configurations.all {
resolutionStrategy {
force 'net.sf.proguard:proguard-gradle:x.x.x' //here use whatever version you'd like
}
}
}
and look up your proguard version like this
./gradlew buildEnvironment
When building apk using Proguard, I see theses Warnings:
com.google.android.gms.internal.zzaq: can't find referenced class com.google.android.gms.internal.zzzk
com.google.android.gms.internal.zzaq: can't find referenced class com.google.android.gms.internal.zzzk$zza
com.google.android.gms.internal.zzaq: can't find referenced class com.google.android.gms.internal.zzzk
com.google.android.gms.internal.zzaq: can't find referenced class com.google.android.gms.internal.zzzk$zza
com.google.android.gms.internal.zzaq: can't find referenced class com.google.android.gms.internal.zzzk$zza
com.google.android.gms.internal.zzaq: can't find referenced class com.google.android.gms.internal.zzzk$zza
com.google.android.gms.internal.zzaq: can't find referenced class com.google.android.gms.internal.zzzk
com.google.android.gms.internal.zzaq$1: can't find referenced class com.google.android.gms.internal.zzzk
com.google.android.gms.internal.zzaq$1: can't find referenced class com.google.android.gms.internal.zzzk
com.google.android.gms.internal.zzbd: can't find referenced class com.google.android.gms.internal.zzaqg
com.google.android.gms.internal.zzbd: can't find referenced class com.google.android.gms.internal.zzzk
com.google.android.gms.internal.zzbd: can't find referenced class com.google.android.gms.internal.zzzk
com.google.android.gms.internal.zzbd: can't find referenced class com.google.android.gms.internal.zzaqg
com.google.android.gms.internal.zzej: can't find referenced field 'int[] AdsAttrs' in program class com.google.android.gms.R$styleable
com.google.android.gms.internal.zzej: can't find referenced field 'int AdsAttrs_adSize' in program class com.google.android.gms.R$styleable
com.google.android.gms.internal.zzej: can't find referenced field 'int AdsAttrs_adSizes' in program class com.google.android.gms.R$styleable
com.google.android.gms.internal.zzej: can't find referenced field 'int AdsAttrs_adUnitId' in program class com.google.android.gms.R$styleable
I'm using Google Play Services 10.2.0, modules ads, ads-lite, analytics, analytics-impl, base, basement, drive, games, tasks.
What modules or libraries need to be included to fix those warnings?
Based from this thread, if you use ProGuard, you need to keep some GMS (Google Play Services) classes and they are annotated with #com.google.android.gms.common.annotation.KeepName.
You need to ignore like you are compiling but you also need to keep the class so it can find it during runtime.
Add these two lines to your proguard configuration file:
-keep class com.google.android.gms.** { *; }
-dontwarn com.google.android.gms.**
You may also check these related SO posts:
Proguard and error
com.google.android.gms.internal.zzhu: can't find referenced class android.security.NetworkSecurityPolicy
How to use -dontwarn in ProGuard?
Can not export signed APK with ProGuard enable when using MoPub integration with the following warning:
Proguard returned with error code 1. See console
Warning: com.mopub.nativeads.MoPubRecyclerAdapter: can't find referenced method 'void notifyItemInserted(int)' in class com.mopub.nativeads.MoPubRecyclerAdapter
Warning: com.mopub.nativeads.MoPubRecyclerAdapter: can't find referenced method 'void notifyItemRemoved(int)' in class com.mopub.nativeads.MoPubRecyclerAdapter
Warning: com.mopub.nativeads.MoPubRecyclerAdapter$3: can't find referenced method 'void notifyDataSetChanged()' in class com.mopub.nativeads.MoPubRecyclerAdapter
Warning: com.mopub.nativeads.MoPubRecyclerAdapter$3: can't find referenced method 'void notifyItemRangeChanged(int,int)' in class com.mopub.nativeads.MoPubRecyclerAdapter
Warning: com.mopub.nativeads.MoPubRecyclerAdapter$3: can't find referenced method 'void notifyItemRangeInserted(int,int)' in class com.mopub.nativeads.MoPubRecyclerAdapter
Warning: com.mopub.nativeads.MoPubRecyclerAdapter$3: can't find referenced method 'void notifyItemRangeRemoved(int,int)' in class com.mopub.nativeads.MoPubRecyclerAdapter
You should check if you need to specify additional program jars.
Your input classes appear to be inconsistent.
This question already have been asked many times, but I am not able to resolve it. I am trying to export my app using eclipse for final release, but I am getting the below error.
I already added
-keep class com.afollestad.materialdialogs.*{ *; }
-dontwarn com.afollestad.materialdialogs.**
-dontshrink
Error resolved, but after running my app crashed.
please help me
this is the error:
Proguard returned with error code 1. See console
Warning: com.afollestad.materialdialogs.util.DialogUtils: can't find referenced method 'android.content.res.ColorStateList getColorStateList(int)' in class android.content.Context
Warning: com.afollestad.materialdialogs.util.DialogUtils: can't find referenced method 'int getColor(int)' in class android.content.Context
You should check if you need to specify additional program jars.
Warning: there were 2 unresolved references to program class members.
Your input classes appear to be inconsistent.
You may need to recompile them and try again.
Alternatively, you may have to specify the option
dontskipnonpubliclibraryclassmembers'.
java.io.IOException: Please correct the above warnings first.
at proguard.Initializer.execute(Initializer.java:321)
at proguard.ProGuard.initialize(ProGuard.java:211)
at proguard.ProGuard.execute(ProGuard.java:86)
When I try to export an .apk file it gives me this error:
[2013-06-10 13:46:47 -] Proguard returned with error code 1. See console
[2013-06-10 13:46:47 -] Warning: com.facebook.widget.FacebookFragment: can't find referenced method 'android.support.v4.app.FragmentActivity getActivity()' in class com.facebook.widget.FacebookFragment
What could be the reason for it? I dont understand what dontskipnonpubliclibraryclassmembers means?
Thanks