我的項目在android設備和模擬器上工作正常。當在android中啓用proguard時,應用程序無法正常工作
但是,如果我在導出proguard應用程序後啓用並導出.apk文件,我無法安裝帶有proguard的.apk文件。
我的假設,安裝.apk文件時未調用服務,並且我的日誌中沒有出現任何錯誤。
請分享您的想法。
這是我的proguard文件。
-optimizationpasses 5
-dontskipnonpubliclibraryclasses
-dontskipnonpubliclibraryclassmembers
-dontpreverify
-verbose
-dontoptimize
# -optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
-libraryjars /usr/local/android-sdk/add-ons/google_apis-7_r01/libs/maps.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 * extends android.app.backup.BackupAgentHelper
-keep public class * extends android.preference.Preference
-keep public class com.android.vending.licensing.ILicensingService
-keepattributes JavascriptInterface
-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 *;
}
-keep class mypackage.MyCallbackClass {
void myCallbackMethod(java.lang.String);
}
-dontwarn android.support.**
-dontwarn org.w3c.dom.bootstrap.DOMImplementationRegistry
和我** 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:11
android.library.reference.1=../Library1
android.library.reference.2=../Library2
敬請分享您的想法。
謝謝。
感謝您的回覆文斯。我是通過命令提示符使用「adb uninstall myProject.apk」從設備上卸載應用程序的。但是在啓動頁面時會卡住。現在,我可以查看這個錯誤「!!!失敗的BINDER TRANSACTION !!!」在我的日誌上。 – vinoth 2013-02-11 10:58:23