Error: The gradlew script doesn't seem to present in android. Make sure you have added it by running gradle wrapper in that directory.
Environment
npx react-native doctor
Common
✓ Node.js
✓ yarn
✖ Watchman - Used for watching changes in the filesystem when in development mode
- Version found: 2022.03.21.00
- Version supported: 4.x
Android
✓ JDK
✓ Android Studio - Required for building and installing your app on Android
✖ Android SDK - Required for building and installing your app on Android
- Versions found: 28.0.3, 30.0.2, 31.0.0, 32.0.0, 32.1.0
- Version supported: Not Found
✓ ANDROID_HOME
iOS
✓ Xcode - Required for building and installing your app on iOS
✓ CocoaPods - Required for installing iOS dependencies
✓ ios-deploy - Required for installing your app on a physical device with the CLI
Errors: 2
Warnings: 0
Usage
› Press f to try to fix issues.
› Press e to try to fix errors.
› Press w to try to fix warnings.
› Press Enter to exit.
Common
✓ Node.js
✓ yarn
✖ Watchman - Used for watching changes in the filesystem when in development mode
- Version found: 2022.03.21.00
- Version supported: 4.x
Android
✓ JDK
✓ Android Studio - Required for building and installing your app on Android
✖ Android SDK - Required for building and installing your app on Android
- Versions found: 28.0.3, 30.0.2, 31.0.0, 32.0.0, 32.1.0
- Version supported: Not Found
✓ ANDROID_HOME
iOS
✓ Xcode - Required for building and installing your app on iOS
✓ CocoaPods - Required for installing iOS dependencies
✓ ios-deploy - Required for installing your app on a physical device with the CLI
Errors: 2
Warnings: 0
Usage
› Press f to try to fix issues.
› Press e to try to fix errors.
› Press w to try to fix warnings.
› Press Enter to exit.
Description
react-native-builder-bob: 0.18.2
#79
issues_79
pull_175
I looked at how the problem has been fixed. However, problems remain. I use a MAC.
Reproducible Demo
npx create-react-native-library xxx
npx react-native-builder-bob init
yarn
If you remove the AAR option, there is no problem.
Try to find a clue
node_modules/react-native-builder-bob/lib/utils/androidAssemble.js print log.
throw new Error(`cwd: ${cwd}, root: ${root}, androidPath: ${androidPath}, gradleWrapper: ${gradleWrapper}`);
output:
Error: cwd: android, root: /Users/asterisk/Codes/zuoyu/react-native-chat-sdk, androidPath: android, gradleWrapper: ./gradlew
I tried to modify and find the file. Although the file could be found, other problems occurred. Please assist in the search.
same issue i get when i Build Package
Similar issue faced from running bob build
yarn run v1.22.17
$ bob build
ℹ Building target aar
ℹ Cleaning up previous build at lib\aar
ℹ Assembling Android project in android with gradle
bob build
build files for publishing
Options:
--help Show help [boolean]
--version Show version number [boolean]
Error: The gradlew script doesn't seem to present in android. Make sure you have added it by running gradle wrapper in that directory.
Looking for Solution
same issue, seem to be related to the aar file somehow.
Hey, @a-eid, @lancemk, @himanshurtanikatech, @AsteriskZuo folks do you have a specific use case with the aar? We have plans to remove the support for it.
And for your cases, if you don't have any specific use cases for the aar target, you can just remove it from your bob config:
"react-native-builder-bob": {
"source": "src",
"output": "lib",
"targets": [
- "aar",
"commonjs",
"module",
[
"typescript",
{
"project": "tsconfig.build.json"
}
]
]
}
We are going to be removing the aar support as it's not needed anymore. Please see #463.