Comments (16)
@cortinico can confirm that I have run into this. I meant to reach out about it but I wanted to investigate myself first as it doesn't repro reliably and I'm not sure of the cause
from react-native.
It seems this issue is still present in 0.74.1 (tried also 0.74.1-rc.0)
Unhandled SoftException
com.facebook.react.bridge.ReactNoCrashSoftException: Tried to access onWindowFocusChange while context is not ready
at com.facebook.react.runtime.ReactHostImpl.onWindowFocusChange(ReactHostImpl.java:664)
at com.facebook.react.ReactDelegate.onWindowFocusChanged(ReactDelegate.java:193)
at com.facebook.react.ReactActivityDelegate.onWindowFocusChanged(ReactActivityDelegate.java:175)
at com.facebook.react.ReactActivity.onWindowFocusChanged(ReactActivity.java:128)
at androidx.appcompat.view.WindowCallbackWrapper.onWindowFocusChanged(WindowCallbackWrapper.java:125)
at com.android.internal.policy.DecorView.onWindowFocusChanged(DecorView.java:1810)
at android.view.View.dispatchWindowFocusChanged(View.java:16171)
at android.view.ViewGroup.dispatchWindowFocusChanged(ViewGroup.java:1510)
at android.view.ViewRootImpl.dispatchFocusEvent(ViewRootImpl.java:4283)
at android.view.ViewRootImpl.handleWindowFocusChanged(ViewRootImpl.java:4187)
at android.view.ViewRootImpl.-$$Nest$mhandleWindowFocusChanged(Unknown Source:0)
at android.view.ViewRootImpl$ViewRootHandler.handleMessageImpl(ViewRootImpl.java:6315)
at android.view.ViewRootImpl$ViewRootHandler.handleMessage(ViewRootImpl.java:6223)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loopOnce(Looper.java:232)
at android.os.Looper.loop(Looper.java:317)
at android.app.ActivityThread.main(ActivityThread.java:8501)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:878)
from react-native.
I see the same error in 0.74.1 as well.
Unable to match the desired swap behavior.
Unable to match the desired swap behavior.
Unhandled SoftException
com.facebook.react.bridge.ReactNoCrashSoftException: Tried to access onWindowFocusChange while context is not ready
at com.facebook.react.runtime.ReactHostImpl.onWindowFocusChange(ReactHostImpl.java:674)
at com.facebook.react.ReactDelegate.onWindowFocusChanged(ReactDelegate.java:194)
at com.facebook.react.ReactActivityDelegate.onWindowFocusChanged(ReactActivityDelegate.java:175)
at com.facebook.react.ReactActivity.onWindowFocusChanged(ReactActivity.java:128)
at androidx.appcompat.view.WindowCallbackWrapper.onWindowFocusChanged(WindowCallbackWrapper.java:125)
at com.android.internal.policy.DecorView.onWindowFocusChanged(DecorView.java:1788)
at android.view.View.dispatchWindowFocusChanged(View.java:15933)
at android.view.ViewGroup.dispatchWindowFocusChanged(ViewGroup.java:1509)
at android.view.ViewRootImpl.dispatchFocusEvent(ViewRootImpl.java:4059)
at android.view.ViewRootImpl.handleWindowFocusChanged(ViewRootImpl.java:3963)
at android.view.ViewRootImpl.-$$Nest$mhandleWindowFocusChanged(Unknown Source:0)
at android.view.ViewRootImpl$ViewRootHandler.handleMessageImpl(ViewRootImpl.java:5954)
at android.view.ViewRootImpl$ViewRootHandler.handleMessage(ViewRootImpl.java:5862)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:205)
at android.os.Looper.loop(Looper.java:294)
at android.app.ActivityThread.main(ActivityThread.java:8177)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:971)
[0518/133752.908692:ERROR:variations_seed_loader.cc(37)] Seed missing signature.
from react-native.
I have the same issue but this is from RN as AAR and uploaded to the Android native
Unhandled SoftException com.facebook.react.bridge.ReactNoCrashSoftException: Tried to access onWindowFocusChange while context is not ready at com.facebook.react.runtime.ReactHostImpl.onWindowFocusChange(ReactHostImpl.java:674) at com.facebook.react.ReactDelegate.onWindowFocusChanged(ReactDelegate.java:194) at com.facebook.react.ReactActivityDelegate.onWindowFocusChanged(ReactActivityDelegate.java:175) at com.facebook.react.ReactActivity.onWindowFocusChanged(ReactActivity.java:128) at androidx.appcompat.view.WindowCallbackWrapper.onWindowFocusChanged(WindowCallbackWrapper.java:125) at com.android.internal.policy.DecorView.onWindowFocusChanged(DecorView.java:2320) at android.view.View.dispatchWindowFocusChanged(View.java:16490) at android.view.ViewGroup.dispatchWindowFocusChanged(ViewGroup.java:1517) at android.view.ViewRootImpl.dispatchFocusEvent(ViewRootImpl.java:5003) at android.view.ViewRootImpl.handleWindowFocusChanged(ViewRootImpl.java:4887) at android.view.ViewRootImpl.-$$Nest$mhandleWindowFocusChanged(Unknown Source:0) at android.view.ViewRootImpl$ViewRootHandler.handleMessageImpl(ViewRootImpl.java:7150) at android.view.ViewRootImpl$ViewRootHandler.handleMessage(ViewRootImpl.java:7051) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loopOnce(Looper.java:230) at android.os.Looper.loop(Looper.java:319) at android.app.ActivityThread.main(ActivityThread.java:8893) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:608) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103)
from react-native.
ac3261f
I think it will be merge in the future.
from react-native.
Missing Reproducible Example | |
---|---|
ℹ️ | We could not detect a reproducible example in your issue report. Please provide either:
|
from react-native.
@NiuGuohui Just to confirm, you're on New Architecture right?
from react-native.
@NiuGuohui Just to confirm, you're on New Architecture right?
I tried again. Now AppState seems to be working properly. But I found that this error still occurs when enable bridgeless, and after disabled bridgeless, it no longer reports an error.
from react-native.
@cortinico can confirm that I have run into this. I meant to reach out about it but I wanted to investigate myself first as it doesn't repro reliably and I'm not sure of the cause
Great thanks for confirming it 👍
from react-native.
@alanjhughes @NiuGuohui can we isolate what's the problem here?
I've tried to reproduce, and yes, the:
Unhandled SoftException
com.facebook.react.bridge.ReactNoCrashSoftException: Tried to access onWindowFocusChange while context is not ready
gets fired but that's unrelated. I was able to successfully use the AppState
API with the provided reproducer.
repro.mov
from react-native.
@alanjhughes @NiuGuohui can we isolate what's the problem here?
I've tried to reproduce, and yes, the:
Unhandled SoftException com.facebook.react.bridge.ReactNoCrashSoftException: Tried to access onWindowFocusChange while context is not ready
gets fired but that's unrelated. I was able to successfully use the
AppState
API with the provided reproducer.repro.mov
I think AppState
works fine now.
But the error still occurred.
I tried to open ReactHostImpl.class (the built-in decompilation tool in Android Studio) and noticed that it seems not quite consistent with the code in the repository. I'm not sure if this decompiled code is reliable for reference.
This is my decompiled ReactHostImpl.class content:
@ThreadConfined("UI")
public void onWindowFocusChange(boolean hasFocus) {
String method = "onWindowFocusChange(hasFocus = \"" + hasFocus + "\")";
this.log(method);
ReactContext currentContext = this.getCurrentReactContext();
if (currentContext != null) {
currentContext.onWindowFocusChange(hasFocus);
}
ReactSoftExceptionLogger.logSoftException("ReactHost", new ReactNoCrashSoftException("Tried to access onWindowFocusChange while context is not ready"));
}
from react-native.
I tried to open ReactHostImpl.class (the built-in decompilation tool in Android Studio) and noticed that it seems not quite consistent with the code in the repository. I'm not sure if this decompiled code is reliable for reference.
That's because you're looking at the class in main
while you should be looking at the same class on the 0.74-stable branch:
@alanjhughes what was the error you were facing?
from react-native.
@cortinico its this error but it's only happening on app launch and not every time. Kudo reproduced in a RN project without expo. I'll speak to him today and see if he found a reliable way to reproduce.
from react-native.
I tried to open ReactHostImpl.class (the built-in decompilation tool in Android Studio) and noticed that it seems not quite consistent with the code in the repository. I'm not sure if this decompiled code is reliable for reference.
That's because you're looking at the class in
main
while you should be looking at the same class on the 0.74-stable branch:
So, should an else
or return
statement be added to line 664 in 0.74-stable ReactHostImpl.java?
from react-native.
I tried to open ReactHostImpl.class (the built-in decompilation tool in Android Studio) and noticed that it seems not quite consistent with the code in the repository. I'm not sure if this decompiled code is reliable for reference.
That's because you're looking at the class in
main
while you should be looking at the same class on the 0.74-stable branch:
0.74-stable
/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactHostImpl.javaSo, should an
else
orreturn
statement be added to line 664 in 0.74-stable ReactHostImpl.java?
We could pick ac3261f on the 0.74 release branch that would solve this
from react-native.
This will be picked in 0.74.2 here:
from react-native.
Related Issues (20)
- newArchEnabled=true not working on android HOT 2
- java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "__emutls_get_address" referenced by "/data/app/~~Q1vjL-Sbogpgp23q4KuiUA==/com.vastmindz-2Qq1zN8YfrsoxWIi-B5xZQ==/base.apk!/lib/arm64-v8a/libfolly_runtime.so"... HOT 6
- [v0.74] Android: Promises from native modules stuck HOT 5
- [v0.74.1]Cursor prop is causing crash on Text HOT 2
- TextInput (IOS) : maxLength & multiline true = onChangeText multiple call HOT 4
- 2 files found with path 'lib/arm64-v8a/libopencv_java4.so' from inputs: - /Users/wegile-1003/.gradle/caches/transforms-3/8ec77b58992a0a620e60c240eaed7c29/transformed/jetified-rppg_core-0.2.0/jni/arm64-v8a/libopencv_java4.so - /Users/wegile-1003/.gradle/caches/transforms-3/a576edfdc1ae89d711e78c8d27ec535b/transformed/jetified-opencv-android-4.1.2/jni/arm64-v8a/libopencv_java4.so If you are using jniLibs and CMake IMPORTED targets, see HOT 4
- No visible error is shown on iOS Bridgeless when there is an error before `AppRegistry.registerComponent` HOT 1
- yarn ios error ! error Could not find scheme greenhouse. Please make sure the schema you want to run exists. HOT 3
- App Crashes When Hermes is Disabled on Some Android 10 Devices `couldn't find DSO to load: libhermes.so SoSource` HOT 4
- React Query isStale is not working after upgrading react-native to 0.74 HOT 1
- In Android touchMove is cancelled when intercepted by native gesture from child HOT 3
- Zoom in & reset shortcuts are broken on experimental debugger HOT 3
- Library not loaded: '@rpath/FBLPromises.framework/FBLPromises' Referenced from HOT 4
- Socket Rocket Upgrade to 0.7.0 in react native version 0.73 HOT 4
- Image .gif frame timing off-by-one error in iOS HOT 2
- Pressable gets stuck under the new architecture HOT 2
- How to run react native custom library inside react native project without publishing to npm? Local setup steps are not working. HOT 3
- NSInvalidArgumentException __76-[RCTModalHostViewManager presentModalHostView:withViewController:animated:]_block_invoke.38 Application tried to present modally a view controller <RCTModalHostViewController: 0x7fcf53855110> that is already being presented by <UIViewController: 0x7fcf4791 HOT 7
- UI problem with iOS floating keyboard in iPad - 0.73.7 HOT 4
- React-Codegen Error when build iOS HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native.