Conversation
…runtime loads NativeElementBridge.sendNativeEvent called nativeElementWriteEvent unguarded, but the JNI library only loads (and registers that method) lazily with the PHP runtime. A configuration change in the first moments of launch — a rotation, a dark-mode flip — reached onConfigurationChanged first and crashed the app with UnsatisfiedLinkError (seen on a Xiaomi running Android 16, 1.5 s after launch). The event is now dropped instead; PHP reads orientation and appearance fresh when it boots.
Member
|
Does it need to |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What's wrong
On Android, if the phone rotates (or switches dark mode) in the first moments after launch, the app crashes:
Seen on a Xiaomi running Android 16, 1.5 s after launch. It depends on timing, so it's hard to trigger on purpose: turn the phone right as the app opens.
Why
sendNativeEvent()calls a native (C) function. That function only exists once the PHP runtime has loaded, and the runtime loads lazily, a moment after the screen appears. A rotation or dark-mode change that arrives before that point calls a function that isn't there yet.What this does
If the runtime isn't loaded yet, the event is dropped (with a log line) instead of crashing. Nothing is lost: PHP reads the orientation and appearance itself when it starts. One file, iOS untouched.