简体   繁体   中英

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)

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.

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