Java Proguard在尝试用相机发送图片时崩溃应用程序

Java Proguard在尝试用相机发送图片时崩溃应用程序,java,android,proguard,apk,gae-eclipse-plugin,Java,Android,Proguard,Apk,Gae Eclipse Plugin,我的应用程序经过测试,运行良好。但当我尝试测试一个发布版apk时,它崩溃了。我包括了我的proguard文件和测试版本apk时得到的错误日志。基本上,当我通过intent拍摄照片,然后试图通过互联网将照片发送给收件人时,它就会崩溃。同样,我的应用程序运行良好:直到proguard加入其中 注: 发送映像的代码是由线程启动的Runnable,如新线程(Runnable).start();非常基本的东西。同样,该代码在proguard之外工作 我的project.properties文件使用默认的a

我的应用程序经过测试,运行良好。但当我尝试测试一个发布版apk时,它崩溃了。我包括了我的proguard文件和测试版本apk时得到的错误日志。基本上,当我通过intent拍摄照片,然后试图通过互联网将照片发送给收件人时,它就会崩溃。同样,我的应用程序运行良好:直到proguard加入其中

注:

发送映像的代码是由
线程启动的
Runnable
,如
新线程(Runnable).start()
;非常基本的东西。同样,该代码在proguard之外工作

我的
project.properties
文件使用默认的android文件和我的

android 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*
-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*();
}

# 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>;
}

# 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.**
# My addition

-keepclassmembers class com.mycompany.mygame.** {
    public static <fields>;
}

# -keep public class com.mycompany.mygame.** { *; }
-dontwarn com.mycompany.mygame.**

# -keep public class android.support.** { *; }
-dontwarn android.support.**

# -keep public class com.google.android.gms.** { *; }
-dontwarn com.google.android.gms.**

# -keep public class com.google.common.** { *; }
-dontwarn com.google.common.**

# -keep public class org.apache.commons.** { *; }
-dontwarn org.apache.commons.**

# -keep public class org.apache.http.impl.** { *; }
-dontwarn org.apache.http.impl.**

# -keep public class android.net.http.AndroidHttpClient { *; }
-dontwarn android.net.http.AndroidHttpClient
#这是ProGuard的配置文件。
# http://proguard.sourceforge.net/index.html#manual/usage.html
-dontusemixedcaseclassnames
-DontskipnonPublicLibraryClass
-冗长的
#默认情况下,优化处于关闭状态。Dex不喜欢代码运行
#通过ProGuard优化和预验证步骤(并执行一些
#这些优化的一部分)。
-dontoptimize
-不要翻转
#请注意,如果要启用优化,则不能
#在您自己的项目配置文件中包含优化标志;
#相反,您需要指向
#“proguard android optimize.txt”文件,而不是您的
#project.properties文件。
-keepattributes*注释*
-保持公共类com.google.vending.licensing.ILicensingService
-保持公共类com.android.vending.licensing.ILicensingService
#有关本机方法,请参见http://proguard.sourceforge.net/manual/examples.html#native
-KeepClassSwithMemberNames类*{
本地人;
}
#在视图中保留setter,以便动画仍然可以工作。
#看http://proguard.sourceforge.net/manual/examples.html#beans
-keepclassmembers公共类*扩展了android.view.view{
无效集*(***);
***得到*();
}
#我们希望在活动中保留可以在XML属性onClick中使用的方法
-keepclassmembers类*扩展了android.app.Activity{
public void*(android.view.view);
}
#有关枚举类,请参见http://proguard.sourceforge.net/manual/examples.html#enumerations
-keepclassmembers枚举*{
公共静态**[]值();
公共静态**valueOf(java.lang.String);
}
-keep class*实现android.os.Parcelable{
公开静态最终android.os.Parcelable$Creator*;
}
-keepclassmembers类**.R$*{
公共静态;
}
#支持库包含对较新平台版本的引用。
#如果此应用程序链接的是较旧的应用程序,请不要警告这些问题
#平台版本。我们知道他们,他们是安全的。
-dontwarn android.support**
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*
-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*();
}

# 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>;
}

# 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.**
# My addition

-keepclassmembers class com.mycompany.mygame.** {
    public static <fields>;
}

# -keep public class com.mycompany.mygame.** { *; }
-dontwarn com.mycompany.mygame.**

# -keep public class android.support.** { *; }
-dontwarn android.support.**

# -keep public class com.google.android.gms.** { *; }
-dontwarn com.google.android.gms.**

# -keep public class com.google.common.** { *; }
-dontwarn com.google.common.**

# -keep public class org.apache.commons.** { *; }
-dontwarn org.apache.commons.**

# -keep public class org.apache.http.impl.** { *; }
-dontwarn org.apache.http.impl.**

# -keep public class android.net.http.AndroidHttpClient { *; }
-dontwarn android.net.http.AndroidHttpClient
#我的添加
-keepclassmembers类com.mycompany.mygame.*{
公共静态;
}
#-保持公共类com.mycompany.mygame.*{*;}
-dontwarn com.mycompany.mygame**
#-保留公共类android.support.*{*;}
-dontwarn android.support**
#-保持公共类com.google.android.gms.*{*;}
-dontwarn com.google.android.gms**
#-保持公共类com.google.common.*{*;}
-dontwarn com.google.common**
#-保持公共类org.apache.commons.*{*;}
-dontwarn org.apache.commons**
#-保持公共类org.apache.http.impl.*{*;}
-dontwarn org.apache.http.impl**
#-保留公共类android.net.http.AndroidHttpClient{*;}
-dontwarn android.net.http.AndroidHttpClient
错误日志:

05-03 17:40:45.704: E/CameraApp(5068): [SoundController.java:468:onDestroy()] onDestroy-end, sound_pool release 2/2
05-03 17:40:52.829: E/AndroidRuntime(5327): FATAL EXCEPTION: Thread-514
05-03 17:40:52.829: E/AndroidRuntime(5327): xb: The chosen LogFactory implementation does not extend LogFactory. Please check your configuration. (Caused by java.lang.ClassCastException: The application has specified that a custom LogFactory implementation should be used but Class 'org.apache.commons.logging.impl.LogFactoryImpl' cannot be converted to 'xc'. Please check the custom implementation. Help can be found @http://commons.apache.org/logging/troubleshooting.html.)
05-03 17:40:52.829: E/AndroidRuntime(5327):     at xc.a(Unknown Source)
05-03 17:40:52.829: E/AndroidRuntime(5327):     at xe.run(Unknown Source)
05-03 17:40:52.829: E/AndroidRuntime(5327):     at java.security.AccessController.doPrivileged(AccessController.java:45)
05-03 17:40:52.829: E/AndroidRuntime(5327):     at xc.a(Unknown Source)
05-03 17:40:52.829: E/AndroidRuntime(5327):     at xc.a(Unknown Source)
05-03 17:40:52.829: E/AndroidRuntime(5327):     at xc.b(Unknown Source)
05-03 17:40:52.829: E/AndroidRuntime(5327):     at afj.<init>(Unknown Source)
05-03 17:40:52.829: E/AndroidRuntime(5327):     at afr.<init>(Unknown Source)
05-03 17:40:52.829: E/AndroidRuntime(5327):     at gu.a(Unknown Source)
05-03 17:40:52.829: E/AndroidRuntime(5327):     at ha.a(Unknown Source)
05-03 17:40:52.829: E/AndroidRuntime(5327):     at ha.run(Unknown Source)
05-03 17:40:52.829: E/AndroidRuntime(5327):     at java.lang.Thread.run(Thread.java:856)
05-03 17:40:52.829: E/AndroidRuntime(5327): Caused by: java.lang.ClassCastException: The application has specified that a custom LogFactory implementation should be used but Class 'org.apache.commons.logging.impl.LogFactoryImpl' cannot be converted to 'xc'. Please check the custom implementation. Help can be found @http://commons.apache.org/logging/troubleshooting.html.
05-03 17:40:52.829: E/AndroidRuntime(5327):     ... 12 more
05-03 17:41:13.829: E/Trace(5606): error opening trace file: No such file or directory (2)
05-03 17:40:45.704:E/CameraApp(5068):[SoundController.java:468:onDestroy()]onDestroy结束,声音池版本2/2
05-03 17:40:52.829:E/AndroidRuntime(5327):致命异常:线程514
05-03 17:40:52.829:E/AndroidRuntime(5327):xb:所选的LogFactory实现不扩展LogFactory。请检查您的配置。(由java.lang.ClassCastException引起:应用程序已指定应使用自定义LogFactory实现,但类“org.apache.commons.logging.impl.LogFactoryImpl”无法转换为“xc”。请检查自定义实现。可以找到帮助@http://commons.apache.org/logging/troubleshooting.html.)
05-03 17:40:52.829:E/AndroidRuntime(5327):在xc.a(未知来源)
05-03 17:40:52.829:E/AndroidRuntime(5327):在xe运行时(未知源)
05-03 17:40:52.829:E/AndroidRuntime(5327):位于java.security.AccessController.doPrivileged(AccessController.java:45)
05-03 17:40:52.829:E/AndroidRuntime(5327):在xc.a(未知来源)
05-03 17:40:52.829:E/AndroidRuntime(5327):在xc.a(未知来源)
05-03 17:40:52.829:E/AndroidRuntime(5327):在xc.b(未知来源)
05-03 17:40:52.829:E/AndroidRuntime(5327):在afj(未知来源)
05-03 17:40:52.829:E/AndroidRuntime(5327):在afr(未知来源)
05-03 17:40:52.829:E/AndroidRuntime(5327):在古阿(未知来源)
05-03 17:40:52.829:E/AndroidRuntime(5327):在ha.a(未知来源)
05-03 17:40:52.829:E/AndroidRuntime(5327):在ha运行时(未知来源)
05-03 17:40:52.829:E/AndroidRuntime(5327):在java.lang.Thread.run(Thread.java:856)处
05-03 17:40:52.829:E/AndroidRuntime(5327):原因:java.lang.ClassCastException:应用程序已指定应使用自定义LogFactory实现,但类“org.apache.commons.logging.impl.LogFactoryImpl”无法转换为“xc”。请检查自定义实现。可以找到帮助@http://commons.apache.org/logging/troubleshooting.html.
05-03 17:40:52.829:E/AndroidRuntime(5327):。。。还有12个
05-03 17:41:13.829:E/Trace(5606):打开跟踪文件时出错:没有这样的文件或目录(2)

指示灯的标志是这条线:

05-03 17:40:52.829: E/AndroidRuntime(5327): Caused by: java.lang.ClassCastException: The application has specified that a custom LogFactory implementation should be used but Class 'org.apache.commons.logging.impl.LogFactoryImpl' cannot be converted to 'xc'. Please check the custom implementation. Help can be found @http://commons.apache.org/logging/troubleshooting.html.
看起来有些Apache日志记录的类已经被Proguard重命名,并且是从您的Proguard配置文件中重命名的

# -keep public class org.apache.commons.** { *; }

标记为注释(前缀为“#”),因此我将删除上面一行中的“#”,从而告诉Proguard不要重命名org.apache.commons包中的类,然后重试。

指示符号是这个li