[Latest graphics] How do I migrate items from eclipse to Android studio?

Source: Internet
Author: User

Objective

Recently, the official version of Android Studio (as) has been officially released, and the fire is not working well. I think the main reason is that Android is Google's own product, as is his own IDE, the future trend of Android development will certainly be used as, as to eclipse the ADT plug-in to continue to update is not known. Recently I also found an integrated adt-bundle on the Android website, but did not find it, it may be the path has changed (search also did not find) or is really in order to support as on the shelf. GitHub is also a huge pile of as projects, so it's a trend.

The reason I write this article is because it's old and not necessarily applicable (at least I've had a lot of problems) when I'm looking for eclipse migration to as.

Preparatory work

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

2, upgrade as, currently can upgrade to 1.0.2. Some problems may be encountered during the upgrade process, as follows:

① Select the upgrade channel. As the upgrade is the channel to choose their own upgrade, different channels of the release version is not the same, such as the figure (I choose the Stable channel, each channel corresponding to what version of this is not explained here, the Internet has instructions.) )

② network problems. Google's situation in the mainland is well known, so it's not surprising that you need to use a VPN or proxy. Readers to find a way to solve the network online, it is not convenient to explain, you understand.

③ Upgrade ADT to ADT-23.0.4 (this article defaults to having the ADT Eclipse installed). If your eclipse version is too low, then you have to download a later version of Eclipse (I'm using version=4.3.2) and install ADT-23.0.4.

The latest version of the preparation, although not necessary to upgrade, but in order to avoid a puzzling problem to do it.

Migration steps

1, Eclipse Export Gradle project.

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

2, as import.

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

3, wait patiently.

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

4, change the Gradle version (not necessary). Generally exported projects will have version inconsistency problem, then in the AS hint repair Gradle version agree to fix it.

Based on the above steps is basically a successful migration of the project. If your project has multiple dependencies, it may be compiled, but presumably there are multiple identical packages, such as SUPPORT-V4 packages. If you encounter such a problem, you can do the following.

1, then can delete the Support-v4.jar.

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

Basically, these steps allow you to migrate your Eclipse project to as, and if you encounter other problems that are basically handled with the AS hint, you are not currently experiencing it. More use of as as is only slowly familiar.

Official documents

Here is the official document, which I also do according to the official documents, and make a summary of the problems I did and encountered.

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

In Android Studio, close any projects currently open. You should the Thewelcome to Android Studio window.

Click Import non-android Studio project.

Locate the project you exported from Eclipse, expand it, select the Build.gradle file and click OK.

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

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

Summarize

I am also a novice, always using eclipse, the problem is basically rely on Google. Please correct me if there are any irregularities in the article. Here's your little brother's Android Exchange Group: 311536202. There are questions to be discussed in the group, to study together.

Related Article

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.