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/android' to contain exactly one file, however, it contains no files. #19

Closed
psquizzle opened this issue Mar 3, 2023 · 1 comment

Comments

@psquizzle
Copy link

FAILURE:
[RUN_GRADLEW] Build failed with an exception.
[RUN_GRADLEW] * Where:
[RUN_GRADLEW] Build file '/private/var/folders/rl/9tgdr27n0nj7lm5mt4t58tr80000gn/T/eas-build-local-nodejs/d8ea3b8a-82fb-4da9-834a-99ac0e13c510/build/node_modules/react-native-jsi-template/android/build.gradle' line: 114
[RUN_GRADLEW] * What went wrong:
[RUN_GRADLEW] A problem occurred evaluating project ':react-native-jsi-template'.
[RUN_GRADLEW] > Expected directory '/private/var/folders/rl/9tgdr27n0nj7lm5mt4t58tr80000gn/T/eas-build-local-nodejs/d8ea3b8a-82fb-4da9-834a-99ac0e13c510/build/node_modules/react-native/android' to contain exactly one file, however, it contains no files.
[RUN_GRADLEW] * Try:
[RUN_GRADLEW] > Run with --stacktrace option to get the stack trace.
[RUN_GRADLEW] > Run with --info or --debug
[RUN_GRADLEW] option to get more log output.
[RUN_GRADLEW] > Run with --scan to get full insights.
[RUN_GRADLEW] * Get more help at https://help.gradle.org
[RUN_GRADLEW] BUILD FAILED in 23s
[RUN_GRADLEW] 5 actionable tasks: 5 executed
[RUN_GRADLEW] Error: Gradle build failed with unknown error. See logs for the "Run gradlew" phase for more information.

Build failed
Gradle build failed with unknown error. See logs for the "Run gradlew" phase for more information.
Error: npx exited with non-zero code: 1

@psquizzle
Copy link
Author

This seems to be due to the following:

The /android folder inside react-native

Starting from React Native 0.71, we're not shipping the /android folder inside the React Native NPM package
anymore due to sizing constraints on NPM. The Android artifacts are distributed via Maven Central.
You can read more about it in this RFC:
react-native-community/discussions-and-proposals#508

If you're a library author and you're manipulating the React Native .aar files, to extract headers,
extract .so files or do anything with it, you're probably doing something wrong. React Native
0.71 ships with all the necessary logic to let you consume it transparently by just using:

implementation("com.facebook.react:react-android")
// or to keep backward compatibility with older versions of React Native:
implementation("com.facebook.react:react-native:+")

You should consider refactoring your library code not to unzip/manipulate the React Native .aar files.

This README.md file is kept in this folder as some libraries are checking the existence of the /android folder
and failing user builds if the folder is missing.

I am however not sure how to refactor instead.

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

1 participant