我的项目在 android 设备和模拟器上运行良好。
但是,如果我在启用 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
请分享您的想法。
谢谢你。