我正在使用 Drive API 开发一个 android 应用程序。
当我尝试在我的平板电脑或智能手机上测试该应用程序时,它可以工作。现在我必须在 Play Store 上发布我的应用程序,所以我通过 Eclipse 签署了 apk。问题是在此操作之后,apk 不起作用。
起初我遵循了这个教程:Google Drive SDK:在 Android 上编写你的第一个 Drive 应用程序http://www.youtube.com/watch?v=Ied1CjJ0iP0&feature=share
所以我下载,使用 Eclupse 的 Google 插件,Drive API v2 在我的项目的 libs 文件夹中存在 google-play-services.jar
我的 proguard.cfg 是这个 [我创建了这个文件是因为默认版本不工作]:
-printmapping proguard.map
-renamesourcefileattribute ProGuard
-keepattributes SourceFile,LineNumberTable
-optimizationpasses 8
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontpreverify
-dontwarn com.google.android.gms.**
-dontwarn android.support.v4.**
-verbose
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
-libraryjars /libs/google-play-services.jar
-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 com.android.vending.licensing.ILicensingService
-keep class com.google.android.gms.** { *; }
-keep interface com.google.android.gms.** { *; }
-keep class android.support.v4.** { *; }
-keep interface android.support.v4.** { *; }
-keep class org.codehaus.jackson.** { *; }
-keep interface org.codehaus.jackson.** { *; }
-keep class com.google.api.client.json.jackson.** { *; }
-keep interface com.google.api.client.json.jackson.** { *; }
-keep class com.google.api.client.googleapis.** { *; }
-keep interface com.google.api.client.googleapis.** { *; }
-keep class com.google.api.client.auth.** { *; }
-keep interface com.google.api.client.auth.** { *; }
-keep class javax.annotation.** { *; }
-keep interface javax.annotation.** { *; }
-keep class com.google.api.client.** { *; }
-keep interface com.google.api.client.** { *; }
-keep class com.google.api.services.** { *; }
-keep interface com.google.api.services.** { *; }
-keep class org.achartengine.** { *; }
-keep interface org.achartengine.** { *; }
-keep class com.google.api.client.googleapis.extensions.android.** { *; }
-keep interface com.google.api.client.googleapis.extensions.android..** { *; }
-keep class com.google.api.client.json.jackson2.** { *; }
-keep interface com.google.api.client.json.jackson2.** { *; }
-keep class com.google.protobuf.** { *; }
-keep interface com.google.protobuf.** { *; }
-keep class com.google.api.client.extensions.android.** { *; }
-keep interface com.google.api.client.extensions.android.** { *; }
-keep class com.google.api.client.json.gson.** { *; }
-keep interface com.google.api.client.json.gson.** { *; }
-keep class com.google.gson.** { *; }
-keep interface com.google.gson.** { *; }
-keep class com.fasterxml.jackson.core.** { *; }
-keep interface com.fasterxml.jackson.core.** { *; }
-keep class com.claudioilluminati.googleaccountstorage.** { *; }
-keep interface com.claudioilluminati.googleaccountstorage.** { *; }
-keepattributes *Annotation*
-keepclasseswithmembernames class * {
native <methods>;
}
-keepclasseswithmembernames class * {
public <init>(android.content.Context, android.util.AttributeSet);
}
-keepclasseswithmembernames class * {
public <init>(android.content.Context, android.util.AttributeSet, int);
}
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
-keep class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator *;
}
当我在 DDMS 透视图中签入 Eclipse 时,我可以看到这个错误:
The Google Play Services resources were not found.
Check your project configuration to ensure that the resources are included.
我只想补充一点,apk signed 的尺寸比 apk 未签名的要小。
有什么建议吗?
提前致谢
克劳迪奥