1

I get following exception while build signed apk file (If I just build application in release, here is no error) :

Information:Gradle tasks [:api:assemble, :app:assembleRelease]
Warning:Ignoring Android API artifact com.google.android:android:2.2.1 for debug
Warning:Ignoring Android API artifact com.google.android:android:2.2.1 for release
Warning:Ignoring Android API artifact com.google.android:android:2.2.1 for staging
Warning:com.viewpagerindicator.LinePageIndicator: can't find referenced method 'float ceil(float)' in library class android.util.FloatMath
Warning:there were 1 unresolved references to library class members.
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: 26.173 secs
Information:1 error
Information:6 warnings

here is gradle log :

Warning: there were 21 unresolved references to classes or interfaces.
         You may need to add missing library jars or update their versions.
         If your code works fine without the missing classes, you can suppress
         the warnings with '-dontwarn' options.
         (http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedclass)
Warning: there were 1 unresolved references to library class members.
         You probably need to update the library versions.
         (http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedlibraryclassmember)

Warning: Exception while processing task java.io.IOException: Please correct the above warnings first.
:app:transformClassesAndResourcesWithProguardForRelease FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:transformClassesAndResourcesWithProguardForRelease'.
> java.io.IOException: Please correct the above warnings first.

what I did, is that I change proguard-rules.pro file, to fix exception caused parcel. I found out answer in stackoverflow..

here is how it looks :

-keep class com.zzoome.android.Views.TagGroup.**
-dontwarn com.zzoome.android.Views.TagGroup.**

-keepclassmembers class * implements android.os.Parcelable {
    static ** CREATOR;
}
Community
  • 1
  • 1
Nininea
  • 2,671
  • 6
  • 31
  • 57

2 Answers2

1

I have change proguard-rules :

-keep class com.zzoome.android.Views.TagGroup { *; }
-dontwarn com.zzoome.android.Views.TagGroup
-dontwarn com.google.**
-dontwarn com.viewpagerindicator.LinePageIndicator

-keepclassmembers class * implements android.os.Parcelable {
    static ** CREATOR;
}
Nininea
  • 2,671
  • 6
  • 31
  • 57
-1

Add these to your proguard-rules file

-dontwarn okio.**

-dontwarn com.google.**

Similarly add all your libraries .

Tamas Rev
  • 7,008
  • 5
  • 32
  • 49