The program can't export when use proguard and admob! Please help!

240 views
Skip to first unread message

John Saca

unread,
Oct 10, 2014, 11:25:09 AM10/10/14
to google-adm...@googlegroups.com
I hope to following google's new admob instruction to update my program. In testing, it works ok. When I export to APK. The console shows some warning and error code 1. I tried to change the proguard setting and can't solve. Who can help me? Because I haven't any idea to solve it.
Following is the proguard.cfg setting:
-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses   
-dontpreverify
-verbose  
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
-keep public class * extends android.app.Activity  
-keep public class * extends android.app.Application  
-keep public class * extends android.app.Service  
-keep public class * extends android.content.BroadcastReceiver  
-keep public class * extends android.content.ContentProvider  
-keep public class * extends android.app.backup.BackupAgentHelper  
-keep public class * extends android.preference.Preference  
-keep public class com.android.vending.licensing.ILicensingService  
-keepclasseswithmembernames class * {  
native <methods>;  
}  
-keepclasseswithmembers class * {  
public <init>(android.content.Context, android.util.AttributeSet);  
}  
-keepclasseswithmembers class * {  
public <init>(android.content.Context, android.util.AttributeSet, int);  
}  
-keepclassmembers class * extends android.app.Activity {  
public void *(android.view.View);  
}  
-keepclassmembers enum * {  
public static **[] values();  
public static ** valueOf(java.lang.String);  
}  
-keep class * implements android.os.Parcelable {  
 public static final android.os.Parcelable$Creator *;  
}  
-dontwarn android.support.v4.**    
-keep class android.support.v4.** { *; }  
-keep interface android.support.v4.app.** { *; }  
-keep public class * extends android.support.v4.**  
-keep public class * extends android.app.Fragment
-keep public class com.google.android.gms.ads.** {
public *;
}
-keep public class com.google.ads.** {
public *;
}

And than, following is the Error message from console:

[2014-10-10 10:49:58 - admobTestingApp] Proguard returned with error code 1. See console
[2014-10-10 10:49:58 - admobTestingApp] Warning:         com.google.android.gms.common.SupportErrorDialogFragment: can't find referenced method 'void     setShowsDialog(boolean)' in class com.google.android.gms.common.SupportErrorDialogFragment
[2014-10-10 10:49:58 - admobTestingApp] Warning: com.google.android.gms.common.api.d: can't find referenced method 'android.support.v4.app.FragmentActivity getActivity()' in class com.google.android.gms.common.api.d
[2014-10-10 10:49:58 - admobTestingApp]       You should check if you need to specify additional program jars.
[2014-10-10 10:49:58 - admobTestingApp] Warning: there were 2 unresolved references to program class members.
[2014-10-10 10:49:58 - admobTestingApp] Your input classes appear to be inconsistent.
[2014-10-10 10:49:58 - admobTestingApp] You may need to recompile them and try again.
[2014-10-10 10:49:58 - admobTestingApp] Alternatively, you may have to specify the option
[2014-10-10 10:49:58 - admobTestingApp] -dontskipnonpubliclibraryclassmembers.
[2014-10-10 10:49:58 - admobTestingApp] java.io.IOException: Please correct the above warnings first.
[2014-10-10 10:49:58 - admobTestingApp] at proguard.Initializer.execute(Initializer.java:321)
[2014-10-10 10:49:58 - admobTestingApp] at proguard.ProGuard.initialize(ProGuard.java:211)
[2014-10-10 10:49:58 - admobTestingApp] at proguard.ProGuard.execute(ProGuard.java:86)
[2014-10-10 10:49:58 - admobTestingApp] at proguard.ProGuard.main(ProGuard.java:492)
My program's target version 19 and the min. version is 10
Please help!!

John Saca

unread,
Oct 15, 2014, 12:48:31 AM10/15/14
to google-adm...@googlegroups.com
Please help! Anyone can give me some hints?



John Saca於 2014年10月10日星期五UTC+8下午11時25分09秒寫道:

Eric Leichtenschlag

unread,
Oct 15, 2014, 6:41:06 PM10/15/14
to google-adm...@googlegroups.com
Might be worth trying to keep the gms common classes and see how much this resolves it:

-keep public class com.google.android.gms.common.** {
  public *;
}

Thanks,
Eric
Reply all
Reply to author
Forward
0 new messages