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
The asset package relies on golang.org/x/mobile/internal/mobileinit package's Context.
The mobileinit.Context is valid only after JavaVM and android.context.Context are set through the mobileinit.SetContext.
mobileinit.SetContext is called when the libgojni is first loaded.
This is a Java-JNI-cgo-Go call path; the Go runtime initialization and all the init functions must run to execute mobileinit.SetContext.
Calling asset.Open from init() means querying mobileinit.Context before mobileinit.SetContext completes. As a result, invalid java VM and android Context are used, causing a crash.
Either document it properly so access to assets must not happen in init, or fix it.
The asset package relies on golang.org/x/mobile/internal/mobileinit package's Context.
The mobileinit.Context is valid only after JavaVM and android.context.Context are set through the mobileinit.SetContext.
mobileinit.SetContext is called when the libgojni is first loaded.
This is a Java-JNI-cgo-Go call path; the Go runtime initialization and all the init functions must run to execute mobileinit.SetContext.
Calling asset.Open from init() means querying mobileinit.Context before mobileinit.SetContext completes. As a result, invalid java VM and android Context are used, causing a crash.
Either document it properly so access to assets must not happen in init, or fix it.
@crawshaw
The text was updated successfully, but these errors were encountered: