最近学习Bmob,从github下载了一份源码,导入eclipse时出现上面的错误,Failed to read the project description file (.project)。google了一下,当打开.project文件时,发现是空的,如图:
解决方法:打开.project文件,复制下面代码到文件中。
<span style="font-size:18px;"><?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>projectname</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.ApkBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
</span>
其中projectname换成你自己的包名。