0

Quand je commence mon application, j'ai beaucoup d'avertissements et d'erreurs:proguard Android minifyEnabled vrai + multidex = erreur

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

Mes PROGARD règles est:

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

Mon gradle:

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

si je modifie minifyEnabled faux. Il n'y a pas d'erreurs J'utilise le mode multidex. Comment puis-je résoudre le problème?

Répondre

0

Essayez cette ajouter cette ligne dans les dépendances de niveau app build.gradle

compilation 'com.android.support:multidex:1.0.1'

dexOptions { javaMaxHeapSize "4g" }

minifyEnabled faux

multiDexEnabled vrai

+0

Ashish, j'ai toutes ces dépendances. Je ai écrit ci-dessus si j'ai minifyEnabled faux tout bien, mais j'ai besoin de code obscurci. – Delphian