Migrating from Eclipse to Android Studio (with a variety of issues)

Source: Internet
Author: User

1, the first step, eclipse still want to have drop, and ADT to be above 22, I believe that all ADT must be above 22, otherwise also develop a hair.

(1) in Eclipse, select Flie->export-->android-->Generate Gradle build Files

(2),next--> Select the item you want to guide-->next--> first check force overriding of exeisting files-->finish--->finish

(3). Everyone, notice, there is something to change, first in the Eclipse project to see the project, add a file Build.gradle, and then directly in the face pity dorado things.

Change what the book, first on my change after the figure. HD Uncensored Big picture, show in the back

A, apply plugin: ' Android ' changed to apply plugin: ' com.android.application ' because, apply plugin: ' Android ' is not suitable for the current version of

b, add a piece of code, believe me, plus go on the line, pro-test

buildscript {
    repositories {
        Mavencentral ()
   }
    dependencies {
         classpath ' com.android.tools.build:gradle:1.0.0 '

}
}

C, change the Buildtoolsversion "19.1.0" to Buildtoolsversion "21.0.2". Notice, don't look at me this is 21.0.2, you have to see your own version of the SDK,

Ok! Ctrl+s save what has just changed, eclipse we can not see for the time being,

2, step two, we find the Eclipse workspace, which is the directory where you put your project code. Hey, you'll find a few more files.

We have to change two things, believe me, absolutely to change, do not change the pit,

(1) The first one is Build.gradle, if you are 0.8.+, change to 1.0.0 or version issue

(2). The second must be changed, Gradle\wrapper This directory inside the gradle-wrapper.properties file, the default is online loading, in the kingdom to Google download, you understand. So we're going to change the load to local. You have to have this thing first, gradle-2.2.1-all. If not, go to () download

Link: http://pan.baidu.com/s/1bnxYzmv Password: nd2l

Come on, Android studio is finally ready to play.

3, the third step, open Android Studio, select Import non-android Studio Project--Select project Demo4 inside the Build.gradle file, do not choose the wrong, click OK. You may have a popup box, just OK. Then just wait for it to create the project. Ha ha haha

OK, the following if this error, then it means no problem. As you can see, we didn't import the Libray package.

Come back to eclipse, select the package appcompat_v7_8 to be introduced, and, as before Demo4, generate the Build.gradle file. And then back to Android studio. Import, File-->import Module-->appcompat_v7_v8-->ok (PS: Here directly select the project on the line, do not go to select the Build.gradle file inside) notice, anyway I do, very cool,--- If you also refer to other library packages, the same operation, cool.

4, and finally a little configuration is OK. Is that you originally quoted a few library packages, you have to check whether a place is not configured

dependencies {
    compile Filetree (dir: ' Libs ', include: ' *.jar ')
    Compile project (': Appcompat_v7_8 ')
}

(PS: If you have a previous project loaded. So files, such as using the Map SDK, Push SDK, which have. so files, optical compilefiletree (dir: ' Libs ', include: ' *.jar ') useless, also need to configure to load . so file. You can read this article about Android Studio usage (vi)---how Android studio loads. so files)

Read on, compile Filetree (dir: ' Libs ', include: ' *.jar ') This line will bring you the. jar package from the Lib folder in your previous eclipse, so you don't have to worry about it, compile project (' ') is your import module of the library package, you each lead one in, in

Settings.gradle this inside will have, directly to include the copy in the back of the past, because, afraid of you manually knocked wrong, resulting in an error.

5. Due to the merit, run! Hello world! is coming ...


I have encountered the problem: Install the APK found on the desktop there are two icons, one can open normally, one cannot open, uninstall when unloading one another disappears, asked the degree Niang, she said: Ready, the show is coming: direct

All right, perfect .....

Migrating from Eclipse to Android Studio (with a variety of issues)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.