我创建了项目使用LocationClient(在Google Play服务中)
但是在使用groguard导出版本时我遇到了问题。我在这里添加了proguard-config(http://developer.android.com/google/play-services/setup.html#Proguard)
但导出时仍然出错。任何人都可以帮我解决这个问题。
[2014-04-28 08:10:14 - myProject] Proguard returned with error code 1. See console
[2014-04-28 08:10:14 - myProject] Note: there were 619 duplicate class definitions.
[2014-04-28 08:10:14 - myProject] Warning: com.google.android.gms.analytics.GoogleAnalytics$b: can't find superclass or interface android.app.Application$ActivityLifecycleCallbacks
[2014-04-28 08:10:14 - myProject] Warning: com.google.android.gms.common.images.ImageManager$e: can't find superclass or interface android.content.ComponentCallbacks2
[2014-04-28 08:10:14 - myProject] Warning: com.google.android.gms.analytics.GoogleAnalytics: can't find referenced class android.app.Application$ActivityLifecycleCallbacks
[2014-04-28 08:10:14 - myProject] Warning: com.google.android.gms.analytics.GoogleAnalytics: can't find referenced method 'void registerActivityLifecycleCallbacks(android.app.Application$ActivityLifecycleCallbacks)' in class android.app.Application
[2014-04-28 08:10:14 - myProject] Warning: com.google.android.gms.analytics.GoogleAnalytics$b: can't find referenced class android.app.Application$ActivityLifecycleCallbacks
[2014-04-28 08:10:14 - myProject] Warning: com.google.android.gms.common.GooglePlayServicesUtil: can't find referenced field 'int smallestScreenWidthDp' in class android.content.res.Configuration
[2014-04-28 08:10:14 - myProject] Warning: com.google.android.gms.common.images.ImageManager: can't find referenced method 'void registerComponentCallbacks(android.content.ComponentCallbacks)' in class android.content.Context
[2014-04-28 08:10:14 - myProject] Warning: com.google.android.gms.common.images.ImageManager$e: can't find referenced class android.content.ComponentCallbacks2
[2014-04-28 08:10:14 - myProject] Warning: com.google.android.gms.common.images.a: can't find referenced method 'android.graphics.drawable.Drawable[] getCompoundDrawablesRelative()' in class android.widget.TextView
[2014-04-28 08:10:14 - myProject] Warning: com.google.android.gms.common.images.a: can't find referenced method 'void setCompoundDrawablesRelativeWithIntrinsicBounds(android.graphics.drawable.Drawable,android.graphics.drawable.Drawable,android.graphics.drawable.Drawable,android.graphics.drawable.Drawable)' in class android.widget.TextView
[2014-04-28 08:10:14 - myProject] Warning: com.google.android.gms.internal.cx: can't find referenced method 'java.lang.String getDefaultUserAgent(android.content.Context)' in class android.webkit.WebSettings
[2014-04-28 08:10:14 - myProject] Warning: com.google.android.gms.internal.cx: can't find referenced method 'void setMediaPlaybackRequiresUserGesture(boolean)' in class android.webkit.WebSettings
[2014-04-28 08:10:14 - myProject] Warning: com.google.android.gms.internal.gd$b: can't find referenced method 'android.view.Display getDisplay()' in class android.view.View
[2014-04-28 08:10:14 - myProject] Warning: com.google.android.gms.internal.gd$b: can't find referenced method 'void removeOnGlobalLayoutListener(android.view.ViewTreeObserver$OnGlobalLayoutListener)' in class android.view.ViewTreeObserver
[2014-04-28 08:10:14 - myProject] You should check if you need to specify additional program jars.
[2014-04-28 08:10:14 - myProject] Warning: there were 5 unresolved references to classes or interfaces.
[2014-04-28 08:10:14 - myProject] You may need to specify additional library jars (using '-libraryjars').
[2014-04-28 08:10:14 - myProject] Warning: there were 9 unresolved references to program class members.
[2014-04-28 08:10:14 - myProject] Your input classes appear to be inconsistent.
[2014-04-28 08:10:14 - myProject] You may need to recompile them and try again.
[2014-04-28 08:10:14 - myProject] Alternatively, you may have to specify the option
[2014-04-28 08:10:14 - myProject] '-dontskipnonpubliclibraryclassmembers'.
[2014-04-28 08:10:14 - myProject] java.io.IOException: Please correct the above warnings first.
[2014-04-28 08:10:14 - myProject] at proguard.Initializer.execute(Initializer.java:321)
[2014-04-28 08:10:14 - myProject] at proguard.ProGuard.initialize(ProGuard.java:211)
[2014-04-28 08:10:14 - myProject] at proguard.ProGuard.execute(ProGuard.java:86)
[2014-04-28 08:10:14 - myProject] at proguard.ProGuard.main(ProGuard.java:492)
万分感谢!
答案 0 :(得分:0)
您也应该添加android specific configuration。
从链接复制:
-injars bin/classes
-injars libs
-outjars bin/classes-processed.jar
-libraryjars /usr/local/java/android-sdk/platforms/android-9/android.jar
-dontpreverify
-repackageclasses ''
-allowaccessmodification
-optimizations !code/simplification/arithmetic
-keepattributes *Annotation*
-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.view.View {
public <init>(android.content.Context);
public <init>(android.content.Context, android.util.AttributeSet);
public <init>(android.content.Context, android.util.AttributeSet, int);
public void set*(...);
}
-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.content.Context {
public void *(android.view.View);
public void *(android.view.MenuItem);
}
-keepclassmembers class * implements android.os.Parcelable {
static ** CREATOR;
}
-keepclassmembers class **.R$* {
public static <fields>;
}
-keepclassmembers class * {
@android.webkit.JavascriptInterface <methods>;
}