Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use custom android SDK in Android Studio?

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)

like image 293
Yahavw Avatar asked Nov 07 '16 07:11

Yahavw


1 Answers

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.

like image 95
Yahavw Avatar answered Oct 05 '22 23:10

Yahavw