Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions examples/demo-apps/android/LlamaDemo/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ plugins {
id("org.jetbrains.kotlin.android")
}

val qnnVersion: String? = project.findProperty("qnnVersion") as? String

android {
namespace = "com.example.executorchllamademo"
compileSdk = 34
Expand Down Expand Up @@ -61,6 +63,9 @@ dependencies {
implementation("com.google.android.material:material:1.12.0")
implementation("androidx.activity:activity:1.9.0")
implementation("org.json:json:20250107")
if (!qnnVersion.isNullOrEmpty()) {
implementation("com.qualcomm.qti:qnn-runtime:$qnnVersion")
}
testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.1.5")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,8 @@ sh examples/demo-apps/android/LlamaDemo/setup-with-qnn.sh
This is running the shell script which configures the required core ExecuTorch, Llama2/3, and Android libraries, builds them into AAR, and copies it to the app.
Note: If you are building the Android app mentioned in the next section on a separate machine (i.e. MacOS but building and exporting for QNN backend on Linux), make sure you copy the aar file generated from setup-with-qnn script to "examples/demo-apps/android/LlamaDemo/app/libs" before building the Android app.

6. Set up the correct QNN version in gradle rule
Currently, the gralde rule searches for the property `qnnVersion`. When this variable is defined, it will add QNN runtime library to the dependency. To use it, append the string `qnnVersion=<version>` (ex. `qnnVersion=2.37.0`) to the end of the `gradle.properties` file.

## Run the Android Demo App

Expand Down
Loading