我使用 Eclipse ADT,我已经通过配置将我的 android 项目转换为 gradle 项目 -> 转换为 gradle 项目,实际上我需要将我的 gradle 项目转换为 android 项目。我该怎么做?
最佳答案
您在 Eclipse ADT 中的 Android 项目通常应该有 2 个文件
.project
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Android-app</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>
.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 exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
<classpathentry kind="output" path="bin/classes"/>
</classpath>
一旦您更正了它们,您的项目就会回到 Eclipse 中的标准 Android 项目。
要从 Eclipse 使用较新的构建系统,请尝试 Nodeclipse/Enide Gradle for Eclipse (marketplace)
Gradle for Eclipse 的一些截图:
关于android - 如何将gradle项目转换为android项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22744839/