Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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")
}

def qnnVersion = System.properties['qnnVersion']

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) {
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,9 @@ 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
In app/build.gradle.kts, find the line `def qnnVersion = System.properties['qnnVersion']` and `implementation "com.qualcomm.qti:qnn-runtime:$qnnVersion"`. The gradle variable `qnnVersion` needs to be defined as the QNN SDK version (ex. 2.28). You can replace the line `def qnnVersion = System.properties['qnnVersion']` with `def qnnVersion = '2.28'` locally, or you can add `-DqnnVersion=2.28` when you trigger gradle build.


## Run the Android Demo App

Expand Down
Loading