【Android】从Eclipse到AndroidStudio的工程迁移

1、新建Android Studio的代码目录

2、打开AS,选择File---->New---->Import Project

 

3、在弹出的对话框选择Eclispe代码目录

4、选择Eclipse目录之后,在弹出的对话框中输入目标文件夹,

 

5、Next之后,默认缺省的勾选项

 

6、等待gradle加载

 

 7、修改build.gradle,如下图,gradle版本与本机的配置版本一致,如3.4

复制代码
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        google()
        jcenter()
        
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.4.0'
        
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
        
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}
复制代码

8、修改gradle目录,在gradle\wrapper\gradle-wrapper.properties文件中,gradle插件和gradle版本如下图

#Thu May 09 09:42:09 CST 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip

 

 

9、点击try again

 10、由于Eclipse的Android SDK 版本与Android Studio版本可能不一致,会出现如下错误,先注释AndroidManifest.xml的sdk版本信息

 

 11、继续try again,此处版本也可能不一致,调整一致

 

 12、编译测试

 

13、查看编译结果

 

posted @   咸鱼翻身  阅读(383)  评论(0编辑  收藏  举报
编辑推荐:
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
阅读排行:
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· 单线程的Redis速度为什么快?
· 展开说说关于C#中ORM框架的用法!
· Pantheons:用 TypeScript 打造主流大模型对话的一站式集成库
历史上的今天:
2016-10-06 关于直播学习笔记-002-Red5 & Sewise Player & Wirecast
点击右上角即可分享
微信分享提示