我刚刚使用 Android Studio 设置了一台新计算机,并从 bitbucket 导入了我的项目。
问题是我现在在尝试构建项目时遇到此错误:
信息:Gradle 任务 [:app:clean, :app:generateDebugSources,
:app:generateDebugAndroidTestSources,:app:mockableAndroidJar,
:应用程序:prepareDebugUnitTestDependency,:应用程序:assembleDebug]:应用程序:clean
:app:preBuild 最新 :app:preDebugBuild 最新
:app:checkDebugManifest :app:preReleaseBuild 最新
:app:准备ChAcraAcra470Library
:app:prepareComAndroidSupportAnimatedVectorDrawable2420Library
:app:prepareComAndroidSupportAppcompatV72420库
:app:prepareComAndroidSupportDesign2420Library
:app:prepareComAndroidSupportRecyclerviewV72420Library
:app:prepareComAndroidSupportSupportCompat2420Library
:app:prepareComAndroidSupportSupportCoreUi2420Library
:app:prepareComAndroidSupportSupportCoreUtils2420Library
:app:prepareComAndroidSupportSupportFragment2420Library
:app:prepareComAndroidSupportSupportMediaCompat2420Library
:app:prepareComAndroidSupportSupportV132420库
:app:prepareComAndroidSupportSupportV42420库
:app:prepareComAndroidSupportSupportVectorDrawable2420Library
:应用程序:prepareComGoogleAndroidGmsPlayServicesBase940Library
:应用程序:prepareComGoogleAndroidGmsPlayServicesBasement940Library
:应用程序:prepareComGoogleAndroidGmsPlayServicesTasks940Library
:应用程序:prepareComGoogleAndroidGmsPlayServicesVision940Library
:app:prepareComJourneyappsZxingAndroidEmbedded320Library
:应用程序:prepareDebugDependency :应用程序:compileDebugAidl
:应用程序:compileDebugRenderscript :应用程序:generateDebugBuildConfig
:应用程序:合并调试着色器 :应用程序:编译调试着色器
:应用程序:生成调试资产 :应用程序:合并调试资产
:app:generateDebugResValues 最新 :app:generateDebugResources
:应用程序:mergeDebugResources :应用程序:processDebugManifest
:应用程序:processDebugResources :应用程序:generateDebugSources
:app:preDebugAndroidTestBuild 最新
:app:prepareDebugAndroidTestDependencies
:应用程序:compileDebugAndroidTestAidl :应用程序:processDebugAndroidTestManifest
:app:compileDebugAndroidTestRenderscript
:app:generateDebugAndroidTestBuildConfig
:应用程序:mergeDebugAndroidTestShaders :应用程序:compileDebugAndroidTestShaders
:应用程序:generateDebugAndroidTestAssets :应用程序:mergeDebugAndroidTestAssets
:app:generateDebugAndroidTestResValues 最新
:app:generateDebugAndroidTestResources
:app:mergeDebugAndroidTestResources
:app:processDebugAndroidTestResources
:app:generateDebugAndroidTestSources :app:mockableAndroidJar
最新的:app:preDebugUnitTestBuild 最新的
:应用程序:prepareDebugUnitTestDependency
:app:incrementalDebugJavaCompilationSafeguard
:app:compileDebugJavaWithJavac :app:compileDebugJavaWithJavac - 不是
增量(例如输出已更改、之前没有执行等)。
注意:某些输入文件使用或覆盖已弃用的 API。笔记:
使用 -Xlint:deprecation 重新编译以了解详细信息。注意:一些输入文件
使用未经检查或不安全的操作。注意:重新编译
-Xlint:未选中详细信息。 :app:compileDebugNdk 最新 :app:compileDebugSources :app:buildInfoDebugLoader
:应用程序:transformClassesWithExtractJarsForDebug
:应用程序:transformClassesWithInstantRunVerifierForDebug
:app:transformClassesWithJavaResourcesVerifierForDebug 最新
:app:mergeDebugJniLibFolders
:应用程序:transformNative_libsWithMergeJniLibsForDebug
:app:processDebugJavaRes 最新
:应用程序:transformResourcesWithMergeJavaResForDebug
:应用程序:transformResourcesAndNative_libsWithJavaResourcesVerifierForDebug
最新:app:transformClassesWithInstantRunForDebug
:app:transformClasses_enhancedWithInstant+reloadDexForDebug 最新
:应用程序:incrementalDebugTasks :应用程序:prePackageMarkerForDebug
:应用程序:fastDeployDebugExtractor :应用程序:generateDebugInstantRunAppInfo
:app:coldswapKickerDebug
:应用程序:transformClassesWithInstantRunSlicerForDebug
:app:transformClassesWithDexForDebug错误:未捕获的翻译错误:
com.android.dx.cf.code.SimException:本地0001:无效错误:1
错误;中止错误:任务执行失败
':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:dex 返回代码 1
进程信息:BUILD FAILED 信息:总时间:1 分钟 38.347
秒 信息:3 个错误 信息:0 个警告 信息:参见
控制台完整输出
以下是 Gradle 控制台窗口的输出:
执行任务:[:app:clean, :app:generateDebugSources,
:app:generateDebugAndroidTestSources,:app:mockableAndroidJar,
:应用程序:prepareDebugUnitTestDependency,:应用程序:assembleDebug]
按需配置是一项正在孵化的功能。增量java
编译是一个孵化功能。 :应用程序:干净 :应用程序:预构建
最新:app:preDebugBuild 最新:app:checkDebugManifest
:app:preReleaseBuild 最新版本 :app:prepareChAcraAcra470Library
:app:prepareComAndroidSupportAnimatedVectorDrawable2420Library
:app:prepareComAndroidSupportAppcompatV72420库
:app:prepareComAndroidSupportDesign2420Library
:app:prepareComAndroidSupportRecyclerviewV72420Library
:app:prepareComAndroidSupportSupportCompat2420Library
:app:prepareComAndroidSupportSupportCoreUi2420Library
:app:prepareComAndroidSupportSupportCoreUtils2420Library
:app:prepareComAndroidSupportSupportFragment2420Library
:app:prepareComAndroidSupportSupportMediaCompat2420Library
:app:prepareComAndroidSupportSupportV132420库
:app:prepareComAndroidSupportSupportV42420库
:app:prepareComAndroidSupportSupportVectorDrawable2420Library
:应用程序:prepareComGoogleAndroidGmsPlayServicesBase940Library
:应用程序:prepareComGoogleAndroidGmsPlayServicesBasement940Library
:应用程序:prepareComGoogleAndroidGmsPlayServicesTasks940Library
:应用程序:prepareComGoogleAndroidGmsPlayServicesVision940Library
:app:prepareComJourneyappsZxingAndroidEmbedded320Library
:应用程序:prepareDebugDependency :应用程序:compileDebugAidl
:应用程序:compileDebugRenderscript :应用程序:generateDebugBuildConfig
:应用程序:合并调试着色器 :应用程序:编译调试着色器
:应用程序:生成调试资产 :应用程序:合并调试资产
:app:generateDebugResValues 最新 :app:generateDebugResources
:应用程序:mergeDebugResources :应用程序:processDebugManifest
:应用程序:processDebugResources :应用程序:generateDebugSources
:app:preDebugAndroidTestBuild 最新
:app:prepareDebugAndroidTestDependencies
:应用程序:compileDebugAndroidTestAidl :应用程序:processDebugAndroidTestManifest
:app:compileDebugAndroidTestRenderscript
:app:generateDebugAndroidTestBuildConfig
:应用程序:mergeDebugAndroidTestShaders :应用程序:compileDebugAndroidTestShaders
:应用程序:generateDebugAndroidTestAssets :应用程序:mergeDebugAndroidTestAssets
:app:generateDebugAndroidTestResValues 最新
:app:generateDebugAndroidTestResources
:app:mergeDebugAndroidTestResources
:app:processDebugAndroidTestResources
:app:generateDebugAndroidTestSources :app:mockableAndroidJar
最新的:app:preDebugUnitTestBuild 最新的
:应用程序:prepareDebugUnitTestDependency
:app:incrementalDebugJavaCompilationSafeguard
:app:compileDebugJavaWithJavac :app:compileDebugJavaWithJavac - 不是
增量(例如输出已更改、之前没有执行等)。
注意:某些输入文件使用或覆盖已弃用的 API。笔记:
使用 -Xlint:deprecation 重新编译以了解详细信息。注意:一些输入文件
使用未经检查或不安全的操作。注意:重新编译
-Xlint:未选中详细信息。
:app:compileDebugNdk 最新 :app:compileDebugSources
:应用程序:buildInfoDebugLoader :应用程序:transformClassesWithExtractJarsForDebug
:应用程序:transformClassesWithInstantRunVerifierForDebug
:app:transformClassesWithJavaResourcesVerifierForDebug 最新
:app:mergeDebugJniLibFolders
:应用程序:transformNative_libsWithMergeJniLibsForDebug
:app:processDebugJavaRes 最新
:应用程序:transformResourcesWithMergeJavaResForDebug
:应用程序:transformResourcesAndNative_libsWithJavaResourcesVerifierForDebug
最新:app:transformClassesWithInstantRunForDebug
:app:transformClasses_enhancedWithInstant+reloadDexForDebug 最新
:应用程序:incrementalDebugTasks :应用程序:prePackageMarkerForDebug
:应用程序:fastDeployDebugExtractor :应用程序:generateDebugInstantRunAppInfo
:app:coldswapKickerDebug
:应用程序:transformClassesWithInstantRunSlicerForDebug
:app:transformClassesWithDexForDebug AGPBI:
{“kind”:“error”,“text”:“未捕获的翻译错误:
com.android.dx.cf.code.SimException:本地0001:
无效","sources":[{}]} AGPBI: {"kind":"error","text":"1 个错误;
正在中止","来源":[{}]}
FAILED
失败:构建失败并出现异常。
构建失败
为了进行调查,我创建了 Android Studio 附带的 Camera2Basic 示例项目,并且构建良好,所以这可能是我的项目中的设置问题,而不是一般配置/设置问题?
我已经尝试过的(没有运气):
- Added
org.gradle.jvmargs=-Xmx2048m
to my gradle.properties
file.
- Setting
minifyEnabled false
in my app build.gradle
文件(在release
并在debug
块)。
-
这个建议 https://stackoverflow.com/a/38503845/1617737.
-
File
> Invalidate Cahces / Restart...
NB - 类似的问题在这里 https://stackoverflow.com/questions/37745659/uncaught-translation-error-com-android-dx-cf-code-simexception-local-0002-inv- 但错误号不同,目前没有答案。
Update:
从我的应用程序中删除第三方库(nxpnfclib.jar)后,我的项目现在可以正常构建并运行。但如果我随后尝试重新添加该罐子,问题又回来了。
更新#2:
我创建了示例 Android Studio 项目 (Camera2Basic) 之一并添加了 nxpnfclib.jar 库。也会出现同样的问题。所以这显然是 nxpnfclib.jar 库的问题。 (今天,我已通过电子邮件向恩智浦发送了有关其库的最新问题的信息,因此我将使用他们的解决方案更新此页面 - 当然,除非他们更新它。)
我在用:
- Windows 7(64 位)
- Android Studio v2.1.3(全新安装)
- JDK 1.8.0_102
- 摇篮版本 2.14.1
- Android插件版本2.1.3