Closed adamblack closed 5 months ago
I would like just add some more info. There is rn-indy-sdk
mentioned in the description, so I just want to clarify it's just React Native wrapper around indy-sdk Android and iOS wrapper in this repo https://github.com/AbsaOSS/rn-indy-sdk.
I am running into the same issue and getting the same error from Android Studio. I'm currently using "react-native": "0.63.2"
.
The issue was introduced with 0.62.0. It works with 0.61.5. @khagesh @vinnyhoward
According to logs, it seems like the problem happens at this line https://github.com/hyperledger/indy-sdk/blob/master/libindy/src/services/pool/networker.rs#L334.
Also worth mentioning that it works on iOS (tested with RN 0.62.0
)
Thanks, @jakubkoci for the report and investigation. You are correct that zmq_connect
lead to the crash.
2020-09-11 11:18:36.543 28654-28654/? A/DEBUG: #08 pc 0000000000bcede0 /data/app/za.co.absa.identity-g-kBtLJkIiy5lONScXOHNw==/lib/arm64/libvcx.so (_ZNSt6__ndk124__put_character_sequenceIcNS_11char_traitsIcEEEERNS_13basic_ostreamIT_T0_EES7_PKS4_m+368) 2020-09-11 11:18:36.543 28654-28654/? A/DEBUG: #09 pc 0000000000bca83c /data/app/za.co.absa.identity-g-kBtLJkIiy5lONScXOHNw==/lib/arm64/libvcx.so (_ZNSt6__ndk1lsIcNS_11char_traitsIcEENS_9allocatorIcEEEERNS_13basic_ostreamIT_T0_EES9_RKNS_12basic_stringIS6_S7_T1_EE+368) 2020-09-11 11:18:36.543 28654-28654/? A/DEBUG: #10 pc 0000000000bca030 /data/app/za.co.absa.identity-g-kBtLJkIiy5lONScXOHNw==/lib/arm64/libvcx.so (_ZNK3zmq9address_t9to_stringERNSt6__ndk112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE+2344) 2020-09-11 11:18:36.543 28654-28654/? A/DEBUG: #11 pc 0000000000c45830 /data/app/za.co.absa.identity-g-kBtLJkIiy5lONScXOHNw==/lib/arm64/libvcx.so (_ZN3zmq13socket_base_t7connectEPKc+9356) 2020-09-11 11:18:36.543 28654-28654/? A/DEBUG: #12 pc 0000000000c857fc /data/app/za.co.absa.identity-g-kBtLJkIiy5lONScXOHNw==/lib/arm64/libvcx.so (zmq_connect+60)
In React Native 0.62.0 have been changed one of system libraries libfb.so -> libfbjni.so: https://github.com/facebook/react-native/commit/9ad5e72b77013083f925108870ea6b17f4711a1d
Internallly zmq_connect
calls _ZNSt6__ndk124__put_character_sequenceIcNS_11char_traitsIcEEEERNS_13basic_ostreamIT_T0_EES7_PKS4_m
function which actually leads to zmq_connect crash. For react < 0.62 it was taken from libfb.so
but for react >=0.62 is taken from libfbjni.so
.
Also, they are using NDK of the 21 version. Libindy is build using NDK 20.
As I understand @khagesh has already seen a similar crash during some of the past React updates when LIbindy was build using NDK 16 and gnustl.
It looks like we need to rebuild Libindy dependencies again.
I'm curious if there is any update on this? 👀
@TimoGlastra Sorry, we don't have any fix yet. We are tackling another issue internally. But this issue is definitely a priority for us. We are hoping to get started on this issue very soon. Sorry for not providing exact time.
We also have few of our apps written in react-native. So, this issue is one of the priority for us as well. We will update here once we start working on this issue.
Are there any updates regarding this issue?
@mikaeljan we have a client implementation that is using RN 0.63.3 currently--although we need to do some additional investigating as to the exact details that has enabled this capability (as we were not the developers that achieved this). This hopefully/likely is something that we can further dig into shortly.
Have an update here on this--after some digging from @TheTreek and I, we identified that running Android with Hermes enables successful opening of the pool (at least we've tested for React Native v0.63.3 and v0.64.1). Here is an the example project that was used for testing: https://github.com/TheTreek/rn-indy-demo And a branch that we'll be doing a PR to Aries Bifold shortly: https://github.com/Indicio-tech/aries-mobile-agent-react-native/tree/feature/upgradeRN
Interestingly it also works when running in debug mode (using Chrome's engine), which leads me to believe that Hermes is either doing a compile step or causing a side affect of sorts (although I'm not sure as of what). This does make me a little concerned for longer-term resolution, however it will at least if nothing else get us able to use v0.64.1 of React Native.
Another option is utilizing Indy-VDR as a proxy server for ledger operations. I was considering using it as an on-device replacement to switch to for ledger operations, which does help reduce our dependency on Indy SDK, but as far as I know Indy VDR is also unfortunately utilizing ZMQ--which doesn't end up solving this problem.
Thanks for this @JamesKEbert and @TheTreek! I can confirm this works in RN 0.64.0. Really great work, and thanks for looking into this! :)
I ran into this issue again in our app. It crashed whenever you opened a pool. After a lot of adding and removing stuff I came to the conclusion that is was because we had updated flipper from 0.75.1 to 0.98.0 in gradle.properties
. I'm not sure what the reason is, or if any versions between 0.75.1 and 0.98.0 will work, but I'll stay at 0.75.1 for now :)
Maybe I can save some of you some headaches with this
# Version of flipper SDK to use with React Native
-FLIPPER_VERSION=0.75.1
+FLIPPER_VERSION=0.98.0 // don't do this
Yeah, I had found issues in regards to Flipper--in fact this issue was completely solved in an unrelated ZMQ RN project via removal of Flipper: https://github.com/LNP-BP/react_native_demo/issues/1#issuecomment-657206277
I have new findings. Unfortunately, it won't solve anything, but I just want to add it here for information:
App with React Native 0.64.2
also crashes with ZMQ error when you set the following flag in AndroidManifest.xml
file:
android:extractNativeLibs="true"
You can find more info about the flag at https://developer.android.com/studio/releases/gradle-plugin#extractNativeLibs. The trick is that this flag was in previous version of Android Gradle plugin set to true
by default, they changed it in version 3.6.0
, which is used by a higher version of RN (I assume), therefore update of React Native seemed to solve the issue but it actually didn't.
Is there any update on this ?
@erenakyildiz-code see this comment: https://github.com/hyperledger/indy-sdk/issues/2346#issuecomment-841000640
It works if you enable hermes on Android. It's not a fix per se, but we've all switched to using Hermes
I see, i will post a pr to rn-indy-sdk library to change the example demo project. Thanks for the response.
rn-indy-sdk has been deprecated in favour of https://github.com/hyperledger/indy-sdk-react-native, but a PR to that repo would be much appreciated!
Hello,
we are having issues with indy-sdk on React native, Android - issue does not depend on the device.
This is our deps setup for example project:
RN wrapper uses these methods:
And this dependency for indy:
implementation 'org.hyperledger:indy:1.15.0'
We also opened an issue for RN at: https://github.com/react-native-community/upgrade-support/issues/114
Issue is not reproducible on 0.61.x RN version. Below you can find our logs. It seems to us it might be connected to zmq somehow. We are thinking about making our custom build of indy-sdk with a different version of zmq which might somehow help us however it would be better to fix this issue in official repo, not just in a forked one.