You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On a Samsung Galaxy S25 (SM-S931B), calling checkStatus() immediately after constructing the GenerativeModel throws a raw, unhandled NullPointerException from R8-minified internal code, instead of returning a FeatureStatus or throwing a GenAiException. This looks like a construction-timing race: building the client earlier, so there's a gap before the first checkStatus() call, avoids the NPE entirely.
0.release.qc.prod_aicore_20260723.00_RC11.964081323 (versionCode 494422), last updated 2026-08-19
com.samsung.android.aicore
3.0.02.7 (versionCode 300207510), last updated 2026-06-07
genai-prompt tested
1.0.0-beta2 and 1.0.0-beta4, both fail identically
Steps to reproduce
val model =Generation.getClient(generationConfig {})
model.checkStatus() // suspend fun, throws here
No ModelConfig overrides, default config only.
Actual behavior
java.lang.NullPointerException
at java.util.Objects.throwNullPointerException(Objects.java:504)
at java.util.Objects.requireNonNull(Objects.java:222)
at ba0.<init>(...)
at ea0.a(...)
at p7.b(...)
at fa0.a(...)
at ce0.<init>(...)
at yf.a(...)
at ot.a(...)
at f4.g(...)
at t2.resumeWith(...)
at k9.run(...)
at android.os.Handler.handleCallback(Handler.java:1070)
...
(Class names are R8-obfuscated per build and differ between the beta2/beta4 runs, but the shape, Objects.requireNonNull failing inside an internal object's <init>, is identical both times.)
Expected behavior
checkStatus() should return a FeatureStatus, or at worst throw a well-typed GenAiException, not an unhandled NPE, regardless of how soon after construction it's called.
Additional context
Workaround: construct the client earlier, well before the first checkStatus() call, matching this repo's OpenPromptActivity sample, which naturally has a gap between construction and the first status check. With that change, the NPE stops reproducing on the same device and checkStatus() resolves normally.
This is consistent with a race in AICore's internal service-binding init on first contact.
Also resembles [GenAI Prompt API] "Null getService" on Galaxy S26 (SLSI2600) - Unexpected feature type: 1 #1021 ("Null getService" on Galaxy S26/SLSI2600), reported fixed in an AICore release around end of April 2026. Both AICore packages on this device postdate that fix, so this looks like either a separate, still-unpatched variant, or something specific to Samsung's own com.samsung.android.aicore layer.
Happy to pull more logs or try a minimal repro project if useful.
Summary
On a Samsung Galaxy S25 (SM-S931B), calling
checkStatus()immediately after constructing theGenerativeModelthrows a raw, unhandledNullPointerExceptionfrom R8-minified internal code, instead of returning aFeatureStatusor throwing aGenAiException. This looks like a construction-timing race: building the client earlier, so there's a gap before the firstcheckStatus()call, avoids the NPE entirely.Environment
BP4A.251205.006.S931BXXSBCZG3, SDK 36com.google.android.aicore0.release.qc.prod_aicore_20260723.00_RC11.964081323(versionCode 494422), last updated 2026-08-19com.samsung.android.aicore3.0.02.7(versionCode 300207510), last updated 2026-06-07genai-prompttested1.0.0-beta2and1.0.0-beta4, both fail identicallySteps to reproduce
No
ModelConfigoverrides, default config only.Actual behavior
(Class names are R8-obfuscated per build and differ between the beta2/beta4 runs, but the shape,
Objects.requireNonNullfailing inside an internal object's<init>, is identical both times.)Expected behavior
checkStatus()should return aFeatureStatus, or at worst throw a well-typedGenAiException, not an unhandled NPE, regardless of how soon after construction it's called.Additional context
checkStatus()call, matching this repo'sOpenPromptActivitysample, which naturally has a gap between construction and the first status check. With that change, the NPE stops reproducing on the same device andcheckStatus()resolves normally.com.samsung.android.aicorelayer.