Android Studio - Error:Uncaught translation error: com.android.dx.cf.code.SimException: local 0001: invalid
Asked Answered
P

1

3

I have just set up a new computer with Android Studio and imported my project from bitbucket.

Problem is that I am now getting this error when trying to build the project:

Information:Gradle tasks [:app:clean, :app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies, :app:assembleDebug] :app:clean :app:preBuild UP-TO-DATE :app:preDebugBuild UP-TO-DATE :app:checkDebugManifest :app:preReleaseBuild UP-TO-DATE :app:prepareChAcraAcra470Library :app:prepareComAndroidSupportAnimatedVectorDrawable2420Library :app:prepareComAndroidSupportAppcompatV72420Library :app:prepareComAndroidSupportDesign2420Library :app:prepareComAndroidSupportRecyclerviewV72420Library :app:prepareComAndroidSupportSupportCompat2420Library :app:prepareComAndroidSupportSupportCoreUi2420Library :app:prepareComAndroidSupportSupportCoreUtils2420Library :app:prepareComAndroidSupportSupportFragment2420Library :app:prepareComAndroidSupportSupportMediaCompat2420Library :app:prepareComAndroidSupportSupportV132420Library :app:prepareComAndroidSupportSupportV42420Library :app:prepareComAndroidSupportSupportVectorDrawable2420Library :app:prepareComGoogleAndroidGmsPlayServicesBase940Library :app:prepareComGoogleAndroidGmsPlayServicesBasement940Library :app:prepareComGoogleAndroidGmsPlayServicesTasks940Library :app:prepareComGoogleAndroidGmsPlayServicesVision940Library :app:prepareComJourneyappsZxingAndroidEmbedded320Library :app:prepareDebugDependencies :app:compileDebugAidl :app:compileDebugRenderscript :app:generateDebugBuildConfig :app:mergeDebugShaders :app:compileDebugShaders :app:generateDebugAssets :app:mergeDebugAssets :app:generateDebugResValues UP-TO-DATE :app:generateDebugResources :app:mergeDebugResources :app:processDebugManifest :app:processDebugResources :app:generateDebugSources :app:preDebugAndroidTestBuild UP-TO-DATE :app:prepareDebugAndroidTestDependencies :app:compileDebugAndroidTestAidl :app:processDebugAndroidTestManifest :app:compileDebugAndroidTestRenderscript :app:generateDebugAndroidTestBuildConfig :app:mergeDebugAndroidTestShaders :app:compileDebugAndroidTestShaders :app:generateDebugAndroidTestAssets :app:mergeDebugAndroidTestAssets :app:generateDebugAndroidTestResValues UP-TO-DATE :app:generateDebugAndroidTestResources :app:mergeDebugAndroidTestResources :app:processDebugAndroidTestResources :app:generateDebugAndroidTestSources :app:mockableAndroidJar UP-TO-DATE :app:preDebugUnitTestBuild UP-TO-DATE :app:prepareDebugUnitTestDependencies :app:incrementalDebugJavaCompilationSafeguard :app:compileDebugJavaWithJavac :app:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.). Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. :app:compileDebugNdk UP-TO-DATE :app:compileDebugSources :app:buildInfoDebugLoader :app:transformClassesWithExtractJarsForDebug :app:transformClassesWithInstantRunVerifierForDebug :app:transformClassesWithJavaResourcesVerifierForDebug UP-TO-DATE :app:mergeDebugJniLibFolders :app:transformNative_libsWithMergeJniLibsForDebug :app:processDebugJavaRes UP-TO-DATE :app:transformResourcesWithMergeJavaResForDebug :app:transformResourcesAndNative_libsWithJavaResourcesVerifierForDebug UP-TO-DATE :app:transformClassesWithInstantRunForDebug :app:transformClasses_enhancedWithInstant+reloadDexForDebug UP-TO-DATE :app:incrementalDebugTasks :app:prePackageMarkerForDebug :app:fastDeployDebugExtractor :app:generateDebugInstantRunAppInfo :app:coldswapKickerDebug :app:transformClassesWithInstantRunSlicerForDebug :app:transformClassesWithDexForDebug Error:Uncaught translation error: com.android.dx.cf.code.SimException: local 0001: invalid Error:1 error; aborting Error:Execution failed for task ':app:transformClassesWithDexForDebug'.

com.android.build.api.transform.TransformException: java.lang.RuntimeException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: Return code 1 for dex process Information:BUILD FAILED Information:Total time: 1 mins 38.347 secs Information:3 errors Information:0 warnings Information:See complete output in console

And here is the output from the Gradle Console window:

Executing tasks: [:app:clean, :app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies, :app:assembleDebug]

Configuration on demand is an incubating feature. Incremental java compilation is an incubating feature. :app:clean :app:preBuild UP-TO-DATE :app:preDebugBuild UP-TO-DATE :app:checkDebugManifest :app:preReleaseBuild UP-TO-DATE :app:prepareChAcraAcra470Library :app:prepareComAndroidSupportAnimatedVectorDrawable2420Library :app:prepareComAndroidSupportAppcompatV72420Library :app:prepareComAndroidSupportDesign2420Library :app:prepareComAndroidSupportRecyclerviewV72420Library :app:prepareComAndroidSupportSupportCompat2420Library :app:prepareComAndroidSupportSupportCoreUi2420Library :app:prepareComAndroidSupportSupportCoreUtils2420Library :app:prepareComAndroidSupportSupportFragment2420Library :app:prepareComAndroidSupportSupportMediaCompat2420Library :app:prepareComAndroidSupportSupportV132420Library :app:prepareComAndroidSupportSupportV42420Library :app:prepareComAndroidSupportSupportVectorDrawable2420Library :app:prepareComGoogleAndroidGmsPlayServicesBase940Library :app:prepareComGoogleAndroidGmsPlayServicesBasement940Library :app:prepareComGoogleAndroidGmsPlayServicesTasks940Library :app:prepareComGoogleAndroidGmsPlayServicesVision940Library :app:prepareComJourneyappsZxingAndroidEmbedded320Library :app:prepareDebugDependencies :app:compileDebugAidl :app:compileDebugRenderscript :app:generateDebugBuildConfig :app:mergeDebugShaders :app:compileDebugShaders :app:generateDebugAssets :app:mergeDebugAssets :app:generateDebugResValues UP-TO-DATE :app:generateDebugResources :app:mergeDebugResources :app:processDebugManifest :app:processDebugResources :app:generateDebugSources :app:preDebugAndroidTestBuild UP-TO-DATE :app:prepareDebugAndroidTestDependencies :app:compileDebugAndroidTestAidl :app:processDebugAndroidTestManifest :app:compileDebugAndroidTestRenderscript :app:generateDebugAndroidTestBuildConfig :app:mergeDebugAndroidTestShaders :app:compileDebugAndroidTestShaders :app:generateDebugAndroidTestAssets :app:mergeDebugAndroidTestAssets :app:generateDebugAndroidTestResValues UP-TO-DATE :app:generateDebugAndroidTestResources :app:mergeDebugAndroidTestResources :app:processDebugAndroidTestResources :app:generateDebugAndroidTestSources :app:mockableAndroidJar UP-TO-DATE :app:preDebugUnitTestBuild UP-TO-DATE :app:prepareDebugUnitTestDependencies :app:incrementalDebugJavaCompilationSafeguard :app:compileDebugJavaWithJavac :app:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).

Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details.

:app:compileDebugNdk UP-TO-DATE :app:compileDebugSources :app:buildInfoDebugLoader :app:transformClassesWithExtractJarsForDebug :app:transformClassesWithInstantRunVerifierForDebug :app:transformClassesWithJavaResourcesVerifierForDebug UP-TO-DATE :app:mergeDebugJniLibFolders :app:transformNative_libsWithMergeJniLibsForDebug :app:processDebugJavaRes UP-TO-DATE :app:transformResourcesWithMergeJavaResForDebug :app:transformResourcesAndNative_libsWithJavaResourcesVerifierForDebug UP-TO-DATE :app:transformClassesWithInstantRunForDebug :app:transformClasses_enhancedWithInstant+reloadDexForDebug UP-TO-DATE :app:incrementalDebugTasks :app:prePackageMarkerForDebug :app:fastDeployDebugExtractor :app:generateDebugInstantRunAppInfo :app:coldswapKickerDebug :app:transformClassesWithInstantRunSlicerForDebug :app:transformClassesWithDexForDebug AGPBI: {"kind":"error","text":"Uncaught translation error: com.android.dx.cf.code.SimException: local 0001: invalid","sources":[{}]} AGPBI: {"kind":"error","text":"1 error; aborting","sources":[{}]}

FAILED

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':app:transformClassesWithDexForDebug'.

    com.android.build.api.transform.TransformException: java.lang.RuntimeException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: Return code 1 for dex process

  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

To investigate, I have created the Camera2Basic sample project that comes with Android Studio and that builds fine, so maybe this is a problem with a setting within my project rather than a general configuration/setup problem?

What I've already tried (with no luck):

  1. Added org.gradle.jvmargs=-Xmx2048m to my gradle.properties file.
  2. Setting minifyEnabled false in my app build.gradle file (in the release and in the debug blocks).
  3. This suggestion.
  4. File > Invalidate Cahces / Restart...

NB - Similar question here - but with a different error number and, currently, no answers.

Update:

Having removed a third party library (nxpnfclib.jar) from my app, my project now builds and runs fine. But if I then try re-adding the jar, the problem comes back.

Update #2:

I have created one of the sample Android Studio projects (Camera2Basic) and added the nxpnfclib.jar library. The same problem occurs. So this is clearly a problem with the nxpnfclib.jar library. (I have, today, emailed NXP about this latest issue with their library, so I will update this page with their solution - unless they update it, of course.)

I am using:

  • Windows 7 (64-bit)
  • Android Studio v2.1.3 (as a fresh install)
  • JDK 1.8.0_102
  • Gradle version 2.14.1
  • Android plugin version 2.1.3
Perfervid answered 22/8, 2016 at 15:24 Comment(6)
Looks like a bug to me. I'd report it or at least post in adt-dev forum, which is tracked by devtools team. I also noticed that the task that encounters this error is transformClassesWithInstantRunSlicerForDebug, therefore disabling instant-run might temporarily solve it.Geri
I've already reported it, cheers. How do I disable instant-run?Perfervid
Just to be sure, have you reported this issue to Android Studio team? If so, can you post the ticket number? Anyway, to disable instant-run follow these steps.Geri
I have now! :-) Issue #220804 - code.google.com/p/android/issues/…Perfervid
I've just disabled Instant Run then added the library to my project - and now it builds and runs fine. :-) Would obviously be good to have the Instant Run feature available though, so will add this to the bug report and see what they come back with. Thanks for your help, Alex. :-)Perfervid
i solved same issue after remove AS and AS configuration.Ulrikeulster
G
0

This what I did to fix in my scenario:

At the project level on android studio updated the build.gradle like this:

buildscript {
    ext.kotlin_version = '1.2.31
}
dependencies {
    classpath 'com.android.tools.build:gradle:3.1.0'
}

Then on the gradle-wrapper.properties this:

distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
Glottis answered 6/4, 2018 at 15:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.