6

I added a new API to my custom android OS, and followed these steps to create the SDK:

  • . build/envsetup.sh
  • lunch sdk-eng
  • make -j(thread num) update-api
  • make -j(thread num) sdk
  • The SDK is located under /out/host/linux-x86/sdk/sdk/

Then configured Android Studio to use the new SDK:

  • Open Android Studio's Preferences --> Android SDK
  • Edit the Android SDK Location with the new SDK path.

Result: When I'm trying to build the project, the build process stuck with a message:

AAPT process not ready to receive commands

In the meanwhile I found a workaround to use the custom android.jar (in answers)

Yahavw
  • 109
  • 2
  • 9

1 Answers1

1

Workaround for using the new android.jar in Android Studio:

  • Replace the /platforms/android-/android.jar with the new android.jar that located at /out/host/linux-x86/sdk/sdk/sdk/android-sdk_eng./platforms/android-6.0.1/android.jar
  • Build the project.

Note: Before replacing the jar file, be sure that you have downloaded the appropriate android SDK from the Android SDK Manager. For example: If your custom SDK is for android-23, download the android-23 SDK platform. The compileSdkVersion 23 field in the app's build.gradle file, must be equal to the custom SDK number you created.

Yahavw
  • 109
  • 2
  • 9
  • 1
    As far as I know this is not a workaround but the correct way for doing this. – Nir Duan Nov 07 '16 at 08:45
  • There is a way to add the SDK to eclipse- [link](http://stackoverflow.com/questions/14729793/configure-eclipse-to-use-my-own-android-sdk-framework-jar). There should be a way to do it in Android Studio as well. – Yahavw Nov 07 '16 at 09:29
  • 2
    How is hacking a binary download of an official SDK the "correct" way to do this? If I'm Samsung and I want to create a custom SDK for developers targeting Samsung phones, I am supposed to tell everyone to get the Android SDK & replace the android.jar in it with a custom one in order to use my API? Sounds smelly. – Dennis Estenson Feb 19 '17 at 18:55