如何将gradle项目转换为android项目 [英] How do I convert a gradle project to android project

查看:144
本文介绍了如何将gradle项目转换为android项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Eclipse ADT,我已经通过配置 - >转换为gradle项目将我的Android项目转换为gradle项目,实际上我需要将我的毕业项目转换为android项目。我如何做到这一点?

解决方案

您的Android项目在Eclipse ADT通常应该有2个文件



.project

 <?xml version =1.0encoding =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.0encoding =UTF-8?> 
< classpath>
< classpathentry kind =srcpath =src/>
< classpathentry kind =srcpath =gen/>
< classpathentry kind =conpath =com.android.ide.eclipse.adt.ANDROID_FRAMEWORK/>
< classpathentry exports =truekind =conpath =com.android.ide.eclipse.adt.LIBRARIES/>
< classpathentry exported =truekind =conpath =com.android.ide.eclipse.adt.DEPENDENCIES/>
< classpathentry kind =outputpath =bin / classes/>
< / classpath>

一旦你更正了它们,你的项目就是Eclipse中的标准Android项目。



要从Eclipse中使用较新的构建系统,请尝试 Nodeclipse / Enide Gradle for Eclipse
市场



用于Eclipse的Gradle的一些屏幕截图:






I use Eclipse ADT and i have convert my android project to gradle project through configure -> convert to gradle project, actually i need to convert my gradle project to android project. How i can do that ?

解决方案

Your Android project in Eclipse ADT usually should have 2 files

.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>

Once you correct them, your project is back standard Android project in Eclipse.

To use newer build system from Eclipse try Nodeclipse/Enide Gradle for Eclipse (marketplace)

Some screenshots for Gradle for Eclipse:

这篇关于如何将gradle项目转换为android项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆