IntelliJ IDEA Export to Eclipse Android工程不能正常被Eclipse识别的解决方法
2013-04-15 23:29
661 查看
最近迷上了IntelliJ IDEA,就Android开发而言,确实要比Eclipse好用,尤其是对于Layout的布局,非常方便,但是公司大部分同事使用的还是Eclipse,这就存在一个问题——我创建的工程,怎么能让其他同事导入并开发。虽然IDEA提供了“Export to Eclipse”,但是在实际过程中还是存在问题的——Eclipse在import时,不能将这个Android工程正确识别,总是作为Java工程导入,经过反复试验,终于找到了问题——“.project”这个文件在搞鬼,具体解决方法如下:
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>IDEATest</name>
<comment/>
<projects/>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments/>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
上面是使用IDEA创建的Android module在执行Export to Eclipse后的.project文件中的全部内容。这些内容是Eclipse工程的最基本的内容,要想让Eclipse能将其正确识别为Android工程,要进行如下修改
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>IDEATest</name>
<comment/>
<projects/>
<buildSpec>
<buildCommand>
<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
<arguments/>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
<arguments/>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.ApkBuilder</name>
<arguments/>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments/>
</buildCommand>
</buildSpec>
<natures>
<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
其中第7行至第18行,以及第25行,都是要自己添加的内容,添加完毕以后保存,再次将工程导入到Eclipse,这下就能正确识别为Android工程了。如果导入后出现了error,不要慌,可以使用Android Tools->Fix Project Properties来解决错误。
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>IDEATest</name>
<comment/>
<projects/>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments/>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
上面是使用IDEA创建的Android module在执行Export to Eclipse后的.project文件中的全部内容。这些内容是Eclipse工程的最基本的内容,要想让Eclipse能将其正确识别为Android工程,要进行如下修改
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>IDEATest</name>
<comment/>
<projects/>
<buildSpec>
<buildCommand>
<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
<arguments/>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
<arguments/>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.ApkBuilder</name>
<arguments/>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments/>
</buildCommand>
</buildSpec>
<natures>
<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
其中第7行至第18行,以及第25行,都是要自己添加的内容,添加完毕以后保存,再次将工程导入到Eclipse,这下就能正确识别为Android工程了。如果导入后出现了error,不要慌,可以使用Android Tools->Fix Project Properties来解决错误。
相关文章推荐
- IntelliJ IDEA Export to Eclipse Android工程不能正常被Eclipse识别的解决方法
- Eclipse无法正常创建android工程解决方法!
- Eclipse无法正常创建android工程解决方法!
- Eclipse导入Android工程出现Project has no default.properties file! Edit the project properties to set one.的解决方法
- 在ubuntu下,eclipse不能识别手机的解决方法
- linux下eclipse的SVN插件subclipse最新版本1.8及其依赖的javaHL1.7不能正常使用的解决方法
- eclipse中tomcat正常启动但不能访问tomcat管理页面的解决方法
- JavaEE - Eclipse下Web工程导入Myeclipse不能被识别解决方式
- Android中导入工程出现Project has no default.properties file! Edit the project properties to set one.的解决方法
- ubuntu Android开发eclipse不识别手机解决方法!(附步步高vivo解决方法)
- eclipse下debug模式不能正常运作的解决方法
- Android eclipse导入项目后出现Unable to resolve target 'android-17'解决方法
- eclipse中tomcat正常启动但不能访问tomcat管理页面的解决方法
- Ubuntu上Eclipse不识别Android手机的解决方法
- Android 解决魅族手机豌豆荚能连上,Eclipse不能识别的问题
- MyEclipse中安装android ADT 之后不能建WEB工程 解决方法
- eclipse中tomcat正常启动但不能访问tomcat管理页面的解决方法
- ubuntu不能识别android设备的解决方法
- 新建android工程时eclipse没有生成layout和Mainactivity的解决方法
- 我的Android进阶之旅------>Ubuntu下不能识别Android设备的解决方法