2016-06-02 3 views
0

프로 가이드가 내 애플리케이션 코드를 난독 화했습니다. 특히, 나는 단지 응용 프로그램의 활동을 모호하게 할 것이지만 APK를 만들 때 많은 실수를 범합니다. 이 오류는 라이브러리에 부과 된 프로 가드가 true 인 경우에도 발생합니다. 누구든지 나를 도울 수 있습니까?Android 스튜디오 프로 가드 오류

apply plugin: 'com.android.application'  

android {   
    compileSdkVersion 23 
    buildToolsVersion "23.0.2" 
    defaultConfig { 
     applicationId "my.packname" 
     minSdkVersion 16 
     targetSdkVersion 23 
     versionCode 52 
     versionName "2.0.2" 
    } 
    buildTypes { 
     release { 
      minifyEnabled true 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
} 

dependencies { 
    compile fileTree(include: ['*.jar'], dir: 'libs') 
    compile files('libs/commons-codec-1.8.jar') 
    compile files('libs/dropbox-android-sdk-1.6.3.jar') 
    compile files('libs/httpmime-4.0.3.jar') 
    compile files('libs/json_simple-1.1.jar') 
    compile files('libs/pass-v1.2.1.jar') 
    compile files('libs/sdk-v1.0.0.jar')  
    compile project(':library_edittext') 
    compile project(':aFileChooser') 
    compile project(':library_color_picker') 
    compile project(':sqlcipher-for-android') 
    compile project(':library_menu_main') 
    compile 'io.reactivex:rxjava:1.0.10'  
    compile 'com.android.support:appcompat-v7:23.1.1' 
    compile 'com.android.support:support-v4:23.1.1' 
    compile 'com.android.support:design:23.1.1' 
} 

오류 : 오류 메시지가 제안

Warning:there were 87 unresolved references to classes or interfaces. 
     You may need to add missing library jars or update their versions. 
     If your code works fine without the missing classes, you can suppress 
     the warnings with '-dontwarn' options. 
     (http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedclass) 
Warning:Exception while processing task java.io.IOException: Please correct the above warnings first. 
:app:transformClassesAndResourcesWithProguardForRelease FAILED 
Error:Execution failed for task ':app:transformClassesAndResourcesWithProguardForRelease'. 
> java.io.IOException: Please correct the above warnings first. 

    Error:Execution failed for task ':app:transformClassesAndResourcesWithProguardForRelease'. 
    > java.io.IOException: Please correct the above warnings first. 

답변

2

으로 앱을 확인 실행중인 경우, 당신은 당신의 난독 화 파일 등을 --dontwarn 사용할 수 있습니다. 이와 같이 :

-dontwarn android.support.** 
-dontnote android.support.** 

문제가있는 경우 그 이유를 조금 알아봐야합니다. 이 최적화하는 방법을 예를 들어

, 등

-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*,!code/allocation/variable 

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

여기에 안드로이드 참조입니다 : https://developer.android.com/studio/build/shrink-code.html

많은 도서관은 또한 가장 도움이 자신의 라이브러리에 대한 난독 정보를 가지고가.

관련 문제