android - 如何将gradle项目转换为android项目

标签 android eclipse gradle

我使用 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/

相关文章:

android - 如何获取屏幕打开的时间

java - 如何避免 BIRT 中表和组内的分页?

java - 无法在编辑配置中选择我的应用程序

android - manifestPlaceHolders 不替换值

android - 在附加堆栈跟踪中获取资源但从未释放 - 错误

java - 使用生成的端点和 gae 实现 Multi-Tenancy

eclipse - Ubuntu Eclipse 编译器 1.8 不出现

eclipse - 如何解决 Spring Data Maven 构建的 "Plugin execution not covered by lifecycle configuration"

android - 我该如何解决 "failed to find style ' bottomnavigationstyle'

Android:实现 WhatsApp 文件选择器