Error displaying the wrong image

I encountered this error when I try to build my project using Android Studio with minifyEnabled true .

Error Details

 :app:transformClassesWithDexForDevDebug Uncaught translation error: com.android.dx.cf.code.SimException: expected type int but found com.apptimize.hz Uncaught translation error: com.android.dx.cf.code.SimException: expected type int but found com.apptimize.oa 2 errors; aborting 

How can I solve it?

UPDATE *

The contents of the Proguard file.

-optimization covers 5 -dontusemixedcaseclassnames -dontskipnonpubliclibraryclasses -dontpreverify -detailed -optimization! code / simplification / arithmetic ,! field /, class / merge /

-dontwarn android.support. ** -dontwarn com.atinternet. ** -dontwarn org.apache. **

-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

-keepattributes InnerClasses -keepattributes Annotations -keepattributes Signature

-keepclasseswithmembernames class * {native; }

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

-keepclasseswithmembers class * {public (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 *; }

-dontwarn java.awt. ** -dontwarn CompatHoneycomb -keep class android.support.v4. {*; }

-keep class com.squareup.okhttp. ** {*; } -dontwarn uk.co.senab.photoview. ** -keep class uk.co.senab.photoview. ** {*; }

I used 'com.android.tools.build:gradle:1.5.0'

Is there a problem with my proguard file?

+5
source share
2 answers

See the dodger's answer in Compiling with Proguard gives a SimException: "local variable type mismatch"

Add this to disable specific optimizations that cause proguard errors.

-optimization! code / distribution / variable

worked for me.

0
source

I also encountered the same problem after 3-4 days of detailed study. The problem arises in the gradle version and the way dex and classes are handled.

The fix for this may

There are two types of cases.

Case 1:. Android tests have many complications with the Mock and Instrumentation tests. To pass the test tests, we need to disable minifyEnabled false , which prohibits the progaurd testCoverageEnabled false process. If enbale testCoverageEnabled is true, what causes this problem. To check, you must pass the test, you must disable progaurd in debug mode and testCoverageEnable false.

  debug { minifyEnabled false debuggable true testCoverageEnabled false proguardFile 'proguard-rules.pro' } 

Case 2: Define testProgurdFile and make minifyEnabled true for proguard in debug mode as hello.

Compiling with Proguard gives a SimException: "local variable type mismatch" defines testProgurdFile, as shown below. Which will be used for testing, in which you can specify the test progard rules that are consumed using the test program.

  debug { minifyEnabled true debuggable true testCoverageEnabled true proguardFile 'proguard-rules.pro' testProguardFiles 'test-proguard-rules.pro' } 

Link References:

0
source

Source: https://habr.com/ru/post/1236404/


All Articles