0

내 응용 프로그램을 시작하면 내가 경고 및 오류가 많이 있습니다안드로이드 난독 minifyEnabled 진정한 + multidex = 오류

Information:Gradle tasks [:app:assembleDebug] Warning:butterknife.compiler.ButterKnifeProcessor$IdScanner: can't find superclass or interface com.sun.tools.javac.tree.TreeScanner Warning:butterknife.compiler.ButterKnifeProcessor$RClassScanner: can't find superclass or interface com.sun.tools.javac.tree.TreeScanner Warning:butterknife.compiler.ButterKnifeProcessor$VarScanner: can't find superclass or interface com.sun.tools.javac.tree.TreeScanner Warning:org.apache.poi.hssf.usermodel.DummyGraphics2d: can't find superclass or interface java.awt.Graphics2D Warning:org.apache.poi.hssf.usermodel.EscherGraphics: can't find superclass or interface java.awt.Graphics Warning:org.apache.poi.hssf.usermodel.EscherGraphics2d: can't find superclass or interface java.awt.Graphics2D Warning:org.apache.poi.poifs.crypt.dsig.SignatureMarshalListener: can't find superclass or interface org.w3c.dom.events.EventListener Warning:org.apache.poi.xslf.usermodel.XSLFRenderingHint: can't find superclass or interface java.awt.RenderingHints$Key .... Error:Execution failed for task >':app:transformClassesAndResourcesWithProguardForDebug'. Job failed, see logs for details

내 progard-규칙이있다 :

# Workaround for ProGuard not recognizing dontobfuscate 
-dontobfuscate 
-dontoptimize 
-optimizations !code/allocation/variable 
#Rules for javascript and webview 
-keepclassmembers class fqcn.of.javascript.interface.for.webview { 
    public *; 
} 
-keepattributes *Annotation*,EnclosingMethod,Signature 
#Parcel 
-keep class * implements android.os.Parcelable { 
    public static final android.os.Parcelable$Creator *; 
} 
-keep class org.parceler.Parceler$$Parcels 
-keep public class org.apache.poi.** {*;} 
#BUTTERKNIFE 
# Retain generated class which implement ViewBinder. 
-keep public class * implements butterknife.internal.ViewBinder 

{ public(); }

# Prevent obfuscation of types which use ButterKnife annotations since the simple name 
# is used to reflectively look up the generated ViewBinder. 
-keep class butterknife.* 
-keepclasseswithmembernames class * { @butterknife.* <methods>; } 
-keepclasseswithmembernames class * { @butterknife.* <fields>; } 

내 Gradle을 :

buildTypes { release { 
      minifyEnabled true 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } } 

나는 minifyEnabled를 false로 변경합니다. 오류가 없습니다. multidex 모드를 사용하고 있습니다. 문제를 어떻게 해결할 수 있습니까?

답변

0

이 이 build.gradle 응용 프로그램 수준 종속성이 줄을 추가하십시오

컴파일 'com.android.support:multidex:1.0.1'

dexOptions { javaMaxHeapSize "4g" }

거짓 minifyEnabled

multiDexEnabled true

+0

Ashish,이 모든 종속성이 있습니다. 나는 minifyEnabled false everething을 괜찮다면 위의 글을 썼다. 그러나 나는 코드를 난독 화해야한다. – Delphian

관련 문제