Eclipse Project migrated to Android Studio (latest version)

Source: Internet
Author: User

Recently, the official version of Android Studio (hereinafter referred to as) has been released, and the fire is not available. Personally think mainly because Android is Google's own products, as is also his own IDE, the future trend of Android development will certainly use as, as to whether Eclipse's ADT plugin to continue to update is not to be. Recently I also found the integrated Adt-bundle on the Android website, but did not find, it may be the path changed (search also not found) or is really to support as in the next rack. GitHub is now a huge pile of as projects, so this is a trend.

The reason this article is written is because the online search for eclipse migration to as related articles are older, not necessarily applicable (at least I encountered a lot of problems)

Preparatory work

1, to the official website to download as the latest version, is currently 1.0 version.

2, upgrade as, can now be upgraded to 1.0.2. You may encounter some problems during the upgrade process, as follows:

① Select the upgrade channel. As the upgrade is can choose their own upgrade channels, different channels of the release version is not the same, (I choose the Stable channel, each channel corresponding to what version is not explained here, the online description. )

② network problems. Google in the mainland situation everyone knows, so it is not surprising that you need to use a VPN or proxy. Readers on the Internet to find ways to solve the network, here is not convenient to explain, you understand.

③ Upgrade ADT to ADT-23.0.4 (this article by default you already have eclipse with ADT installed). If your eclipse version is too low then you'll have to download a higher version of Eclipse (I'm using version=4.3.2) and then install ADT-23.0.4.

The latest version is used in the preparation, although it is not necessary to upgrade, but do it to avoid any puzzling problems.

Migration steps

1. Eclipse exports the Gradle project.

File->export->generate Gradle build files and then the next step, select the items you want to export (regardless of the dependencies, they will be automatically exported),

2, as import.

Launch as into "Welcome to Android Studio" This interface, select "Import Non-andorid Studio Project", it must be this option, or import a problem. (If your as is not in this interface, you can go to this interface by File->close Project) and then find the project in step 1 to successfully import it.

3, wait patiently.

It may be slow to import because you want to download Gradle, and then wait for the download to complete. If it is because of the problem of their own network, then use VPN, proxy and the like (File->settings->http proxy).

4. Change the Gradle version (not required). Generally exported items will have a version inconsistency problem, then the as prompt repair Gradle version agreed to repair.

Based on the above steps, the project is basically migrated successfully. If you have multiple dependent packages on your project, then you might compile, but probably suggest that there are multiple identical packages, such as SUPPORT-V4 packages. If you encounter such a problem, you can do the following.

1. Then you can delete the Support-v4.jar.

2, open Project Structrue (ctrl+alt+shift+s), find just that module, select Dependencies, click on the right side of the "+" number to add V4 package again.

Basically, these steps will allow you to migrate the Eclipse project to as, and if you encounter other problems, you can deal with them basically with the as hint, not yet. The use of more as is only slowly familiar.

Official documents

Here are the official documents, which I have done according to the official documentation, summarizing the issues I have done and the problems I have encountered.

To migrate existing Android projects, simply import them using Android Studio:

    1. In Android Studio, close any projects currently open. You should see theWelcome to Android Studio window.
    2. Click Import non-android Studio project.
    3. Locate the project exported from Eclipse, expand it, select the build.gradle file and click OK.
    4. In the following dialog, leave use gradle wrapper selected and click OK. (You don't need to specify the Gradle home.)

Android Studio properly updates the project structure and creates the appropriate Gradle build file.

Official Android Studio documentation in http://developer.android.com/tools/studio/index.html

Summarize

I am also as novice, has been using eclipse, encountered problems basically rely on Google. Please correct me if there is something wrong with the text, thank you. Leave my little brother's Android communication group here: 311536202. There are problems to be discussed in the group, to learn together.

Eclipse Project migrated to Android Studio (latest version)

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.