转换为Dalvik格式失败,错误1与javax/net/SocketFactory.class

Ark*_*aha 25 android dalvik

尝试Build Project在控制台中获取此类输出时遇到此问题:

[2010-07-19 23:29:23 - myProject]
trouble processing "javax/net/SocketFactory.class":
[2010-07-19 23:29:23 - myProject] 
Attempt to include a core VM class in something other than a core library.
It is likely that you have attempted to include the core library from a desktop
virtual machine into an application, which will most assuredly not work. If
you really intend to build a core library -- which is only appropriate as
part of creating a full virtual machine binary, as opposed to compiling an
application -- then use the "--core-library" option to suppress this error
message. If you go ahead and use "--core-library" but are in fact building
an application, then please be aware that your build will still fail at some
point; you will simply be denied the pleasure of reading this helpful error
message.
[2010-07-19 23:29:23 - myProject] 1 error; aborting
[2010-07-19 23:29:23 - myProject] Conversion to Dalvik format failed with error 1
Run Code Online (Sandbox Code Playgroud)

我正在寻找我的项目使用包javax,没有找到,干净所有也没有帮助.我做错了什么?

更新

对不起,伙计们,但我找不到好的解决方法,我想强调一个事实,我根本不在SocketFactory课程中使用课程!源代码在这个问题之前没有改变,这就是为什么我认为在eclipse或adt或其他东西中的问题,但是如果我使用ant(由sdk生成)来构建这个项目没有问题!

我通过删除Eclipse,Android SDK,Eclipse工作区来解决这个问题,然后重新安装它们,之后一切正常.

希望这会对某人有所帮助.

pra*_*ash 49

我有同样的问题..这对我有用 - > properties-> java build path-> libraries-> remove all包括android jars

现在去项目浏览器,右键单击你正在处理的项目,然后安装android工具--->修复项目属性...做一个干净然后构建...


Spo*_*ck 11

  • 我解决了这个问题(至少对我而言).

这是我做的:

  • 转到项目»属性»Java构建路径»库
  • 删除除"Android XY"之外的所有内容,单击"确定".
  • 转到项目»清洁»清除下面选择的项目»选择项目,然后单击"确定".

这对我有用.希望它也适合你

更新:其实我可能不得不撤回我的意见..行动删除了错误消息但现在我缺少某些类和方法... arggghhhh


Eng*_*uad 5

我刚刚重启Eclipse,错误不再出现了!


Com*_*are 1

任何一个:

  • javax.net.SocketLibrary位于您的源代码中,或者
  • javax.net.SocketLibrary包含在您项目的 JAR 文件中