Skip to content
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

[react-native]: Duplicate symbols when building in Android #116

Closed
genaris opened this issue Mar 10, 2023 · 5 comments
Closed

[react-native]: Duplicate symbols when building in Android #116

genaris opened this issue Mar 10, 2023 · 5 comments

Comments

@genaris
Copy link
Contributor

genaris commented Mar 10, 2023

After updating an app to use aries-askar-react-native@0.1.0-dev.4, I'm getting a build time error in Android regarding duplicate functions:

node_modules/@hyperledger/aries-askar-react-native/cpp/turboModuleUtility.cpp.o' -c ' /[project_dir]node_modules/@hyperledger/aries-askar-react-native/cpp/turboModuleUtility.cpp'
   /[project_dir]/node_modules/@hyperledger/aries-askar-react-native/cpp/turboModuleUtility.cpp:171:12: error: redefinition of 'createReturnValue'
  jsi::Value createReturnValue(jsi::Runtime &rt, ErrorCode code,
             ^
  /[project_dir]/node_modules/@hyperledger/aries-askar-react-native/cpp/turboModuleUtility.cpp:124:12: note: previous definition is here
  jsi::Value createReturnValue(jsi::Runtime &rt, ErrorCode code, int64_t *value) {
             ^
  1 error generated.

When building in an x86_64 PC, after removing one of these functions it also gave a similar error but with the template for int32_t.

Once that is removed, the app runs. However it could lead to issues when building for iOS (for that platform I have another problem, but that's another story 😆 ).

@TimoGlastra
Copy link
Member

Hmm, is there actually duplicate definitions here?

@genaris
Copy link
Contributor Author

genaris commented Mar 10, 2023

Hmm, is there actually duplicate definitions here?

Not literally, but it seems that for it int_64t * is equivalent to intptr_t * so it thinks it's a duplicate function prototype.

@dviejokfs
Copy link

@genaris

Could you let me know what you did to resolve it?

I was able to run it but got this runtime error:
image

@genaris
Copy link
Contributor Author

genaris commented Mar 11, 2023

@genaris

Could you let me know what you did to resolve it?

I was able to run it but got this runtime error

I'm using it actually through aries-framework-javascript, so maybe there is something different in the way the module is initialized between my setup and yours. I haven't seen an error like that during this (long) journey though.

Just for info I attach the patch I did to make it build in Android. Curiously it works in iOS as well with those functions commented.

@hyperledger+aries-askar-react-native+0.1.0-dev.4.patch

@TimoGlastra
Copy link
Member

This is fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants