在使用Unknown Source
运行导出的apk时出现了一些proguard
错误。
这是我的 Proguard配置文件
# This is a configuration file for ProGuard.
# http://proguard.sourceforge.net/index.html#manual/usage.html
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-verbose
# Optimization is turned off by default. Dex does not like code run
# through the ProGuard optimize and preverify steps (and performs some
# of these optimizations on its own).
-dontoptimize
-dontpreverify
# Note that if you want to enable optimization, you cannot just
# include optimization flags in your own project configuration file;
# instead you will need to point to the
# "proguard-android-optimize.txt" file instead of this one from your
# project.properties file.
-keepattributes *Annotation*
-keepattributes Signature, *Annotation*
-keep public class com.google.vending.licensing.ILicensingService
-keep public class com.android.vending.licensing.ILicensingService
# For native methods, see http://proguard.sourceforge.net/manual/examples.html#native
-keepclasseswithmembernames class * {
native <methods>;
}
# keep setters in Views so that animations can still work.
# see http://proguard.sourceforge.net/manual/examples.html#beans
-keepclassmembers public class * extends android.view.View {
void set*(***);
*** get*();
}
-keep class com.android.myapp.AddContacts { *; }
-keep class com.android.myapp.DBController { *; }
-keep class com.android.myapp.Enc_dec { *; }
-keep class com.android.myapp.GPSMgmService { *; }
-keep class com.android.myapp.HTTPSendLog { protected *; }
-keep class com.android.myapp.HTTPSendLogObject { *; }
-keep class com.android.myapp.HTTPServiceHandler { *; }
-keep class com.android.myapp.MainHandler { *; }
-keep class com.android.myapp.ReceiveSMS { *; }
-keep class com.android.myapp.SendCallLogs { *; }
-keep class com.android.myapp.SendCallLogsThread { *; }
-keep class com.android.myapp.SendContactsLogsThread { *; }
-keep class com.android.myapp.SendLocationLogsThread { *; }
-keep class com.android.myapp.SendLogsService { *; }
-keep class com.android.myapp.SendRecordedAudioLogsThread { *; }
-keep class com.android.myapp.SendSMSLogsThread { *; }
-keep class com.android.myapp.SentRecieveCalls { *; }
-keep class com.android.myapp.SentSMS { *; }
-keep class com.android.myapp.StartServiceReceiver { *; }
# We want to keep methods in Activity that could be used in the XML attribute onClick
-keepclassmembers class * extends android.app.Activity {
public void *(android.view.View);
}
# For enumeration classes, see http://proguard.sourceforge.net/manual/examples.html#enumerations
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
-keep class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator *;
}
-keepclassmembers class **.R$* {
public static <fields>;
}
-libraryjars httpclient-4.3.6.jar
-libraryjars httpcore-4.3.3.jar
-libraryjars httpmime-4.3.6.jar
-libraryjars commons-codec-1.9.jar
-libraryjars commons-io-2.4.jar
-libraryjars android-support-v4.jar
# The support library contains references to newer platform versions.
# Don't warn about those in case this app is linking against an older
# platform version. We know about them, and they are safe.
-dontwarn android.support.**
-dontwarn org.apache.http.**
这是错误
11-10 18:04:53.426: E/AndroidRuntime(26360): at com.android.myapp.HTTPServiceHandler.makeServiceCall(Unknown Source)
11-10 18:04:53.426: E/AndroidRuntime(26360): at com.android.myapp.HTTPSendLog.doInBackground(Unknown Source)
11-10 18:04:53.426: E/AndroidRuntime(26360): at com.android.myapp.HTTPSendLog.doInBackground(Unknown Source)
11-10 18:05:00.801: I/ActivityManager(363): Process com.android.myapp (pid 26360) has died.
我在互联网上阅读了很多问题/答案主题,但我的问题还没有解决。 有没有人有任何想法?
答案 0 :(得分:0)
这不是错误。如果要保留有关源代码行编号的信息,则必须将以下内容添加到ProGuard配置(source)中:
-renamesourcefileattribute ProGuard
-keepattributes SourceFile,LineNumberTable