Cannot run Project.afterEvaluate(Closure) when the project is already evaluated. (When upgrade 0.64.4)

This issue has been created since 2022-11-17.

Description

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

Screen Shot 2022-11-17 at 16 35 51

CYCken wrote this answer on 2022-11-21

I have same issue. When I upgrade compileSdkVersion 30 -> 31 & gradle 6.7 -> 7.4

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.4/userguide/command_line_interface.html#sec:command_line_warnings

FAILURE: Build failed with an exception.

  • Where:
    Script '/Users/chiayu/react/secux-mobile/node_modules/react-native/react.gradle' line: 366

  • What went wrong:
    A problem occurred evaluating script.

Cannot run Project.afterEvaluate(Closure) when the project is already evaluated.

AlpMehmet wrote this answer on 2022-11-21

I fixed gradle issue but i keep getting the error.

mlostekk wrote this answer on 2022-11-21

Any fix out there? Having the same issue, RN 0.64.4, and. trying to upgrade gradle to 7.4

AlpMehmet wrote this answer on 2022-11-23

Any fix out there? Having the same issue, RN 0.64.4, and. trying to upgrade gradle to 7.4

I tried different solutions but none of them worked.

cortinico wrote this answer on 2022-11-23

Could you share a reproducer?
This is probably caused by a library you're importing as an empty 0.64.4 project builds fine.

Frankly your on a really old version of React Native, that it's quite of a challenge to help here. Have you considered upgrading to the latest versions?

More Details About Repo
Owner Name facebook
Repo Name react-native
Full Name facebook/react-native
Language JavaScript
Created Date 2015-01-09
Updated Date 2022-12-01
Star Count 106263
Watcher Count 3666
Fork Count 22655
Issue Count 2277

YOU MAY BE INTERESTED

Issue Title Created Date Comment Count Updated Date
[everything] option to turn off ASCII coloring 1 2022-09-25 2022-11-14
`UndefVarError: contains not defined` in GR 0.68 1 2022-09-20 2022-10-29
Setting maker stroke style 0 2022-09-21 2022-11-07
[FEAT][CV] Don't display heatmap comparison when avg images are nearly identical 3 2022-03-30 2022-10-19
[BUG] [Vision] ModelErrorAnalysis display colors are mismatched 0 2022-03-30 2022-09-29
[Bug] DotNetVersion field in the Launcher views does not reflect the .NET version selected post-creation. 1 2021-03-04 2022-10-11
Local Linux builds prune recipes committed to local master but not merged 1 2022-02-23 2022-11-05
Requests for TV shows with different TVDB and TMDB IDs fail 4 2021-08-01 2022-10-01
Ability to add tokens on ropsten network 1 2021-12-02 2022-11-18
[COREAUDIO] On iOS, audio doesn't come back after interruption 9 2022-01-13 2022-11-14
Icon request: icon-iso9001 1 2022-07-08 2022-09-30
Can't set custom id on [ngbNavItem] 2 2021-04-20 2022-10-21
Migrate all dependency scanning to dependabot 0 2022-09-09 2022-11-21
可以加个SagerNet那种的 url test 来测试代理服务器吗? 0 2022-10-08 2022-11-22
Updated Shamanic Traditions are Missing 0 2022-07-12 2022-11-14
Dynmap forgot where it left off after server restart, won't continue fullrender. 3 2021-11-19 2022-10-05
Book 1, version 2022-08-08, section 1.2.2 0 2022-08-25 2022-11-17
kyma dashboard handle local kubeconfig 0 2021-11-02 2022-10-30
How to include a new predictor(Serving Runtime) in KServe? 12 2022-09-21 2022-11-11
Vue Vuex tour delete mutation incorrect 3 2021-10-16 2022-11-19
Multiplayer on Company And Nicknames 4 2022-09-28 2022-10-23
Figma plugin would be awesome 3 2021-03-16 2022-11-10
How to interpret the value of v given by a pretrained pose estimation model 1 2021-09-14 2022-11-21
Use tid to check for exact match in non-precomputed type test 0 2021-11-08 2022-10-19
CallInsn should use position of name of function or method call 3 2021-11-10 2022-08-01
GET request with proxy doesn't work on v1.1.2 4 2022-10-09 2022-11-24
RGBWW interlocked light not reporting color_temp 8 2021-08-08 2022-10-03
Build from source 1 2021-09-22 2022-01-09
Send device straight to a higher SF on join if possible 5 2017-02-16 2022-11-08
Unable to find collection for file -- v0.69.6 Windows regression 0 2022-09-10 2022-11-12
[New term] `Policy as Code` 3 2022-05-30 2022-09-26
PFD lagging behind after takeoff 1 2022-03-06 2022-10-29
MinIO stops processing requests (SlowDown) that never clears 9 2022-03-14 2022-11-26
Fatal assert in V8 for Electron 17.0.0-alpha.4 4 2021-12-13 2022-10-01
[Question]Pull upstream k8s manifests from base/kustomization.yaml file 3 2022-03-03 2022-10-22
In the box below the execution result, there is a white space between the gray line of the border and the gray line of the actual image. As a result, the mouse must be placed on the gray line before the border can be dragged 0 2022-05-26 2022-10-21
Page needs clarification on 'only accessible via API management process' 4 2022-05-03 2022-11-03
Building hello sample application with Docker does not work 2 2022-05-06 2022-11-21
Safari loses connection when streaming `.mp4` files 1 2022-05-24 2022-11-21
Is it WAI that dio.post throws DioError on 302? 1 2021-11-30 2022-11-01
关于项目打包清除console.log 3 2022-01-06 2022-01-12
Hamburger 開闔卡頓 1 2022-01-07 2022-01-12
Automate adding servers 1 2022-11-27 2022-11-21
Item Movement Plugin - Items overlapping when moving 5 2020-11-20 2022-10-10
Support for batch upload of retrieval deals 4 2021-07-08 2022-11-14
itest flakiness: concurrent map access in mock sealer 0 2022-08-23 2022-09-12
Add PreCommitSectorBatch2/ProofReplicaUpgrade2 5 2022-09-02 2022-09-17
Add API for message authentication 1 2022-09-02 2022-09-17
ASP.NET Core Docker image for buster-slim-arm32v7 3 2021-12-10 2022-11-20
CA1851 doesn't seem to be a legitimate rule recognized by Visual Studio 12 2022-08-31 2022-10-05