0

I have a problem of generating a signed APK.

enter image description here

and here it is the proguard-rules.pro file

-assumenosideeffects class android.util.Log {
    public static int v(...);
    public static int d(...);
}

# Required to preserve the Flurry SDK
#-keep class com.flurry.** { *; }
#-dontwarn com.flurry.**
#-keepattributes *Annotation*,EnclosingMethod,Signature
#-keepclasseswithmembers class * {
#   public (android.content.Context, android.util.AttributeSet, int);
# }

 # Google Play Services library
 -keep class * extends java.util.ListResourceBundle {
   protected Object[ ][ ] getContents();
}

 -keep public class com.google.android.gms.common.internal.safeparcel.SafeParcelable {
  public static final *** NULL;
 }

 -keepnames @com.google.android.gms.common.annotation.KeepName class *
 -keepclassmembernames class * {
    @com.google.android.gms.common.annotation.KeepName *;
  }

 -keepnames class * implements android.os.Parcelable {
  public static final ** CREATOR;
 }

and the error as described in the following line

 # Google Play Services library
 -keep class * extends java.util.ListResourceBundle {
   protected Object[ ][ ] getContents();
}

and the used lib version are

  • minSdkVersion = 19
  • targetSdkVersion = 27
  • compileSdkVersion = 27
  • buildToolsVersion = '27.0.0'
  • supportLibraryVersion = '27.0.1'
  • gmsVersion = '11.6.0'
  • firebaseVersion = '11.6.0'

classpath 'com.android.tools.build:gradle:3.0.1'

classpath 'com.google.gms:google-services:3.1.0'

I need a help, what is the problem, and how to solve it?

Note: I have no problem of running the app on my device through the USB, but I cannot generate the APK for release.

Amjad Omari
  • 1,104
  • 3
  • 15
  • 40
  • 1
    An array has the square brackets without a space in the middle. Like this: `protected Object[][] getContents();` – MatPag Nov 20 '17 at 22:49
  • 1
    @MatPag Thanks, but when I removed the spaces it raise this error "Error:Execution failed for task ':app:transformClassesAndResourcesWithProguardForDevRelease'. > Job failed, see logs for details" Do you have any Idea please ? – Amjad Omari Nov 20 '17 at 23:10
  • This a completely different error, you should post the updated stacktrace with the problem – MatPag Nov 20 '17 at 23:34

1 Answers1

0

First of all, Thanks @MatPag, your comment on the question above was correct, in addition there was another addition to solve this issue:

  1. An array has the square brackets without a space in the middle. Like this: protected Object[][] getContents();
  2. I have to add the following two lines to the proguard file

    -ignorewarnings

    -keep class * { public private *; }

and this solution was in here

Amjad Omari
  • 1,104
  • 3
  • 15
  • 40