简体   繁体   中英

Android Studio: “Import Module” changes structure of existing library

I want to import an existing 3rd party library project to my own project as a module. I use "New -> Module -> Import Existing Project" wizard of Android Studio 0.6.1, and it does the job BUT makes a lot of modifications in source code of that library (rearranges source folders, modifies build.gradle, etc.).

Is there a way I can import library project as is, with no changes introduced by import plugin?

Looks like there is no way to avoid modifications made by the import plugin. All the settings it has is three checkboxes related to dependency management. I tried to uncheck all of them but still it does change my project structure.

I managed to add existing library projects manually: 1) Copied library's directory under the root directory of my project. 2) Referenced that library in settings.gradle by adding include ':libraryA' . 3) Added dependency to my project's build.gradle : compile project(':libraryA') .

Moreover, after that the IDE recognized that library as module and highlighted its folder in bold font whithin Project Structure.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM