Android应用程序在开发手机上安装并运行良好,但在谷歌播放中提供“遗憾的应用已经停止”

时间:2013-12-18 16:40:07

标签: android proguard

好的,所以当我通过USB连接时,我的应用程序安装并在开发过程中在Android手机上正常运行。但是当我部署到制作时,现在每次打开应用程序时它都会给我“遗憾的应用已经停止”。

我已尝试过其他人的建议,我清理了数据和缓存,但这些按钮没有为我禁用。似乎没有要清除的缓存或数据。

我怎样才能找出导致问题的原因?以前有人有这个问题吗?

NEW UPDATE:

so I commented out the 
proguard.cfg as shown in the project.properties and then it worked.  
so there is something wrong in the proguard.cfg 
Can some one see if there is anything obvisous please? 
I am using exactly what urban airship suggested on their sample proguard.cfg

Appreciate all your helps

来自Google Play的日志:

java.lang.RuntimeException: Unable to create application com.rccw.android.MyApplication: 
java.lang.IllegalArgumentException: Application configuration is invalid.
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4828)
at android.app.ActivityThread.access$1300(ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1397)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:155)
at android.app.ActivityThread.main(ActivityThread.java:5454)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1029)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:796)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.IllegalArgumentException: Application configuration is invalid.
at com.urbanairship.m.b(Unknown Source)
at com.urbanairship.m.a(Unknown Source)
at com.redcarpetcarwash.android.MyApplication.onCreate(Unknown Source)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1011)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4825)




Heres my project.properties
# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system edit
# "ant.properties", and override values to adapt the script to your
# project structure.
#
# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):

 proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt

#proguard.config=proguard.cfg

# Project target.
target=Google Inc.:Google APIs:17

enter code here继承人Proguard.cfg

-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

# Suppress warnings if you are NOT using IAP:                                                       
-dontwarn com.urbanairship.iap.**

# Required if you are using Autopilot
-keep public class * extends com.urbanairship.Autopilot

# Required if you are using the airshipconfig.properties file                                       
-keepclasseswithmembers public class * extends com.urbanairship.Options {
    public *;
}

-keepclasseswithmembers class * {
    native <methods>;
}

-keepclasseswithmembers class * {
    public <init>(android.content.Context, android.util.AttributeSet);
}

-keepclasseswithmemberns 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 *;
}

2 个答案:

答案 0 :(得分:2)

这听起来像是来自其他问题configuration is invalid的{​​{1}},这会让我认为您需要检查keysecret key是否正确。

来自Urban Airship crashes at take off. Illegal Argument Exception

airshipconfig.properties

gcmSender = Your Google API Project Number (allows multiple senders separated by commas)
transport = gcm
developmentAppKey = Your Development App Key
developmentAppSecret = Your Development App Secret
productionAppKey = Your Production App Key
productionAppSecret = Your Production App Secret
inProduction = false

确保您的productionAppKeyproductionAppSecret正确无误(可能与您的开发版不同)

答案 1 :(得分:0)

我认为您的ProGuard设置可能会使您正在使用的库绊倒。有关如何设置ProGuard for Urban Airship的信息,请参阅here。值得注意的是,您可能希望至少将此添加到您的Proguard配置中:

# Required if you are using the airshipconfig.properties file                                       
-keepclasseswithmembers public class * extends com.urbanairship.Options {
    public *;
}

或者您没有正确设置密钥,就像在另一个答案中一样。

将来,如果你正在使用ProGuard(你应该这样做),你需要在上传到Google Play之前测试已部署的APK。