简体   繁体   English

Android项目:转换为Dalvik格式失败,错误1

[英]Android project: Conversion to Dalvik format failed with error 1

I am writing an android application using eclipse and am trying to use jar files I generated from another eclipse (not android) project I wrote. 我正在使用eclipse编写android应用程序,并尝试使用从我编写的另一个eclipse(非android)项目生成的jar文件。 However, when I try to run my android application, I get the following error message: 但是,当我尝试运行我的android应用程序时,出现以下错误消息:

[2014-05-15 18:42:25 - ResearchNotebook] Dx 1 error; [2014-05-15 18:42:25-ResearchNotebook] Dx 1错误; aborting 中止

[2014-05-15 18:42:25 - ResearchNotebook] Conversion to Dalvik format failed with error 1 [2014-05-15 18:42:25-ResearchNotebook]转换为Dalvik格式失败,错误为1

which is preceeded by a longer error message. 这是由较长的错误消息引起的。

I looked at the following question ( Ill-advised or mistaken usage of a core class (java.* or javax.*) when not building a core library ), and but am not sure how I would reconfigure the eclipse IDE so that rt.jar and android.jar are not being passed to dx. 我查看了以下问题( 在未构建核心库时,对核心类(java。*或javax。*)的不当使用或错误使用 ),但不确定如何重新配置​​eclipse IDE,以便使用rt。 jar和android.jar没有传递给dx。

However, I wrote non android java code within the same project using the jar and ran it in the console. 但是,我使用jar在同一项目中编写了非android java代码,并在控制台中运行了它。 It worked perfectly fine. 它工作得很好。 The problem only arises when I try to use the jar for the classes pertaining to the android application. 仅当我尝试将jar用于与android应用程序相关的类时,才会出现问题。

At this point, I have tried many different alternatives, including cleaning the project, deleting the jars from the buildpath and adding them again, and changing order and export according to the following site: http://tools.android.com/recent/dealingwithdependenciesinandroidprojects . 在这一点上,我尝试了许多不同的选择,包括清理项目,从构建路径中删除jar并再次添加它们,以及根据以下站点更改顺序和导出: http : //tools.android.com/recent/处理android项目中的依赖关系

Is there something else I should have done when generating the jar from my eclipse (non android) project? 从eclipse(非android)项目生成jar时,我还应该做其他事情吗? I have really hit a wall this problem and am at a loss about how to proceed. 我真的遇到了这个问题,对如何进行感到茫然。

Try the following: 请尝试以下操作:

  1. Uncheck "Build Automatically" from the "Project" menu. 从“项目”菜单中取消选中“自动构建”。
  2. Do a project cleanup. 进行项目清理。
  3. Export your project 导出项目

Hope it helps. 希望能帮助到你。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 添加jar文件导致Android项目错误:转换为Dalvik格式失败,错误为1 - Adding jar file cause Android project error: Conversion to Dalvik format failed with error 1 在编译jitsi项目时,转换为Dalvik格式失败,错误1 - Conversion to Dalvik format failed with error 1 while compiling jitsi project Android Grid View转换为Dalvik格式失败错误 - Conversion to Dalvik format failed error for Android Grid View 转换为Dalvik格式失败,并在Android中出现错误Apache poi - Conversion to Dalvik format failed with error Apache poi in Android 如何解决转换为Dalvik格式失败并出现错误 - How to solve the Conversion to Dalvik format failed with error 在Mac上的Eclipse上,转换为Dalvik格式失败,并出现错误1 - Conversion to Dalvik format failed with error 1 on Eclipse for Mac 将Google Play服务添加到项目后,错误:转换为Dalvik格式失败 - After adding Google Play Services to project, Error: Conversion to Dalvik format failed 在android ADT build v22.3.0-887826中错误1转换为Dalvik格式失败 - Conversion to Dalvik format failed with error 1-in android ADT build v22.3.0-887826 转换为Dalvik格式失败eclipse android-suport-v4.jar错误 - Conversion to Dalvik format failed eclipse android-suport-v4.jar error 转换为Dalvik格式失败,并在libgdx中出现错误1奇怪的错误 - Conversion to Dalvik format failed with error 1 Weird error in libgdx
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM