-1

I am facing this problems while enabling proguard in my release build.

Information:Gradle tasks [:app:assembleRelease] Warning:com.google.maps.android.kml.KmlRenderer$1: can't find referenced field 'int window' in program class com.google.maps.android.R$id

Warning:there were 1 unresolved references to program class members.

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: 26.457 secs Information:1 error Information:3 warnings Information:See complete output in console

My Proguard setup rule looks like this.

-keep class butterknife.** { *; }
-dontwarn butterknife.internal.**
-keep class **$$ViewBinder { *; }

-keepclasseswithmembernames class * {
 @butterknife.* <fields>;
 }

-keepclasseswithmembernames class * {
 @butterknife.* <methods>;
 }
-dontwarn io.card.**

##############################################
#Okio Rules
##############################################
-dontwarn okio.**
-keep class okio.** { *; }

##############################################
#Picasso
##############################################
-dontwarn com.squareup.picasso.**
-dontwarn com.squareup.okhttp.**
-dontwarn javax.annotation.**

##############################################
#otto
##############################################
-keepattributes *Annotation*
-keepclassmembers class ** {
@com.squareup.otto.Subscribe public *;
@com.squareup.otto.Produce public *;
}



###############################################
#Retrofit rules
###############################################
# Platform calls Class.forName on types which do not exist on Android             to determine platform.
-dontnote retrofit2.Platform
# Platform used when running on Java 8 VMs. Will not be used at     runtime.
-dontwarn retrofit2.Platform$Java8
# Retain generic type information for use by reflection by converters     and adapters.
-keepattributes Signature
# Retain declared checked exceptions for use by a Proxy instance.
-keepattributes Exceptions


###################################################
#Active android
###################################################
-keep class com.activeandroid.** { *; }
-keep class com.activeandroid.**.** { *; }
-keep class * extends com.activeandroid.Model
-keep class * extends com.activeandroid.serializer.TypeSerializer
-keep class com.example.model.** { *; }



-keepclasseswithmembers class com.jombay.vger.rx.resources.** {
  <init>(...);
  public void set*(***);
  public *** get*();
}

-keepclasseswithmembers public class          com.jombay.vger.retrofit.resources.** {
  public protected private <init>(...);
  public void set(*);
  public ** get*();
}

-keepclasseswithmembers public class com.jombay.vger.utils.** {
  public protected private <init>(...);
}

-keepclassmembers class * {
 @org.codehaus.jackson.annotate.* *;
}

-keep class com.fasterxml.jackson.databind.ObjectMapper {*;}
-keep class com.fasterxml.jackson.databind.ObjectWriter {*;}

-keepattributes InnerClasses

 -dontskipnonpubliclibraryclassmembers
 -keepclassmembers class * {
  @com.fasterxml.jackson.annotation.JsonCreator *;
  @com.fasterxml.jackson.annotation.JsonProperty *;
 }
 -dontskipnonpubliclibraryclassmembers

################################################
#Logs
################################################
-assumenosideeffects class android.util.Log {
public static *** d(...);
public static *** v(...);
public static *** i(...);
public static *** w(...);
public static *** e(...);
public static *** wtf(...);
}


###################################################
#Google
###################################################
-keep class com.google.analytics.** { *; }
-keep public class com.google.android.gms.* { public *; }
-dontwarn com.google.android.gms.**
Ram Mandal
  • 1,899
  • 1
  • 20
  • 35

1 Answers1

0

Looks like an inner class in the class KmlRenderer tries to access a non-existing field in the generated class com.google.maps.android.R$id. Maybe the error is resolved by using an updated version of the google maps library.

You can also disable the warning with

-dontwarn com.google.maps.android.kml.KmlRenderer
T. Neidhart
  • 6,060
  • 2
  • 15
  • 38