Docs index: /llms.txt · every page as Markdown: add .md

‹ Platforms

Android troubleshooting

Fix Android SDK errors from Gradle, the secret and the device.

SymptomCauseFix
Expression2Exception from create() naming the API secretno secret setcall Expression2Credential.set(secret) before fetch() and create()
MeteringRefused on the first Essence 2 pull()no secret setcall Essence2Credential.set(secret) before fetch() and create()
Essence2StoreException from fetch()no secret was set when the store downloadedcall Essence2Credential.set(secret) before fetch()
Expression 2 renders slowly; acceleratorNote says no libQnnTFLiteDelegate.sothe accelerator runtime was excluded, or legacy packaging is offkeep the dependency whole and set useLegacyPackaging = true
The first Expression 2 create() after install is slowthe accelerator prepares the decoder once and keeps it; later launches reuse itcreate on a background thread at app start; only the first launch after install pays it (and again after an SDK or OS update)
Download refused with 401the avatar is privateset its owner’s API secret with Expression2Credential.set or Essence2Credential.set
409 MODEL_NOT_GENERATED on downloadthe agent has no model of that kind yetadd the model, then retry
Could not find ai.bithuman:expression2-android:… (or essence2-android)bitHuman’s Maven repository is not in the build’s repositoriesadd the exclusiveContent block for https://maven.bithuman.ai to settings.gradle.kts, as in Install
Manifest merge fails on minSdkessence2-android needs minSdk 29raise the module to 29
Unresolved reference: BuildConfigthe Android Gradle Plugin turns BuildConfig off by defaultadd buildFeatures { buildConfig = true }
Unresolved reference 'MeteredDoorResolver'the resolver’s public name is Essence2MeteredDoorResolveryou rarely need it: Essence2Credential.set(secret) covers downloads. To pass a secret explicitly: import ai.bithuman.essence2.Essence2MeteredDoorResolver, then Essence2ModelStore(context, urlResolver = Essence2MeteredDoorResolver(secret))
Gradle stops with What went wrong: followed only by a Java version number (such as 25.0.4.1)Gradle 8.11 cannot run on that JDKset JAVA_HOME to JDK 17 or 21 and build again
The session is refused although you set a secretBuildConfig.BITHUMAN_API_SECRET is emptyset bithuman.apiSecret in local.properties or BITHUMAN_API_SECRET, then rebuild
UnsatisfiedLinkError on an emulatorthe engines are arm64-v8a onlyrun on a physical arm64 handset