2013-07-08 1 views
1

, 나는 예외로 실행하고 있습니다 : 나는 그러나 내 코드를 난독 때 디버그 모드에서 코드를 실행하면잭슨과 내 안드로이드 응용 프로그램에서 ProGuard에서

java.lang.IllegalStateException: Conflicting property name definitions: 
    'keywords' (for [field com.myapp.d.q#a]) vs 'download_urls' 
    (for [method com.myapp.d.q#a(1 params)]) 

, 나는이 예외로 실행되지 않습니다. 그래서 여기에 몇 가지 답변을 읽고 파일을 proguard.cfg 많은 편집을 만들어이는 모습입니다 :

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

-dontwarn org.w3c.dom.bootstrap.DOMImplementationRegistry 
-dontwarn android.text.* 
-dontwarn org.apache.commons.* 
-dontwarn org.scribe.services.* 
-dontwarn com.fasterxml.jackson.databind.** 

# Activities, services and broadcast receivers are specified in the manifest file so they won't be automatically included 
-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 
-keep public class com.crittercism.** 

# Hold onto the mapping.text file, it can be used to unobfuscate stack traces in the developer console using the retrace tool 
-printmapping mapping.txt 

# Keep line numbers so they appear in the stack trace of the developer console 
-keepattributes SourceFile,LineNumberTable,*Annotation*,EnclosingMethod,Signature 

-keepclasseswithmembernames class * { 
    native <methods>; 
} 

-keepclasseswithmembers class * { 
    public <init>(android.content.Context, android.util.AttributeSet); 
} 

# Custom view components might be accessed from your layout files 
-keepclasseswithmembers class * { 
    public <init>(android.content.Context, android.util.AttributeSet, int); 
} 

# event handlers can be specified in the layout files e.g. android:onClick="nextButton_onClick" 
-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 public class com.crittercism.* { 
    *; 
} 

-keepnames class com.fasterxml.jackson.** { 
    *; 
} 

아직 내가이 문제를 과거 얻을 수 없습니다. 여기서 내가 뭘 잘못하고 있니? 나는 잭슨 2.1.2 단지를 사용하고있다

+1

이 링크를 사용하십시오 .http : //proguard.sourceforge.net/index.html#manual/examples.html –

+0

@ZalaJanaksinh 예 전 게시하기 전에 예제를 참조했지만 결정적 해결책을 찾지 못했습니다. –

답변

0

POJO에서 jsonignoreproperties을 지정하는 것뿐만 아니라 '빈 클래스 처리'에서 언급 한 것을 포함하도록 프로 우드 구성을 수정하는 조합은 내가 오류를 지나쳐서 난독 화가있는 APK.

+0

나는 이것을 사용하고있는 라이브러리에서 실행 중이다. Proguard에게 Jackson을 사용하는 클래스를 무시하도록 말함으로써이 문제를 해결할 수 있습니까? –

0

먼저 예외 정보가 명확하지 않은 경우 Retrace 도구와 Proguard를 사용하여 원래 이름의 메시지를 읽습니다. 그리고 예외 메시지를 다시 게시하십시오.