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

Error: The gradlew script doesn't seem to present in android. Make sure you have added it by running gradle wrapper in that directory. #240

Closed
AsteriskZuo opened this issue Apr 17, 2022 · 5 comments

Comments

@AsteriskZuo
Copy link

AsteriskZuo commented Apr 17, 2022

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.

@BartoszKlonowski
@chadmorrow

@himanshurtanikatech
Copy link

same issue i get when i Build Package

@lancemk
Copy link

lancemk commented Aug 16, 2023

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

@a-eid
Copy link

a-eid commented Aug 25, 2023

same issue, seem to be related to the aar file somehow.

@atlj
Copy link
Collaborator

atlj commented Sep 13, 2023

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"
      }
    ]
  ]
}

@atlj
Copy link
Collaborator

atlj commented Sep 15, 2023

We are going to be removing the aar support as it's not needed anymore. Please see #463.

@atlj atlj closed this as not planned Won't fix, can't repro, duplicate, stale Sep 15, 2023
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

5 participants