exception '-[nsnull absolutestring] was thrown while invoking getinitialurl on target linkingmanager - react-native

Full error thrown:
[fatal][tid:com.facebook.react.linkingmanagerqueue]
exception '-[nsnull absolutestring]: unrecognized selector sent to instance 0x10d8b5ea8'
was thrown while invoking getinitialurl on target linkingmanager with params (
626, 627
)
I am stuck, and have no idea what this error means and how to solve it.
I have ejected to ExpoKit, and am trying to add react-native-fbsdk to my project.
I have followed the instructions laid out here: https://github.com/facebook/react-native-fbsdk, and the android build went just fine.
After following the instructions for ios (except that I did pod install), and this error appeared.
I really would appreciate any help, thank you!

Related

Unable to get the source file of an error on react-native

I am debugging an application that throws me the error of
ERROR Error: Invalid hook call. Hooks can only be called inside of the body of a
function component. This could happen for one of the following reasons:
1. You might have mismatching versions of React and the renderer (such as React DOM)
2. You might be breaking the Rules of Hooks
3. You might have more than one copy of React in the same app
See react-invalid-hook-call for tips about how to debug and fix this problem.
[Fri Oct 23 2020 09:04:14.325] ERROR Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication)
But it doesn't say where is the source file of the error... since it is a big application I am having trouble finding where this error is located.
I am able to compile the application but the error happens on the initialization.
When I run the debugger it says the following on the developers console...
Unable to symbolicate stack trace: The stack is null
Plus the previous errors.
Any idea how I could locate the source file of this errors?
Thank you for your help!

deferredCurrentActivation fatal exception

I'm suddenly seeing the following on Crashlytics for a macOS app, and this seems to happen only on macOS 10.14. I have no idea what this is. What's deferredCurrentActivation and how do I avoid this? Anyone else seen this?
Fatal Exception: NSInternalInconsistencyException
deferredCurrentActivation already set when we got another deferred activate event

Debugging a React Native crash in release

I'm using react-native-tcp and am experiencing a crash on Android that I'm unable to debug. Unfortunately, this only happens in release.
The stack trace I get is as follows:
E/AndroidRuntime: FATAL EXCEPTION: mqt_native_modules
Process: com.xx.xx, PID: 22986
com.facebook.react.common.JavascriptException: unable to find socket, stack:
d#664:708
_onError#664:4582
<unknown>#664:3790
value#77:1364
value#53:2778
<unknown>#53:1013
<unknown>#53:106
value#53:985
at com.facebook.react.modules.core.ExceptionsManagerModule.showOrThrowError(ExceptionsManagerModule.java:99)
at com.facebook.react.modules.core.ExceptionsManagerModule.reportFatalException(ExceptionsManagerModule.java:83)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.facebook.react.bridge.BaseJavaModule$JavaMethod.invoke(BaseJavaModule.java:345)
at com.facebook.react.cxxbridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:136)
at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31)
at android.os.Looper.loop(Looper.java:145)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:196)
at java.lang.Thread.run(Thread.java:818)
Now, the Javascript stack trace is pretty cryptic (presumably due to minification and bundling), but it helpfully includes _onError, which in react-native-tcp is implemented as follows:
TcpSocket.prototype._onError = function(error: string): void {
this._debug('received', 'error');
this.emit('error', normalizeError(error));
this.destroy();
};
The normalizeError call above maps to the d function in the stacktrace. I know this because I examined the bundled file generated during a build.
I understand why my code flow leads to an unable to find socket event, but what I don't understand is how this event eventually leads to an application crash. If it helps, this event is generated in the native (Android) component of react-native-tcp and propagates into the JS side.
I expected such an event to be reported to the listeners (if any) rather than crash the application.
Is it possible that events reported via React Native lead to a crash in some conditions - e.g. if there are no listeners, or if the event is an Error object, or something else?
How would I go about debugging this, given that it happens only in release?
I was unable to find an efficient debugging technique, but was able to debug the issue I had with good ol' prints.
The problem was that NodeJS (and apparently also React Native) have a behavior which I found peculiar: when an error event is emitted and there is no error listener, an unhandled exception is thrown. This is documented in the NodeJS documentation:
When an error occurs within an EventEmitter instance, the typical action is
for an 'error' event to be emitted. These are treated as special cases
within Node.js.
If an EventEmitter does not have at least one listener registered for the
'error' event, and an 'error' event is emitted, the error is thrown, a stack
trace is printed, and the Node.js process exits.
const myEmitter = new MyEmitter();
myEmitter.emit('error', new Error('whoops!'));
// Throws and crashes Node.js
My problem is that I was removing the error listener in my code, because of a react-native-tcp issue that causes the error callback to be called twice when connect fails because no one is listening on the port.

NSInvalidArgumentException using SFML on macOS

I am trying to build the Pong example that is distributed with SFML. I am using the latest macOS.
The code compiles, however when I launch I get the following error:
pong[14920:316603] ***
Terminating app due to uncaught exception
'NSInvalidArgumentException', reason:
'-[SFOpenGLView updateCursorGrabbed]: unrecognized selector sent to instance 0x7fa02948e890'
...
I am not familiar with Objective-C/C++, so I have the following questions:
What does this error mean?
How do I know what the valid NS arguments are?
Why is SFML trying to use invalid arguments; do I need to update?

React-Native: _reactNativeFacebookLogin.FBLoginManager.loginWithPermissions is undefined

Im trying to implement this Facebook-SDK for React-Native.
I followed the steps in the README guide but cannot get it to Work.
Every time i try to log in with Facebook I get the following error message:
EDIT: Im running the a signed APK
EDIT2: The error does only happen with the signed APK - what could that mean?
undefined is not a function (evaluating '_reactNativeFacebookLogin.FBLoginManager.loginWithPermissions')
Unable to symbolicate stack trace: Bundle was not loaded from the packager
FATAL EXCEPTION: mqt_native_modules
Process: com.solopro.dogwood, PID: 5018
com.facebook.react.modules.core.JavascriptException: undefined is not a function (evaluating '_reactNativeFacebookLogin.FBLoginManager.loginWithPermi
ssions'), stack:
facebookLogin#76454:62
touchableHandlePress#52180:39
_performSideEffectsForTransition#21343:26
_receiveSignal#21259:38
touchableHandleResponderRelease#21033:20
invokeGuardedCallback#15044:12
executeDispatch#14877:38
executeDispatchesInOrder#14900:16
executeDispatchesAndRelease#14354:42
executeDispatchesAndReleaseTopLevel#14365:35
forEachAccumulated#15179:12
processEventQueue#14527:19
runEventQueueInBatch#15204:33
handleTopLevel#15215:21
<unknown>#14147:39
perform#16143:16
batchedUpdates#31745:20
batchedUpdates#15373:32
_receiveRootNodeIDEvent#14146:28
receiveTouches#14208:48
__callFunction#7706:28
<unknown>#7613:22
guard#7564:3
callFunctionReturnFlushedQueue#7612:6
at com.facebook.react.modules.core.ExceptionsManagerModule.showOrThrowError(ExceptionsManagerModule.java:90)
at com.facebook.react.modules.core.ExceptionsManagerModule.reportFatalException(ExceptionsManagerModule.java:78)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.facebook.react.bridge.BaseJavaModule$JavaMethod.invoke(BaseJavaModule.java:319)
at com.facebook.react.bridge.NativeModuleRegistry$ModuleDefinition.call(NativeModuleRegistry.java:187)
at com.facebook.react.bridge.NativeModuleRegistry.call(NativeModuleRegistry.java:62)
at com.facebook.react.bridge.CatalystInstanceImpl$NativeModulesReactCallback.call(CatalystInstanceImpl.java:432)
at com.facebook.react.bridge.queue.NativeRunnableDeprecated.run(Native Method)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31)
at android.os.Looper.loop(Looper.java:135)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:193)
at java.lang.Thread.run(Thread.java:818)
Maybe this is even a known issue.
UPDATE:
The error is pointing out the function "loginWithPermissions" which is not even available in the android package of react-native-fbsdk but only in the iOS package.
I have no idea why this function is being used.
I am using LoginManager.logInWithReadPermissions(['public_profile', 'email']).then(...) for the FB-Login
Most likely the questioner had overcome this issue.
Sometimes, if some Facebook libraries (like fbjs/lib/invariant) are used in development process, the related lines must be marked as comment line before building the release apk.