分享

android 编译错误

 真爱图书 2010-12-30
经常遇到类似如下的错误:

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-09-16 19:50:36 - WebViewDemo] 1 error; aborting
[2010-09-16 19:50:36 - WebViewDemo] Conversion to Dalvik format failed with error 1

出错原因是工程目录下的.classpath文件内容不正确。
简单的处理办法就是:选择一个正常编译的android工程,将该工程下的.classpath文件复制到出错的工程目录下,然后清除错误:project---client 指定错误的工程,重新编译即可成功。
也可以在出错工程目录下直接创建一个正确的.classpath文件,内容如下:
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry kind="output" path="bin"/>
</classpath>

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多