Skip to content

Instructions to Build an Android chat app result in a failed build. #2616

@Nutkey

Description

@Nutkey

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions