Android Studio - 错误:未捕获翻译错误:com.android.dx.cf.code.SimException:本地 0001:无效

2024-05-17

我刚刚使用 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

失败:构建失败并出现异常。

  • 出了什么问题:任务“: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 过程

  • 尝试:使用 --stacktrace 选项运行以获取堆栈跟踪。使用 --info 或 --debug 选项运行以获得更多日志输出。

构建失败

为了进行调查,我创建了 Android Studio 附带的 Camera2Basic 示例项目,并且构建良好,所以这可能是我的项目中的设置问题,而不是一般配置/设置问题?

我已经尝试过的(没有运气):

  1. Added org.gradle.jvmargs=-Xmx2048m to my gradle.properties file.
  2. Setting minifyEnabled false in my app build.gradle文件(在release并在debug块)。
  3. 这个建议 https://stackoverflow.com/a/38503845/1617737.
  4. 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

这是我在我的场景中所做的修复:

在 android studio 的项目级别更新了 build.gradle,如下所示:

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

然后在 gradle-wrapper.properties 上这样:

distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Android Studio - 错误:未捕获翻译错误:com.android.dx.cf.code.SimException:本地 0001:无效 的相关文章

  • Android Studio 3.0 Canary 9 - 无法解析包

    我在 Android Studio 3 0 Canary 9 中遇到几个错误 这些错误是 无法解析 android 软件包 下面列出了一些错误 我刚刚安装了 SDK 的所有额外软件包 但仍然收到 gradle 构建错误 Error 82 1
  • Android - 从资产中解析巨大(超大)JSON 文件的最佳方法

    我正在尝试从资产文件夹中解析一些巨大的 JSON 文件 我如何加载并添加到 RecyclerView 我想知道解析这种大文件 大约 6MB 的最佳方法是什么 以及您是否知道可以帮助我处理此文件的良好 API 我建议您使用GSON lib h
  • Android 30+ 中的视频捕获意图 - 只有所有者才能与待处理项目交互

    我正在尝试在我的应用程序上捕获视频 它可以在 android API 30 以下运行 但不能在 30 以上运行 似乎在 sdk 30 之后 android 不允许完全读取外部存储 作用域存储 我目前遇到这个错误 java lang Ille
  • 找不到 com.google.firebase:firebase-core:9.0.0 [重复]

    这个问题在这里已经有答案了 在遵循有些不一致的指示之后here https firebase google com docs admob android quick start name your project and here http
  • android xamarin 中的 reCaptcha

    我想在 Xamarin android 应用程序中实现验证码 我抓住了这个在 Android 中集成 googles reCaptcha 验证 https www c sharpcorner com article how to integ
  • Adobe 是否为其 PDF 阅读器提供 Android SDK 或 API? [关闭]

    Closed 这个问题不符合堆栈溢出指南 help closed questions 目前不接受答案 我希望能够在我们的应用程序内的视图中显示本地 PDF 文件 在 Android 4 03 下的平板电脑上运行 目前 我们将 Adob eR
  • 带有 EditText 和 Spinner 的对话框

    我有一个按钮 单击后会弹出一个对话框 我希望对话框有一个EditText and a Spinner对话框内 我不知道如何设置它的视图 我有一个代码AlertDialog它有效 只是EditText and Spinner我需要将其放入其中
  • Android MediaExtractor seek() 对 MP3 音频文件的准确性

    我在使用 Android 时无法在eek 上获得合理的准确度MediaExtractor 对于某些文件 例如this one http www archive org download emma solo librivox emma 01
  • 控制Android的前置LED灯

    我试图在用户按下某个按钮时在前面的 LED 上实现 1 秒红色闪烁 但我很难找到有关如何访问和使用前置 LED 的文档 教程甚至代码示例 我的意思是位于 自拍 相机和触摸屏附近的 LED 我已经看到了使用手电筒和相机类 已弃用 的示例 但我
  • 在gradle插件中获取应用程序变体的包名称

    我正在构建一个 gradle 插件 为每个应用程序变体添加一个新任务 此新任务需要应用程序变体的包名称 这是我当前的代码 它停止使用最新版本的 android gradle 插件 private String getPackageName
  • 在 build.gradle 中声明依赖项后如何导入依赖项?

    我刚刚开始在 android studio 工作并开始探索 Gradle 的世界 于是我在Android Studio中创建了一个项目 打开build gradle并添加了如下依赖项 dependencies compile com and
  • 如何默认在 ActionOpenDocument 意图中显示“内部存储”选项

    我需要用户选择一个自定义文件类型的文件 并将其从 Windows 文件资源管理器拖到 Android 设备上 但默认情况下内部存储选项不可用 当我使用以下命令启动意图时 var libraryIntent new Intent Intent
  • 字符串数组文本格式化

    我有这个字符串 String text Address 1 Street nr 45 Address 2 Street nr 67 Address 3 Street nr 56 n Phone number 000000000 稍后将被使用
  • 如何根据 gradle 风格设置变量

    我想传递一个变量test我为每种风格设置了不同的值作为 NDK 的定义 但出于某种原因 他总是忽略了最后味道的价值 这是 build gradle apply plugin com android library def test andr
  • 增加活动的屏幕亮度

    显然 Android 操作系统中至少有三种不同的技术可以改变屏幕亮度 其中两个在纸杯蛋糕之后不再起作用 而第三个被接受的技术显然有一个错误 我想在单视图活动开始时增加屏幕亮度 然后在活动结束时将亮度恢复为用户设置 没有按钮 没有第二个视图或
  • 如何确定对手机号码的呼叫是本地呼叫还是 STD 或 ISD

    我正在为 Android 开发某种应用程序 但不知道如何获取被叫号码是本地或 STD 的号码的数据 即手机号码检查器等应用程序从哪里获取数据 注意 我说的是手机号码 而不是固定电话 固定电话号码 你得到的数字是字符串类型 因此 您可以获取号
  • Firebase 添加新节点

    如何将这些节点放入用户节点中 并创建另一个节点来存储帖子 我的数据库参考 databaseReference child user getUid setValue userInformations 您需要使用以下代码 databaseRef
  • 将 Intent 包装在 LabeledIntent 中以用于显示目的

    要求 我的应用程序中有一个 共享 按钮 我需要通过 Facebook 分享 我需要选择是否安装原生 Facebook 应用程序 我们的决定是 如果未安装该应用程序 则将用户发送到 facebook com 进行分享 当前状态 我可以检测何时
  • 将两个文本视图并排放置在布局中

    我有两个文本视图 需要在布局中并排放置 并且必须遵守两条规则 Textview2 始终需要完整显示 如果布局中没有足够的空间 则必须裁剪 Textview1 例子 文本视图1 文本视图2 Teeeeeeeeeeeeeeeeeextview1
  • 按日期对 RecyclerView 进行排序

    我正在尝试按日期对 RecyclerView 进行排序 但我尝试了太多的事情 我不知道现在该尝试什么 问题就出在这条线上适配器 notifyDataSetChanged 因为如果我不放 不会显示错误 但也不会更新 recyclerview

随机推荐

  • 如何重新定位或移动 Google Maps SDK 上的当前位置按钮?

    如何将 Objective C 中的当前位置按钮移至我的偏好 现在 我已启用它 但底角有东西挡住了它 Thanks 您可以使用 padding 将按钮向上移动 self mapView padding UIEdgeInsets top 0
  • 使用 posix shell 测试字符串中的正则表达式

    如何测试字符串是否与特定字符串匹配正则表达式与基本 无 bash 或任何其他 posix shell 脚本 在 if 语句中 您可以使用expr在 POSIX shell 中计算正则表达式的命令 s Abc expr s alpha 3 e
  • 如何确定 std::function 的参数数量?

    我有以下问题 假设您想编写一个可以采用 lambda 表达式的通用函数 我知道如果参数是 std function 类型 那么我不仅可以使用 lambda 还可以使用函数 甚至可以使用函数指针 所以第一步 我做了以下事情 void prin
  • 工厂模式中创建者的角色

    我无法理解为工厂类定义抽象类 接口的作用 这是我在网络上的所有教程中总是看到的东西 有人可以阐明 CreatorInterface 的重要性吗 工厂模式参考UML图 https i stack imgur com 3VpUM png 为了以
  • 在 .NET 程序集或可执行文件中嵌入文本文件[重复]

    这个问题在这里已经有答案了 可能的重复 如何在 NET 程序集中嵌入文本文件 https stackoverflow com questions 433171 how to embed a text file in a net assemb
  • 通过套接字发送动态数组(在记录内)?

    我正在尝试直接使用 SendBuf 将记录从服务器传输到客户端 但是 该记录有一个动态数组的成员 并且我在某处 在 SOF 中 读到 发送记录时 成员必须是静态的 固定长度 但问题是 我无法确定如何我会 将来 发送许多论点 我怎么解决这个问
  • Api 控制器中长时间运行的任务(使用 Web API,自托管 OWIN)

    我想在自托管 OWIN 环境中的 ApiController 中运行长时间运行的任务 例如 4 5 分钟 但是 我想在开始该任务后 一旦开始长时间运行的任务 就发回响应 而不等待它完成 这个长时间运行的任务与 HTTP 无关 并且顺序运行一
  • 如何将表格中的td高度设置为0px?

    我有一个包含几行的 HTML 表 这是动态构建的 全部 tr 有一个 td inside If one td 里面没有 HTML 内容 我希望它是不可见的 如何才能做到这一点 并不是说里面的 HTML 是动态渲染的 我不想使用display
  • Magento --“SQLSTATE[23000]:违反完整性约束..”客户更新

    迁移服务器后 每次尝试更新客户信息时都会出现错误 我正在使用一个客户激活插件 http www magentocommerce com magento connect vinai extension 489 customer activat
  • 如果在 中执行 document.write,为什么 DHTML 行为在 IE8 中不起作用?

    我们有一个 3rd 方 Web 应用程序 可以在 IE6 中运行 但不能在 IE8 中运行 示例代码如下 在IE6中会弹出 message from htc 消息 但在IE8中不会弹出 测试 html
  • 在 FsCheck 中生成唯一字符串

    我需要生成独特的非null用作的字符串Dictionary键 我尝试过类似的事情 public static Gen
  • 如何为 NSAttributedString 内的文本设置“隐藏”属性?

    我有一个 Cocoa 应用程序NSTextView控件将其文本保存在NSAttributedString 实际上我相信这是一个NSMutableAttributedString 我可以轻松地在该字符串内的不同字符范围上设置和修改不同的文本属
  • JPA 中的复合键

    我想创建一个具有自动生成的主键的实体 而且还有一个由其他两个字段组成的唯一复合键 我如何在 JPA 中执行此操作 我想这样做是因为主键应该用作另一个表中的外键 并且使其复合并不好 在下面的代码片段中 我需要命令和模型是唯一的 pk当然是主键
  • Haskell - lambda 表达式

    我试图了解什么是有用的以及如何在 Haskell 中实际使用 lambda 表达式 我不太明白使用 lambda 表达式相对于定义函数的约定方式有何优势 例如 我通常会执行以下操作 let add x y x y 我可以简单地打电话 add
  • Android Studio:lambda 不起作用[重复]

    这个问题在这里已经有答案了 当尝试使用 lambda 表达式时 我遇到了一些 Gradle 构建错误 错误 41 100 错误 source 1 7 不支持 lambda 表达式 使用 source 8 或更高版本来启用 lambda 表达
  • 自动提取数据 - Oracle SQL Developer

    我通过 SQL Developer 连接到 Oracle 数据库 我想编写一个返回每月数据集的查询 然后将该数据提取到分隔文本文件中 我知道如何做到这一点就好了 我想知道是否有一种方法可以编写一个脚本来运行查询并在一年内逐月提取数据 这样我
  • 将渐变应用于 Material UI 的主题背景

    我试图将 MuiTheme 的默认背景颜色设置为渐变 我有以下代码 export const theme createMuiTheme palette type dark background default linear gradient
  • 将函数中的会话变量传递给 codeigniter 中的助手

    这就是我正在尝试做的事情 这是控制器中的功能 public function get started if test login this gt session gt all userdata this gt load gt view te
  • 如何从 C# 运行 PowerShell 脚本

    我正在尝试使用 C 运行 PowerShell 脚本 但没有成功 这是我的功能 private void ExecutePowerShellCommand string scriptfile RunspaceConfiguration ru
  • Android Studio - 错误:未捕获翻译错误:com.android.dx.cf.code.SimException:本地 0001:无效

    我刚刚使用 Android Studio 设置了一台新计算机 并从 bitbucket 导入了我的项目 问题是我现在在尝试构建项目时遇到此错误 信息 Gradle 任务 app clean app generateDebugSources