user755499
user755499

Reputation: 2290

Can we use Android studio for AOSP development?

Can we use Android studio for AOSP(Android Open Source Project) development, is there a way to do it. I didnt find one. anybody got any idea on this please ?

Upvotes: 40

Views: 34754

Answers (3)

issamux
issamux

Reputation: 1415

To import AOSP source in Android Studio or Eclipse, follow the full instructions here : https://android.googlesource.com/platform/development/+/master/tools/idegen/README

Upvotes: 15

videoguy
videoguy

Reputation: 1918

What Pedlar suggested above is one way of doing it. I ran into lot of Jar dependency issues when I tried it with IDEA community edition (Android Studio is a fork of IDEA IDE). The IDE keeps prompting you about duplicate jars etc. The generated project includes framework Java sources as well as App sources. I tried to build an App project which resulted in broken AOSP build. IMHO, IDEA is a great IDE for Java development. But didn't work well with AOSP.

What worked for me is using eclipse to browse/edit/debug framework sources, but build the code from a terminal window. To avoid AOSP build breaks, please create a shadow dir of AOSP (i.e. lndir of AOSP) and use shadow dir for eclipse project.

This is explained at Using eclipse to browse/edit AOSP link in step by step. If you are working on AOSP, you might want to check Debugging Android framework services.

Upvotes: 2

Pedlar
Pedlar

Reputation: 1054

You can use Android Studio as a IDE for AOSP, since it's just a modified version of InteliJ's IDE.

from AOSP root:

 make idegen && development/tools/idegen/idegen.sh

Then just "Open Project" in Android Studio and select the android.ipr it generated.

Upvotes: 80

Related Questions