Cannot run Project.afterEvaluate(Closure) when the project is already evaluated. (When upgrade 0.64.4)
See original GitHub issueDescription
Hey, I’m having some issues when upgrading from react-native v0.64.2 -> v0.64.4. Below is the error message I am getting when trying to create a build or running ./gradlew clean in the android directory. Any help?
1: Task failed with an exception.
-
Where: Script ‘~/node_modules/react-native/react.gradle’ line: 360
-
What went wrong: A problem occurred evaluating script.
Cannot run Project.afterEvaluate(Closure) when the project is already evaluated.
Version
0.64.4
Output of npx react-native info
System: OS: macOS 12.6.1 CPU: (10) arm64 Apple M1 Pro Memory: 81.56 MB / 16.00 GB Shell: 5.8.1 - /bin/zsh Binaries: Node: 19.0.1 - ~/.nvm/versions/node/v19.0.1/bin/node Yarn: 1.22.19 - ~/.nvm/versions/node/v19.0.1/bin/yarn npm: 8.19.2 - ~/.nvm/versions/node/v19.0.1/bin/npm Watchman: 2022.11.14.00 - /opt/homebrew/bin/watchman Managers: CocoaPods: 1.11.3 - /opt/homebrew/bin/pod SDKs: iOS SDK: Platforms: DriverKit 22.1, iOS 16.1, macOS 13.0, tvOS 16.1, watchOS 9.1 Android SDK: API Levels: 29, 31, 33 Build Tools: 28.0.3, 30.0.2, 30.0.3, 31.0.0 System Images: android-33 | Google APIs ARM 64 v8a Android NDK: Not Found IDEs: Android Studio: 2021.3 AI-213.7172.25.2113.9123335 Xcode: 14.1/14B47b - /usr/bin/xcodebuild Languages: Java: 17.0.5 - /usr/bin/javac npmPackages: @react-native-community/cli: Not Found react: 17.0.1 => 17.0.1 react-native: 0.64.4 => 0.64.4 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found
Steps to reproduce
It started when upgrade from react-native v0.64.2 -> v0.64.4.
Snack, code example, screenshot, or link to a repository

Issue Analytics
- State:
- Created 10 months ago
- Reactions:4
- Comments:10 (2 by maintainers)
Top Related StackOverflow Question
Thanks for the follow up. I’m going to close this as it’s not a React Native issue itself
Cannot run Project.afterEvaluate(Closure) when the project is already evaluated.
It was because there are some error codes in my build.gradle, after I removed it, the build worked. I used compileSdkVersion 31 & gradle 6.7 at the end.