简体   繁体   English

在Mac上的Eclipse上,转换为Dalvik格式失败,并出现错误1

[英]Conversion to Dalvik format failed with error 1 on Eclipse for Mac

I know there are many problems like this, but I've followed a bunch of the various solutions with no success. 我知道有很多这样的问题,但是我遵循了很多不同的解决方案,但都没有成功。

I am running Eclipse 3.7 on Mac OSX 10.6.8. 我在Mac OSX 10.6.8上运行Eclipse 3.7。 I have previously worked on Android applications on this SDK and gotten them to compile. 之前,我曾在此SDK上开发Android应用程序,然后将其编译。 But, on my latest project (I had gotten it to compile and run using the Android virtual device when it was in an extremely basic state), when I tell it to Run (to test it out on the virtual device) I get this error message (even though there are no little red X's or anything anywhere in my project or other detectable errors): 但是,在我的最新项目中(当它处于极其基本的状态时,我已经将其编译并使用Android虚拟设备运行),当我告诉它运行(在虚拟设备上对其进行测试)时,出现此错误消息(即使项目中的任何地方都没有红色的小X或其他可检测到的错误):

[2012-09-01 18:13:48 - RadarGun] Dx trouble processing "java/andythompson/radargun/BuildConfig.class": [2012-09-01 18:13:48-RadarGun] Dx麻烦处理“ java / andythompson / radargun / BuildConfig.class”:

Ill-advised or mistaken usage of a core class (java.* or javax.*) when not building a core library. 不构建核心库时对核心类(java。*或javax。*)的不良使用或错误使用。

This is often due to inadvertently including a core library file in your application's project, when using an IDE (such as Eclipse). 这通常是由于在使用IDE(例如Eclipse)时在应用程序项目中无意中包含了一个核心库文件。 If you are sure you're not intentionally defining a core class, then this is the most likely explanation of what's going on. 如果您确定没有刻意定义核心类,那么这是最可能的解释。

However, you might actually be trying to define a class in a core namespace, the source of which you may have taken, for example, from a non-Android virtual machine project. 但是,您实际上可能正在尝试在核心名称空间中定义一个类,例如,您可能从非Android虚拟机项目中获取了该类的源。 This will most assuredly not work. 这肯定是行不通的。 At a minimum, it jeopardizes the compatibility of your app with future versions of the platform. 至少,这会损害您的应用程序与平台未来版本的兼容性。 It is also often of questionable legality. 它的合法性也常常令人怀疑。

If you really intend to build a core library -- which is only appropriate as part of creating a full virtual machine distribution, as opposed to compiling an application -- then use the "--core-library" option to suppress this error message. 如果您确实打算构建一个核心库(仅适合于创建完整的虚拟机发行版而不是编译应用程序),请使用“ --core-library”选项来禁止显示此错误消息。

If you go ahead and use "--core-library" but are in fact building an application, then be forewarned that your application will still fail to build or run, at some point. 如果您继续使用“ --core-library”,但实际上是在构建应用程序,那么请注意,在某些时候您的应用程序仍将无法构建或运行。 Please be prepared for angry customers who find, for example, that your application ceases to function once they upgrade their operating system. 请为生气的客户做好准备,这些客户发现例如,他们的操作系统升级后,您的应用程序将停止运行。 You will be to blame for this problem. 您将为此问题负责。

If you are legitimately using some code that happens to be in a core package, then the easiest safe alternative you have is to repackage that code. 如果您合法使用的代码恰好位于核心程序包中,那么最简单的安全选择就是重新打包该代码。 That is, move the classes in question into your own package namespace. 也就是说,将相关的类移到您自己的包名称空间中。 This means that they will never be in conflict with core system classes. 这意味着它们永远不会与核心系统类冲突。 JarJar is a tool that may help you in this endeavor. JarJar是一种可以帮助您实现这一目标的工具。 If you find that you cannot do this, then that is an indication that the path you are on will ultimately lead to pain, suffering, grief, and lamentation. 如果您发现自己无法做到这一点,则表明您所走的道路最终将导致痛苦,痛苦,悲伤和悲哀。

[2012-09-01 18:13:48 - RadarGun] Dx 1 error; [2012-09-01 18:13:48-RadarGun] Dx 1 error; aborting [2012-09-01 18:13:48 - RadarGun] Conversion to Dalvik format failed with error 1 正在中止[2012-09-01 18:13:48-RadarGun]转换为Dalvik格式失败,错误1

-------------------------- (end of error message)----------------------- --------------------------(错误讯息结尾)------------------ -----

I've tried the whole Project->Properties->Build Path->remove all except the one you are working on thing along with the Project->Clean part afterwards. 我已经尝试了整个项目->属性->构建路径->删除所有内容,然后再删除所有您正在处理的项目以及项目->清洁部分。

Any other suggestions? 还有其他建议吗? Thanks 谢谢

Any other suggestions? 还有其他建议吗?

Well, the error message says that your code is using a java.* or javax.* class that it is not supposed to be using. 那么,该错误消息 ,你的代码使用java.*javax.*类,它不应该被使用。 So try checking your code to find what class it is complaining about. 因此,请尝试检查您的代码以查找其抱怨的类。

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

相关问题 如何解决转换为Dalvik格式失败并出现错误 - How to solve the Conversion to Dalvik format failed with error Android项目:转换为Dalvik格式失败,错误1 - Android project: Conversion to Dalvik format failed with error 1 转换为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 Android Grid View转换为Dalvik格式失败错误 - Conversion to Dalvik format failed error for Android Grid View 获取错误:转换为Dalvik格式失败:无法执行dex: - Getting Error: conversion to Dalvik format failed: Unable to execute dex: 在编译jitsi项目时,转换为Dalvik格式失败,错误1 - Conversion to Dalvik format failed with error 1 while compiling jitsi project 自facebook SDK以来,转换为Dalvik格式失败,错误1 - Conversion to Dalvik format failed with error 1 since facebook SDK PhoneGap条码扫描器插件未导出,原因是“转换为dalvik格式失败,错误为1” - PhoneGap barcodeScanner plugin not exporting due to “conversion to dalvik format failed with error 1” 转换为Dalvik格式失败,并在Android中出现错误Apache poi - Conversion to Dalvik format failed with error Apache poi in Android
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM