-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Errors on Android don't have a message: Unknown std::runtime_error error
#382
Comments
cc @Szymon20000 |
Actually this is a react-native bug, not a Nitro bug. It can be reproduced in a blank new react-native 0.76 or 0.77 app. facebook/react-native#48027 |
Since this is a RN bug, do you know any issue number/link on their repo that tracks this? |
yea see my comment directly above yours |
I don't know how I missed that... sorry. Thanks for the reply. |
this also show on ios platform with [email protected]
|
@iwater i cannot reproduce this on iOS - which Nitro version? can you reproduce this in the NitroExample app here? |
0.20.1,I just use template folder code as library template and add Math code from doc, then got that error message , I just put that code on https://github.com/iwater/react-native-nitro-crypto2 |
sorry, I just create a new project, it can show detail error message now. |
Is
The Kotlin class is: package com.margelo.nitro.math
class HybridMath : HybridMathSpec() {
override val memorySize = 0L
override fun throwError() {
throw Error("THIS IS ERROR!")
}
} |
Yup, same story here. Unfortunately caused by the new SoLoader merging changes introduced in RN 0.76. Not sure if this only affects Nitro Modules or also (C++) TurboModules as well. @Nlcke If you can try what @cortinico suggested in this comment, that would be a huge help. |
Has this been confirmed as being the root cause? |
Not 100%, no. Should've phrased this differently. |
What's happening?
On Android, errors / exceptions don't have a proper message, and always resort to
Unknown T error
(e.g.Unknown std::runtime_error error
) instead of using it's message (what()
).The same goes for
Promise<T>
.I can't really figure out why this is happening - my best guess is that there is some ABI issue with the libc++ standard used by Android NDK, and since errors in Nitro are implemented using
std::exception_ptr
, the methodscurrent_exception()
/rethrow_exception(..)
are broken in Android.I created an issue in the react-native repo: facebook/react-native#48027
Reproduceable Code
Relevant log output
iOS ✅:
Android ❌:
MyHybrid.someFunc() threw an unknown std::runtime_error error.
Device
Huawei P10
Nitro Modules Version
0.18.1
Nitrogen Version
0.18.1
Can you reproduce this issue in the Nitro Example app here?
Yes, I can reproduce the same issue in the Example app here
Additional information
The text was updated successfully, but these errors were encountered: