-
Notifications
You must be signed in to change notification settings - Fork 249
Description
Describe the issue
The steps to build an Android chat app fail when building the Android Archive because environment variable ANDROID_SDK is not set.
To Reproduce
Run through the steps in https://learn.arm.com/learning-paths/mobile-graphics-and-gaming/build-llama3-chat-android-app-using-executorch-and-xnnpack/
In Build and Run Android Chat App -> Build the Android Archive , the command
sh scripts/build_android_library.sh
fails with
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':executorch_android:extractDebugAnnotations'.
> SDK location not found. Define a valid SDK location with an ANDROID_HOME environment variable or by setting the sdk.dir path in your project's local properties file at '/Users/bblaukopf/Bananas/executorch/extension/android/local.properties'.
Expected behaviour
In Build and Run Android Chat App -> Build the Android Archive
The command sh scripts/build_android_library.sh should report success.
Workaround
First run
export ANDROID_SDK=$ANDROID_HOME and then run sh scripts/build_android_library.sh which will now succeed.
Note that scripts/build_android_library.sh references the ANDROID_SDK environment variable. This variable has been deprecated for so long that even its replacement (ANDROID_SDK_ROOT) has been deprecated.
It would therefore be preferable to fix the script.
Environment
macOS 15.7.1
MacBook Pro 16" 2021
Apple M1 Pro 32GB