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

Issue with react-native-sodium blocks Android builds with latest Gradle version #27

Open
kaxline opened this issue Jun 4, 2021 · 3 comments

Comments

@kaxline
Copy link
Contributor

kaxline commented Jun 4, 2021

Here's the error I received immediately after installing react-native-etebase:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':react-native-sodium:mergeDebugNativeLibs'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.MergeJavaResWorkAction
   > 2 files found with path 'lib/armeabi-v7a/libsodium.so'.
     If you are using jniLibs and CMake IMPORTED targets, see
     https://developer.android.com/r/tools/jniLibs-vs-imported-targets

The problem is explained in the link from the error, but it ultimately appears to be the react-native-sodium dependency that's at fault.

I was able to get it working by editing the react-native-sodium grade.build file like this:

    sourceSets {
        main {
//            jniLibs.srcDirs = ['./lib']
        }
    }

But of course this will be overwritten whenever the package is updated or reinstalled. I don't know enough about Gradle to overwrite this in my project's gradle.build, so if anyone knows how to do that, I think it would be helpful.

This could potentially happen with other packages as well, not just react-native-sodium. Here's how other people have solved the issue, but the solutions didn't work for me:

https://stackoverflow.com/questions/62088079/error-when-building-project-with-ndk-support-after-updating-to-android-studio-4

@tasn
Copy link
Member

tasn commented Jun 4, 2021

Weird, I didn't get it. Maybe open a ticket with react native sodium?

@kaxline
Copy link
Contributor Author

kaxline commented Jul 16, 2021

@tasn Oh OK, we can close this then if it's not reproducible.

@tasn
Copy link
Member

tasn commented Aug 8, 2021

I'll keep it open, though I'm not sure what the issue is.

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

2 participants