The steps of importing Androidstudio project into eclipse

This article is reproduced from https://blog.csdn.net/baozhuona/article/details/51475405

Since the launch of Android  Studio (hereinafter referred to as AS), more and more projects are developed using AS, which is undoubtedly a very uncomfortable thing for many students who have been using Eclipse. I am one of them. Now the company's projects are developed with AS, but some plug-ins commonly used for testing, such as MAT, findbugs, etc., are used to be used in eclipse.


So today, I researched the method of importing Android Studio project into eclipse. I found it online. Most of them are the method of importing eclipse project into AS. It seems that everyone is migrating from eclipse to AS. The future is the world of AS.

Back to the topic, say the method of AS to eclipse migration:

In fact, it is very simple, the code is the same, find the file corresponding to the Eclipse project from the AS project, and put it in the corresponding location.

So what we have to do is to put the AS files into the eclipse project. The first step is to create a new eclipse project as a shell, enter the workspace, and find the newly created project.

Then copy them in sequence according to the following correspondence:


  1. a. Replace src/main/AndroidManifest.xml in as - > AndroidManifest.xml  in eclipse;  
  2. b. Replace the source files in the src/main/java directory in as - >  the source files in the src directory in eclipse;  
  3. c. Replace the resource files in the src/main/res directory in as - >  the res directory in eclipse;  
  4. d. Copy the directory in src/main/jniLibs in as - >  the libs directory in eclipse;  
  5. d. Copy the directory in libs in as - >  the libs directory in eclipse;  
  6. e. Copy the directory in src/main/assets in as - >  under the assets directory in eclipse  


At this point, check whether there are files in .arr format in the lib directory. If there is no file in .arr format referenced in the project, the project has been replaced, and you can get the same project as in AS by refreshing the project in eclipse.

What if the project references files in .arr format? Let's import the main project we just got first. After importing, we found that there are many errors. Don't be afraid, because the dependent library is in arr, just take it here.

First, we decompress the arr file, and we can find that there is a class.jar in it. The other structure is actually very similar to an eclipse project. We create a new libs folder in the folder obtained after decompression, and put the solitary "class.jar" Put it in, and then import this project into eclipse. After importing, right-click the project-properties-Android, and tick in front of Is Library to make it a library project.

Then import this library project into the main project we imported before, and then select project-clean.

Introduction method: Right-click the library project-OK that has just been added to the project-properties-Android-add.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324468867&siteId=291194637