2017-02-28 12 views
0

가방 속의 모든 트릭을 시도했지만 빠진 것이 무엇인지 알아낼 수 없습니다. 디버그 빌드가 잘 실행되지만 릴리스 빌드는 시작하자마자 실패합니다.프로 가드 사용 후 APK 충돌이 발생했습니다.

"예외 원인 : java.lang.IllegalStateException : 잘못된 UTF-16 코드 포인트"가 충돌을 일으키는 것이지만 디버그 빌드에서 어떻게 작동합니까? 그게 나를 괴롭힌다.

예, 여기 대부분의 질문을 통과했지만 아무도 내 문제를 해결하지 못하는 것 같습니다. 37 : 53.298 11467-11467/

4월 2일에서 28일까지 - 여기

는 ADB에서 충돌 로그입니다 .. 여기에 도움이 기쁘게 할 수있는 전문 지식을 가진 사람을 요청? E/A : E --- 아래 키

          at javax.crypto.SecretKeyFactory.generateSecret(SecretKeyFactory.java:474) 
              at com.sample.android.database.a.a(SourceFile:67) 
              at com.sample.android.database.a.a(SourceFile:53) 
              at com.sample.android.database.a.a(SourceFile:88) 
              at com.sample.android.e.c.n(SourceFile:1110) 
              at com.sample.android.e.c.b(SourceFile:1105) 
              at com.sample.android.database.a.a.c.a(SourceFile:52) 
              at com.sample.android.c.a.a(SourceFile:83) 
              at com.sample.android.database.a.a(SourceFile:71) 
              at com.sample.android.database.a.a(SourceFile:53) 
              at com.sample.android.database.a.a(SourceFile:88) 
              at com.sample.android.e.c.n(SourceFile:1110) 
              at com.sample.android.e.c.b(SourceFile:1105) 
              at com.sample.android.database.a.a(SourceFile:53) 
02-28 04:37:53.299 11467-11467/? E/a:  at com.sample.android.database.a.a(SourceFile:88) 
              at com.sample.android.e.c.n(SourceFile:1110) 
              at com.sample.android.e.c.b(SourceFile:1105) 
              at com.sample.android.database.a.a.c.a(SourceFile:52) 
              at com.sample.android.c.a.a(SourceFile:83) 
              at com.sample.android.database.a.a(SourceFile:71) 
              at com.sample.android.database.a.a(SourceFile:53) 
              at com.sample.android.database.a.a(SourceFile:88) 
              at com.sample.android.e.c.n(SourceFile:1110) 
              at com.sample.android.e.c.b(SourceFile:1105) 
              at com.sample.android.database.a.a.c.a(SourceFile:52) 
              at com.sample.android.c.a.a(SourceFile:83) 
              at com.sample.android.database.a.a(SourceFile:71) 
              at com.sample.android.database.a.a(SourceFile:53) 
              at com.sample.android.database.a.a(SourceFile:88) 
02-28 04:37:53.299 11467-11467/? E/a:  at com.sample.android.database.a.a(SourceFile:71) 
              at com.sample.android.database.a.a(SourceFile:53) 
              at com.sample.android.database.a.a(SourceFile:88) 
              at com.sample.android.e.c.n(SourceFile:1110) 
              at com.sample.android.e.c.b(SourceFile:1105) 
              at com.sample.android.database.a.a.c.a(SourceFile:52) 
              at com.sample.android.c.a.a(SourceFile:83) 
02-28 04:37:53.299 11467-11467/? E/a:  at com.sample.android.database.a.a.c.a(SourceFile:52) 
              at com.sample.android.c.a.a(SourceFile:83) 
              at com.sample.android.database.a.a(SourceFile:71) 
              at com.sample.android.database.a.a(SourceFile:53) 
              at com.sample.android.database.a.a(SourceFile:88) 
              at com.sample.android.e.c.n(SourceFile:1110) 
              at com.sample.android.e.c.b(SourceFile:1105) 
              at com.sample.android.database.a.a.c.a(SourceFile:52) 
              at com.sample.android.c.a.a(SourceFile:83) 
              at com.sample.android.Applicationsample.attachBaseContext(SourceFile:108) 
              at android.app.Application.attach(Application.java:189) 
02-28 04:37:53.300 11467-11467/? E/a:  at android.app.Instrumentation.newApplication(Instrumentation.java:1008) 
              at android.app.Instrumentation.newApplication(Instrumentation.java:992) 
              at android.app.LoadedApk.makeApplication(LoadedApk.java:796) 
              at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5377) 
              at android.app.ActivityThread.-wrap2(ActivityThread.java) 
              at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1545) 
              at android.os.Handler.dispatchMessage(Handler.java:102) 
              at android.os.Looper.loop(Looper.java:154) 
              at android.app.ActivityThread.main(ActivityThread.java:6119) 
              at java.lang.reflect.Method.invoke(Native Method) 
              at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886) 
              at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776) 
             java.security.spec.InvalidKeySpecException: Could not generate secret key 
              at javax.crypto.SecretKeyFactory.generateSecret(SecretKeyFactory.java:474) 
              at com.sample.android.database.a.a(SourceFile:67) 
              at com.sample.android.database.a.a(SourceFile:53) 
              at com.sample.android.database.a.a(SourceFile:88) 
              at com.sample.android.e.c.n(SourceFile:1110) 
              at com.sample.android.e.c.b(SourceFile:1105) 
              at com.sample.android.database.a.a.c.a(SourceFile:52) 
              at com.sample.android.c.a.a(SourceFile:83) 
              at com.sample.android.database.a.a(SourceFile:71) 
              at com.sample.android.database.a.a(SourceFile:53) 
              at com.sample.android.database.a.a(SourceFile:88) 
              at com.sample.android.e.c.n(SourceFile:1110) 
              at com.sample.android.e.c.b(SourceFile:1105) 
02-28 04:37:53.304 11467-11467/? E/a:  at com.sample.android.database.a.a.c.a(SourceFile:52) 
              at com.sample.android.c.a.a(SourceFile:83) 
              at com.sample.android.database.a.a(SourceFile:71) 
              at com.sample.android.database.a.a(SourceFile:53) 
              at com.sample.android.database.a.a(SourceFile:88) 
              at com.sample.android.e.c.n(SourceFile:1110) 
              at com.sample.android.database.a.a.c.a(SourceFile:52) 
              at com.sample.android.c.a.a(SourceFile:32) 
              at com.sample.android.Applicationsample.attachBaseContext(SourceFile:108) 
              at android.app.Application.attach(Application.java:189) 
              at android.app.Instrumentation.newApplication(Instrumentation.java:1008) 
              at android.app.Instrumentation.newApplication(Instrumentation.java:992) 
              at android.app.LoadedApk.makeApplication(LoadedApk.java:796) 
              at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5377) 
              at android.app.ActivityThread.-wrap2(ActivityThread.java) 
              at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1545) 
              at android.os.Handler.dispatchMessage(Handler.java:102) 
              at android.os.Looper.loop(Looper.java:154) 
              at android.app.ActivityThread.main(ActivityThread.java:6119) 
              at java.lang.reflect.Method.invoke(Native Method) 
              at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886) 
              at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776) 
             Caused by: java.lang.IllegalStateException: invalid UTF-16 codepoint 
              at com.android.org.bouncycastle.util.Strings.toUTF8ByteArray(Strings.java:177) 
              at com.android.org.bouncycastle.util.Strings.toUTF8ByteArray(Strings.java:132) 
              at com.android.org.bouncycastle.crypto.PBEParametersGenerator.PKCS5PasswordToUTF8Bytes(PBEParametersGenerator.java:135) 
              at com.android.org.bouncycastle.jcajce.provider.symmetric.util.PBE$Util.convertPassword(PBE.java:438) 
              at com.android.org.bouncycastle.jcajce.provider.symmetric.util.PBE$Util.makePBEMacParameters(PBE.java:349) 
              at com.android.org.bouncycastle.jcajce.provider.digest.SHA1$BasePBKDF2WithHmacSHA1.engineGenerateSecret(SHA1.java:141) 
              at javax.crypto.SecretKeyFactory.generateSecret(SecretKeyFactory.java:463) 
              ... 826 more 
02-28 04:37:53.324 11467-11467/? D/AndroidRuntime: Shutting down VM 


                --------- beginning of crash 
02-28 04:37:53.331 11467-11467/? E/AndroidRuntime: FATAL EXCEPTION: main 
                Process: com.sample.android, PID: 11467 
                java.lang.RuntimeException: Unable to instantiate application com.sample.android.Applicationsample: java.lang.NullPointerException: Attempt to get length of null array 
                 at android.app.LoadedApk.makeApplication(LoadedApk.java:802) 
                 at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5377) 
                 at android.app.ActivityThread.-wrap2(ActivityThread.java) 
                 at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1545) 
                 at android.os.Handler.dispatchMessage(Handler.java:102) 
                 at android.os.Looper.loop(Looper.java:154) 
                 at android.app.ActivityThread.main(ActivityThread.java:6119) 
                 at java.lang.reflect.Method.invoke(Native Method) 
                 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886) 
                 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776) 
                Caused by: java.lang.NullPointerException: Attempt to get length of null array 
                 at android.util.Base64.encode(Base64.java:494) 
                 at android.util.Base64.encodeToString(Base64.java:456) 
                 at com.sample.android.database.a.a(SourceFile:87) 
                 at com.sample.android.e.c.n(SourceFile:1110) 
                 at com.sample.android.e.c.b(SourceFile:1105) 
                 at com.sample.android.database.a.a.c.a(SourceFile:52) 
                 at com.sample.android.c.a.a(SourceFile:83) 
                 at com.sample.android.database.a.a(SourceFile:88) 
                 at com.sample.android.e.c.n(SourceFile:1110) 
                 at com.sample.android.e.c.b(SourceFile:1105) 
                 at com.sample.android.database.a.a.c.a(SourceFile:52) 
                 at com.sample.android.c.a.a(SourceFile:83) 
                 at com.sample.android.database.a.a(SourceFile:71) 
                 at com.sample.android.database.a.a(SourceFile:53) 
                 at com.sample.android.database.a.a(SourceFile:88) 
                 at com.sample.android.e.c.n(SourceFile:1110) 
                 at com.sample.android.e.c.b(SourceFile:1105) 
                 at com.sample.android.database.a.a.c.a(SourceFile:52) 
                 at com.sample.android.c.a.a(SourceFile:32) 
                 at com.sample.android.Applicationsample.attachBaseContext(SourceFile:108) 
                 at android.app.Application.attach(Application.java:189) 
                 at android.app.Instrumentation.newApplication(Instrumentation.java:1008) 
                 at android.app.Instrumentation.newApplication(Instrumentation.java:992) 
                 at android.app.LoadedApk.makeApplication(LoadedApk.java:796) 
                 ... 9 more 
02-28 04:37:53.349 11467-11467/? D/Error: ERR: exClass=java.lang.NullPointerException 
02-28 04:37:53.349 11467-11467/? D/Error: ERR: exMsg=Attempt to get length of null array 
02-28 04:37:53.349 11467-11467/? D/Error: ERR: file=Base64.java 
02-28 04:37:53.349 11467-11467/? D/Error: ERR: class=android.util.Base64 
02-28 04:37:53.349 11467-11467/? D/Error: ERR: method=encode line=494 
02-28 04:37:53.349 11467-11467/? D/Error: ERR: stack=java.lang.RuntimeException: Unable to instantiate application com.sample.android.Applicationsample: java.lang.NullPointerException: Attempt to get length of null array 
               at android.app.LoadedApk.makeApplication(LoadedApk.java:802) 
               at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5377) 
               at android.app.ActivityThread.-wrap2(ActivityThread.java) 
               at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1545) 
               at android.os.Handler.dispatchMessage(Handler.java:102) 
               at android.os.Looper.loop(Looper.java:154) 
               at android.app.ActivityThread.main(ActivityThread.java:6119) 
               at java.lang.reflect.Method.invoke(Native Method) 
               at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886) 
               at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776) 
              Caused by: java.lang.NullPointerException: Attempt to get length of null array 
               at android.util.Base64.encode(Base64.java:494) 
               at android.util.Base64.encodeToString(Base64.java:456) 
               at com.sample.android.database.a.a(SourceFile:87) 
               at com.sample.android.e.c.n(SourceFile:1110) 
               at com.sample.android.e.c.b(SourceFile:1105) 
               at com.sample.android.database.a.a.c.a(SourceFile:52) 
               at com.sample.android.c.a.a(SourceFile:83) 
               at com.sample.android.database.a.a(SourceFile:71) 
               at com.sample.android.database.a.a(SourceFile:53) 
               at com.sample.android.e.c.n(SourceFile:1110) 
               at com.sample.android.e.c.b(SourceFile:1105) 
               at com.sample.android.database.a.a.c.a(SourceFile:52) 
               at com.sample.android.c.a.a(SourceFile:83) 
               at com.sample.android.database.a.a(SourceFile:71) 
               at com.sample.android.database.a.a(SourceFile:53) 
               at com.sample.android.database.a.a(SourceFile:88) 
               at com.sample.android.e.c.n(SourceFile:1110) 
               at com.sample.android.e.c.b(SourceFile:1105) 
               at com.sample.android.database.a.a.c.a(SourceFile:52) 
               at com.sample.android.c.a.a(SourceFile:83) 
              at c 
02-28 04:37:53.349 11467-11467/? D/Error: ERR: TOTAL BYTES WRITTEN: 41256 
02-28 04:37:53.350 902-20335/? W/ActivityManager: Force finishing activity com.sample.android/.activities.Activitysample 

를 생성에 --- 예기치 않은 오류가 난독 파일입니다 - "proguard-rules.pro"-

-optimizationpasses 5 
-dontusemixedcaseclassnames 
-dontskipnonpubliclibraryclasses 
-dontskipnonpubliclibraryclassmembers 
-dontpreverify 
-verbose 
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*,!code/allocation/variable 

-keep public class * extends android.app.Activity 
-keep public class * extends android.app.Application 

-dontwarn javax.annotation.** 

-dontwarn android.app.** 
-dontwarn android.support.** 
-dontwarn android.view.** 
-dontwarn android.widget.** 

-dontwarn com.google.common.primitives.** 

-dontwarn **CompatHoneycomb 
-dontwarn **CompatHoneycombMR2 
-dontwarn **CompatCreatorHoneycombMR2 

-keepclasseswithmembernames class * { 
    native <methods>; 
} 

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

-keepclassmembers class **.R$* { 
    public static <fields>; 
} 

-keep class net.sqlcipher.** { 
    *; 
} 

-keepclassmembers class * implements java.io.Serializable { 
    static final long serialVersionUID; 
    private static final java.io.ObjectStreamField[] serialPersistentFields; 
    private void writeObject(java.io.ObjectOutputStream); 
    private void readObject(java.io.ObjectInputStream); 
    java.lang.Object writeReplace(); 
    java.lang.Object readResolve(); 
} 

-keepparameternames 
-renamesourcefileattribute SourceFile 
-keepattributes Exceptions,InnerClasses,Signature,Deprecated, SourceFile,LineNumberTable,*Annotation*,EnclosingMethod 

# Preserve all native method names and the names of their classes. 
-keepclasseswithmembernames class * { 
    native <methods>; 
} 

-keep public class javax.crypto.spec.** { 
    public protected *; 
} 

# Class names are needed in reflection 
-keepnames class com.amazonaws.** 
# Request handlers defined in request.handlers 
-keep class com.amazonaws.services.**.*Handler 
# The following are referenced but aren't required to run 
-dontwarn com.fasterxml.jackson.** 
-dontwarn org.apache.commons.logging.** 
# Android 6.0 release removes support for the Apache HTTP client 
-dontwarn org.apache.http.** 
# The SDK has several references of Apache HTTP client 
-dontwarn com.amazonaws.http.** 
-dontwarn com.amazonaws.metrics.** 

    enter code here 
+0

그리고 이것은 Android N 7.1.1에서 발생합니다. – opensourced101

답변

0

은 이러한 라인을 추가하려면 Proguard 파일

#### -- Sql Cipher -- 
-keep class net.sqlcipher.** { 
    *; 
} 

-keep class net.sqlcipher.database.** { 
    *; 
}