简体   繁体   中英

How to import a library project in Android Studio, without making a copy?

OK I know people have asked this problem thousands times, but Android studio is so so so hard to understand and use and I still can't find the correct way.

I find several solutions, but all of them says to copy the library codes into main project. It makes no sense to me. When I try to build a standalone project for the library, I find no "New project from existing source" like that in Eclipse.

Can I have a step-to-step for:

  1. I have a main Android Studio project
  2. I have an Eclipse Android library project
  3. Without making a copy of library project
  4. I can let the main project "use" library project

The point is, if I have many app projects using the same library source, I can just modify one copy. If I need to put library codes in every app project, it's a disaster. Eclipse can do this without any problem.

Thank you. I'm really exhausted with Android Studio, but I can't choose to stay on Eclipse since Google says ADT won't be supported anymore.

The real answer to keep your library project only in one place is in this post :

Android Studio 0.8.1 Creating Modules without copying files?

In Android Studio Project import your eclipse library project as new module. Then in Android studio right click on your app module go to module setting > select dependency tab > click plus> select module dependency > select library project module.

new Module or import Module under the project,
then open Module Settings--》Module dependencies --》'+' module dependencie.

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