简体   繁体   English

Android-带签名的APK未运行

[英]Android - Signed apk not running

I am getting strange error while running exported apk using Android Tool in eclipse. 在Eclipse中使用Android工具运行导出的APK时遇到奇怪的错误。 In app i am using parse notification. 在应用程序中,我正在使用解析通知。 While i run app from eclipse all are working file and if I export signed apk app crashes. 当我从Eclipse运行应用程序时,所有文件都在工作,如果我导出签名的APK应用程序崩溃。 Here is logcat code link - Here is logcat 这是logcat代码链接- 这是logcat

I am not able to upload logcat here therefore i share link for it 我无法在此处上传logcat,因此我分享了链接

If I block parse notification code, all going fine,. 如果我阻止解析通知代码,一切正常。 Please help and thanks in advance. 请帮助并提前致谢。

please check this. 请检查一下。

-keepattributes SourceFile,LineNumberTable
-keepnames class com.parse.** { *; }

 # Required for Parse
 -keepattributes *Annotation*
 -keepattributes Signature
 -dontwarn android.net.SSLCertificateSocketFactory
 -dontwarn android.app.Notification
 -dontwarn com.squareup.**
 -dontwarn okio.**

Also add this 也添加这个

   -keep class com.facebook.** { *; }
   -keep class com.parse.** { *; }
   -dontwarn com.parse.**
   -dontnote com.parse.**

Let me know if it did not solve your problem :) 让我知道它是否不能解决您的问题:)

Here is your solution, replace your progaurd code with this on - 这是您的解决方案,在此替换您的progaurd代码-

-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 -optimizationpasss 5 -dontusemixedcase类名-dontskipnonpubliclibraryclasses -dontpreverify -verbose -optimizations!code / simplification / arithmetic,!field /,!class / merging / -keep公共类*扩展android.app.Activity -keep公共类*扩展android.app。应用程序-keep公共类*扩展android.app.Service -keep公共类*扩展android.content.BroadcastReceiver -keep公共类*扩展android.content.ContentProvider -keep公共类*扩展android.app.backup.BackupAgentHelper -keep公共类*扩展android.preference.Preference -keep公共类com.android.vending.licensing.ILicensingService

keep all classes that might be used in XML layouts 保留所有可能在XML布局中使用的类

-keep public class * extends android.view.View -keep public class * extends android.app.Fragment -keep public class * extends android.support.v4.Fragment -keep公共类*扩展android.view.View -keep公共类*扩展android.app.Fragment -keep公共类*扩展android.support.v4.Fragment

keep all public and protected methods that could be used by java reflection 保留所有Java反射可能使用的公共和受保护方法

-keepclassmembernames class * { public protected ; -keepclassmembernames class * {受公共保护; } -keepclasseswithmembernames class * { native ; } -keepclasseswithmembernames类* {本机; } -keepclasseswithmembernames class * { public (android.content.Context, android.util.AttributeSet); } -keepclasseswithmembernames class * {public(android.content.Context,android.util.AttributeSet); } -keepclasseswithmembernames class * { public (android.content.Context, android.util.AttributeSet, int); } -keepclasseswithmembernames class * {public(android.content.Context,android.util.AttributeSet,int); } -keepclassmembers enum * { public static **[] values(); } -keepclassmembers枚举* {public static ** [] values(); public static ** valueOf(java.lang.String); 公共静态** valueOf(java.lang.String); } -keep class * implements android.os.Parcelable { public static final android.os.Parcelable$Creator *; } -keep class *实现android.os.Parcelable {public static final android.os.Parcelable $ Creator *; } }

# Keep source file names, line numbers, and Parse class/method names for easier debugging -keepattributes SourceFile,LineNumberTable -keepnames class com.parse.** { *; #保留源文件名,行号和Parse类/方法名,以便于调试-keepattributes SourceFile,LineNumberTable -keepnames类com.parse。** {* } }

Required for Parse 解析所需

-keepattributes Annotation -dontwarn com.parse.** -dontwarn org.apache.http.** -dontwarn android.support.v4.app.** -dontwarn com.android.volley.** -dontwarn com.activate.gcm.** -dontwarn com.google.android.gms.** -dontwarn org.joda.** -dontwarn com.squareup.picasso.** -keepattributes 注释 -dontwarn com.parse。** -dontwarn org.apache.http。** -dontwarn android.support.v4.app。** -dontwarn com.android.volley。** -dontwarn com.activate.gcm 。** -dontwarn com.google.android.gms。** -dontwarn org.joda。** -dontwarn com.squareup.picasso。**

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM