2

Im trying to add android.car API to Android Studio project. Since car classes are not available by default with sdk, i've done mm in .../car-lib and copied generated android.car.jar to app/libs and then right click on this in AS and -> Add as a library. After this Car Api classes are still not available. To make everything clear, here are steps I done:

/AOSP$ . build/envsetup.sh
/AOSP$ lunch full-eng
/AOSP$ cd packages/services/Car/car-lib
/AOSP/packages/services/Car/car-lib$ mm

Then copied android.car.jar from AOSP/out/target/product/generic/system/framework/android.car.jar to MyProject/app/libs. Then in Android Studio right click on android.car.jar and -> Add as a library (auto generate grandle implementation)

Edric
  • 24,639
  • 13
  • 81
  • 91
Qivi
  • 31
  • 1
  • 6

1 Answers1

1

Ok, already got it.

Project Structure → + Module → import .Jar/AAR Package → Source:

AOSP/out/target/common/obj/JAVA_LIBRARIES/android.car_intermediates/classes-full-debug.jar

Then same with

AOSP/out/target/common/obj/JAVA_LIBRARIES/android.car_intermediates/classes.jar

Then add those modules as a module dependencies to your app module.

Qivi
  • 31
  • 1
  • 6
  • I was trying to build it from AOSP but couldnt because i have a case insensitive filesystem and it failed =( . I was wondering if you have that .jar still somewhere so you could share it? would save me a lot of hussle – bkokot May 24 '20 at 20:23