我有一个项目有几个Build Variants和
Android Studio的第一个版本(jdk 1.8或1.7,没关系)它没有跟随错误,但奇怪的部分是第二次运行它的工作,非常烦人和耗时:
:app:transformClassesWithDexForBuildVariantDebug
Uncaught translation error: com.android.dx.cf.code.SimException: local variable type mismatch: attempt to set or access a value of type java.lang.String[] using a local variable of type android.os.Bundle. This is symptomatic of .class transformation tools that ignore local variable information.
Uncaught translation error: com.android.dx.cf.code.SimException: local variable type mismatch: attempt to set or access a value of type java.io.InputStream using a local variable of type java.lang.String[]. This is symptomatic of .class transformation tools that ignore local variable information.
Uncaught translation error: com.android.dx.cf.code.SimException: local variable type mismatch: attempt to set or access a value of type java.io.InputStream using a local variable of type java.lang.String[]. This is symptomatic of .class transformation tools that ignore local variable information.
Uncaught translation error: com.android.dx.cf.code.SimException: local variable type mismatch: attempt to set or access a value of type java.lang.Object using a local variable of type boolean. This is symptomatic of .class transformation tools that ignore local variable information.
4 errors; aborting
Error:Execution failed for task ‘:app:transformClassesWithDexForBuildVariantDebug’.
com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process ‘command ‘/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home/bin/java” finished with non-zero exit value 1
谢谢.
最佳答案
dexOptions {
additionalParameters += ['--no-locals']
}