native app has a crash error in Firebase. I only use it on useLinking. Please if you know what the problem is ,I would be very grateful for any advice
Fatal Exception: com.facebook.react.common.JavascriptException: Error: Looks like you have configured linking in multiple places. This is likely an error since deep links should only be handled in one place to avoid conflicts. Make sure that:
- You are not using both 'linking' prop and 'useLinking'
- You don't have 'useLinking' in multiple components
- You have set 'android:launchMode=singleTask' in the '<activity />' section of the 'AndroidManifest.xml' file to avoid launching multiple instances
This error is located at:
in NavigationContainer
in RCTView
in Unknown
in SafeAreaView
in Unknown
in Connect(Component)
in PersistGate
in Provider
in Unknown
in RootApp
in CodePushComponent
in RCTView
in Unknown
in RCTView
in Unknown
in AppContainer, js engine: hermes, stack:
anonymous@1:1161969
flushPassiveEffectsImpl@1:178330
anonymous@1:296362
runWithPriority@1:141995
flushPassiveEffects@1:177886
performSyncWorkOnRoot@1:172359
anonymous@1:142410
anonymous@1:296362
runWithPriority@1:141995
flushSyncCallbackQueueImpl@1:142228
flushSyncCallbackQueue@1:142122
scheduleUpdateOnFiber@1:170233
updateContainer@1:181576
unmountComponentAtNode@1:181798
anonymous@1:191286
unmountApplicationComponentAtRootTag@1:502549
__callFunction@1:118825
anonymous@1:117312
__guard@1:118270
callFunctionReturnFlushedQueue@1:117270
at com.facebook.react.modules.core.ExceptionsManagerModule.reportException(ExceptionsManagerModule.java:83)
at java.lang.reflect.Method.invoke(Method.java)
at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:151)
at com.facebook.react.bridge.queue.NativeRunnable.run(NativeRunnable.java)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)
at android.os.Looper.loop(Looper.java:223)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:226)
at java.lang.Thread.run(Thread.java:923)
______________
----------
// src/navigation/linking.ts
const getLinking = (isLoggedIn: boolean) => {
const linking: LinkingOptions = {
prefixes: [
'https://example.com',
'http://example.com',
'example://'
],
config: {
screens: {
FAQ: {
path: ':lang/page/faq',
exact: true
}
}
},
}
return linking;
}
// App.tsx
const linking = useMemo(() => {
return getLinking(isLoggedIn)
}, [isLoggedIn])
return (
<NavigationContainer linking={linking}>
<RootStackNavigator />
</NavigationContainer>
)