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

Build failed because of '/node_modules/react-native/android' more than one .aar files (Hermes & react-native) #63

Closed
danielhj1998 opened this issue Jul 6, 2022 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@danielhj1998
Copy link

Hello, my project uses API level 31 with RN 0.69.1

    ext {
        buildToolsVersion = "31.0.0"
        minSdkVersion = 21
        compileSdkVersion = 31
        targetSdkVersion = 31

        if (System.properties['os.arch'] == "aarch64") {
            // For M1 Users we need to use the NDK 24 which added support for aarch64
            ndkVersion = "24.0.8215888"
        } else {
            // Otherwise we default to the side-by-side NDK version from AGP.
            ndkVersion = "21.4.7075529"
        }
    }

When trying to build I get the following error:

* Where:
Build file '$root/node_modules/react-native-quick-sqlite/android/build.gradle' line: 183

* What went wrong:
A problem occurred evaluating project ':react-native-quick-sqlite'.
> Expected directory '$root/node_modules/react-native/android' to contain exactly one file, however, it contains more than one file.

The 183 line in the '$root/node_modules/react-native-quick-sqlite/android/build.gradle' is:

def rnAAR = fileTree("${nodeModules}/react-native/android").matching({ it.include "**/**/*.aar"}).singleFile

I think this happens because in the '$root/node_modules/react-native/android/com/facebook/react/' directory there are the 'react-native' and 'hermes-engine' directories which contain a .aar file.

Could you help me solve this problem? Thanks in advance

@Fagner3g
Copy link

Fagner3g commented Jul 6, 2022

Hi, same problem here :/

  • Where:
    Build file '/Users/fagnergomes/Projetos/vitruvio/node_modules/react-native-quick-sqlite/android/build.gradle' line: 183

@ospfranco ospfranco self-assigned this Jul 6, 2022
@ospfranco ospfranco added the bug Something isn't working label Jul 6, 2022
@craftzdog
Copy link
Contributor

Maybe it could solve this: mrousavy/react-native-vision-camera#1116

@ospfranco
Copy link
Owner

That is precisely what I needed, thanks @craftzdog!

@danielhj1998 @Fagner3g the main branch is patched, can you try it and let me know if it works for you? afterward, I will publish it to npm

@Fagner3g
Copy link

Fagner3g commented Jul 7, 2022

@ospfranco success here, fixed the problem.
Thanks

@danielhj1998
Copy link
Author

@ospfranco Same, that fixed the problem, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants