Skip to content

[GenAI Prompt API] checkStatus() throws unhandled NullPointerException on Galaxy S25 (SM-S931B) when called immediately after construction #1071

Description

@LukasWestholt

Summary

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.

Environment

Device Samsung Galaxy S25 (SM-S931B), Snapdragon (qcom) variant
Android 16, build BP4A.251205.006.S931BXXSBCZG3, SDK 36
Bootloader locked
com.google.android.aicore 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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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