react-native icon indicating copy to clipboard operation
react-native copied to clipboard

Android build fail - Unable to make progress running work. There are items queued for execution but none of them can be started

Open gkasireddy202 opened this issue 9 months ago • 24 comments

Description

We recently upgraded my project from react-native:068.7 to 0.73.2. We get the below errors when we run the Android build in react-native:0.73.2. we are using the gradle version 8.3 in my project.

  1. Unable to make progress running work. There are items queued for execution but none of them can be started 2)Unable to make progress running work. There are items queued for execution but none of them can be started
  • Try:

Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. Get more help at https://help.gradle.org. Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0. You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins. For more on this, please refer to https://docs.gradle.org/8.3/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.

Steps to reproduce

build the app in android studio

React Native Version

0.73.2

Affected Platforms

Runtime - Android

Output of npx react-native info

System:
  OS: macOS 14.2.1
  CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
  Memory: 34.03 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 21.7.3
    path: /usr/local/bin/node
  Yarn: Not Found
  npm:
    version: 10.5.0
    path: /usr/local/bin/npm
  Watchman:
    version: 2023.03.13.00
    path: /usr/local/bin/watchman
Managers:
  CocoaPods:
    version: 1.15.2
    path: /Users/gopi/.rvm/gems/ruby-2.7.6/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.2
      - iOS 17.2
      - macOS 14.2
      - tvOS 17.2
      - watchOS 10.2
  Android SDK:
    API Levels:
      - "23"
      - "24"
      - "25"
      - "26"
      - "27"
      - "28"
      - "29"
      - "30"
      - "31"
      - "32"
      - "33"
      - "34"
    Build Tools:
      - 29.0.2
      - 30.0.3
      - 33.0.1
      - 34.0.0
    System Images:
      - android-29 | Google APIs Intel x86 Atom
      - android-29 | Google Play Intel x86 Atom
      - android-30 | Google APIs Intel x86 Atom
      - android-32 | Google APIs Intel x86 Atom_64
      - android-32 | Google Play Intel x86 Atom_64
      - android-33 | Google APIs Intel x86 Atom_64
      - android-33 | Google Play Intel x86 Atom_64
    Android NDK: Not Found
IDEs:
  Android Studio: 2021.2 AI-212.5712.43.2112.8609683
  Xcode:
    version: 15.1/15C65
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.10
    path: /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/bin/javac
  Ruby:
    version: 2.7.6
    path: /Users/gopi/.rvm/rubies/ruby-2.7.6/bin/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.73.2
    wanted: 0.73.2
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: Not found
  newArchEnabled: Not found
iOS:
  hermesEnabled: Not found
  newArchEnabled: false

info React Native v0.74.1 is now available (your project is running on v0.73.2).
info Changelog: https://github.com/facebook/react-native/releases/tag/v0.74.1
info Diff: https://react-native-community.github.io/upgrade-helper/?from=0.74.1
info For more info, check out "https://reactnative.dev/docs/upgrading?os=macos".

Stacktrace or Logs

Unable to make progress running work. There are items queued for execution but none of them can be started

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.
Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
For more on this, please refer to https://docs.gradle.org/8.3/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.

Reproducer

No Git url - My company project

Screenshots and Videos

No response

gkasireddy202 avatar May 09 '24 07:05 gkasireddy202

:warning: Newer Version of React Native is Available!
:information_source: You are on a supported minor version, but it looks like there's a newer patch available - 0.73.8. Please upgrade to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases.

github-actions[bot] avatar May 09 '24 07:05 github-actions[bot]

:warning: Missing Reproducible Example
:information_source: We could not detect a reproducible example in your issue report. Please provide either:
  • If your bug is UI related: a Snack
  • If your bug is build/update related: use our Reproducer Template. A reproducer needs to be in a GitHub repository under your username.

github-actions[bot] avatar May 09 '24 07:05 github-actions[bot]

I replicated this issue by creating the react-native project. Please find the below repo. https://github.com/gopikrishnacse55/UIExample.git

Screenshot 2024-05-09 at 1 51 16 PM Screenshot 2024-05-09 at 1 51 29 PM Screenshot 2024-05-09 at 1 53 53 PM

gkasireddy202 avatar May 09 '24 08:05 gkasireddy202

Do we have solution for this ?

panchal-krunal avatar May 10 '24 04:05 panchal-krunal

Same issue, it's happened on my side. I tried on both 0.74.1 and 0.73.8, but the same issue happened. Here is my env:

System:
  OS: Windows 11 10.0.22000
Binaries:
  Node:
    version: 18.3.0
    path: C:\Program Files\nodejs\node.EXE
  Yarn:
    version: 1.22.21
    path: C:\Program Files\nodejs\yarn.CMD
  npm:
    version: 8.11.0
    path: C:\Program Files\nodejs\npm.CMD
  Watchman: Not Found
SDKs:
  Android SDK: Not Found
  Windows SDK: Not Found
IDEs:
  Android Studio: AI-233.14808.21.2331.11709847
  Visual Studio: Not Found
Languages:
  Java: 11.0.23
  Ruby: Not Found
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.73.8
    wanted: 0.73.8
  react-native-windows: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found

Synknite avatar May 10 '24 05:05 Synknite

Related to https://github.com/gradle/gradle/issues/21325

Are you building from Android Studio or from the CLI? Can you try both and report from which one can you build?

cortinico avatar May 11 '24 00:05 cortinico

Also experience this. sometimes it show, sometimes its not. I am not sure why this occurs. I clean and rebuild and invalidate cache still the same.

C2418M31 avatar May 13 '24 16:05 C2418M31

I am facing this issue When I trying to rebuild the project from Android Studio. I am getting the below error when trying to run the app on the device: react-native run-android. build failed in gradle port:8081.

gkasireddy202 avatar May 14 '24 05:05 gkasireddy202

Hello! 👋

I would also like to report that this issue happened to me today too. Today I ran this command: npx react-native init abc I did not install any other dependencies, just the pure React Native project. I am using a windows machine. I am using the latest version of Android Studio to build the project.

Here are the steps to reproduce the problem (on a windows machine):

  1. Run this command: npx react-native init abc
  2. Open the project on Android Studio
  3. Rebuild the project with Android Studio: Menu => Build => Clean Project Menu => Build => Rebuild Project

And this issue appeared to me.

Thanks a lot! 🙏

OmarThinks avatar May 15 '24 06:05 OmarThinks

npx react-native init abc
npx react-native init abcd --version="0.73"
npx react-native init abcde --version="0.72"

All these commands will create the same error when following the same 3 steps in my previous comment. ♻️


After testing versions of React Native, the error also appeared in the old React Native I am working on v0.72.1.

😅

OmarThinks avatar May 15 '24 07:05 OmarThinks

Added this to my root build.gradle file and it fixed my issue

gradle.startParameter.excludedTaskNames.addAll(
        gradle.startParameter.taskNames.findAll { it.contains("testClasses") }
)

markneh avatar May 15 '24 15:05 markneh

Added this to my root build.gradle file and it fixed my issue

gradle.startParameter.excludedTaskNames.addAll(
        gradle.startParameter.taskNames.findAll { it.contains("testClasses") }
)

It worked perfectly. Thanks a lot @markneh! I've tested it across several React Native versions.


Just to clarify. Where Should this code be. It should be in root build gradle file like this:

gradle.startParameter.excludedTaskNames.addAll(
        gradle.startParameter.taskNames.findAll { it.contains("testClasses") }
)

buildscript {
    // code
}

OmarThinks avatar May 15 '24 19:05 OmarThinks

I added the below code in build.gradle and rebuilt the project in Android Studio. The issue is fixed. gradle.startParameter.excludedTaskNames.addAll( gradle.startParameter.taskNames.findAll { it.contains("testClasses") } )

Trying to run the command: react-native run-android on Android device.Getting the below error. info Installing the app...

info 💡 Tip: Make sure that you have set up your development environment correctly, by running npx react-native doctor. To read more about doctor command visit: https://github.com/react-native-community/cli/blob/main/packages/cli-doctor/README.md#doctor

error Failed to install the app. Command failed with Unknown system error -8: ./gradlew app:installDebug -PreactNativeDevServerPort=8081 spawn Unknown system error -8. info Run CLI with --verbose flag for more details. Screenshot 2024-05-16 at 5 16 24 PM

gkasireddy202 avatar May 16 '24 11:05 gkasireddy202

@gkasireddy202

Try the following: In android studio,

  1. Open the project folder Menu => File => Open => (Select the /android folder in your React native project) (Be careful, open the /android folder, not the project folder) (Assuming that you are using a React Native CLI build and not an Expo build)

  2. Clean and rebuild Menu => Build => Clean Project Menu => Build =>Rebuild Project

  3. Install app Now, press that green run button to install the application build with android studio

  4. Run application npm start open the emulator Open the application


Summary: on windows device, do not run npx react-native run-android directly, it may not work sometimes, especially in some old React Native versions. That may be a completely different problem.


If the error still persists, try these steps on a brand new React Native project, not your main project. A new project without any dependencies. To know what's up with a pure isolated React Native latest version case. If the app works, then it's a dependency error or old React Native error, but not the isolated pure latest version of React Native.

OmarThinks avatar May 16 '24 13:05 OmarThinks

@OmarThinks - Thanks for your reply. I followed your steps and app is installed on my device. Getting the below error. Questions Tags Users Companies LABS Jobs NEW Discussions COLLECTIVES Communities for your favorite technologies. Explore all Collectives TEAMS Ask questions, find answers and collaborate at work with Stack Overflow for Teams. Unable to load script.Make sure you are either running a Metro server or that your bundle 'index.android.bundle' is packaged correctly for release

gkasireddy202 avatar May 16 '24 14:05 gkasireddy202

@gkasireddy202

https://stackoverflow.com/questions/55441230/unable-to-load-script-make-sure-you-are-either-running-a-metro-server-or-that-yo

Maybe you are not running npm start in the background. But the application has been installed successfully, that's progress. 😁🎉💪💯

OmarThinks avatar May 16 '24 15:05 OmarThinks

@OmarThinks - App is running on my device.

  1. npm start
  2. I used to run button in Android Studio.
  3. The app is successfully running on the device along with the metro bundler server.

gkasireddy202 avatar May 16 '24 15:05 gkasireddy202

Congrats, bro! 🎉🎂 You made progress. 🫡 💪

Happy, coding! 💻😁

OmarThinks avatar May 16 '24 15:05 OmarThinks

@OmarThinks - Thanks for your help.

gkasireddy202 avatar May 16 '24 15:05 gkasireddy202

@gkasireddy202

You're welcome. 😁

I need to clarify.

The npm start runs the metro in the background, so that you can run the React Native app.

The green arrow does the following:

  1. Install the app on the emulator if it wasn't installed.
  2. After it makes sure that the app has been installed, it opens the application in the emulator (but not metro)

So, you need the app to be open in the emulator, while npm start is running in background. You need them both.


And do not close the issue yet. The issue is still hasn't been solved.

OmarThinks avatar May 16 '24 15:05 OmarThinks

Hello, @cortinico ! 👋

I would like to say that we would really appreciate it if someone from the React Native teams solved this issue, we would be so grateful.

Issue description: On a windows machine, for a new pure isolated (the template from npx react-natine init abc, without installing any other dependencies) latest version project of React Native.

On a windows machine, using Android Studio, when we run: Menu => Build => Clean Project Menu => Build =>Rebuild Project

This issue appears:

Unable to make progress running work. There are items queued for execution but none of them can be started

build-error


The issue will not be solved, unless we add this code to the root build gradle file:

gradle.startParameter.excludedTaskNames.addAll(
        gradle.startParameter.taskNames.findAll { it.contains("testClasses") }
)

buildscript {
    // code
}

Thanks a lot for you, and for the React Native team for your hard work and consistent effort! 🙏

OmarThinks avatar May 16 '24 15:05 OmarThinks

I would like to say that we would really appreciate it if someone from the React Native teams solved this issue, we would be so grateful.

Thanks for flagging it. Unfortunately, I don't have capacity at the moment to work on this. I'll be happy to receive and review a PR for a fix for this.

Needless to say that gradle.startParameter.excludedTaskNames.addAll( is a workaround and we should fix the root cause

cortinico avatar May 20 '24 10:05 cortinico

이렇게 추가하고 성공했어요!

buildscript {
...
    gradle.startParameter.excludedTaskNames.addAll(
            gradle.startParameter.taskNames.findAll { it.contains("testClasses") }
    )
}

byounjai avatar Sep 01 '24 00:09 byounjai

Added this to my root build.gradle file and it fixed my issue

gradle.startParameter.excludedTaskNames.addAll(
        gradle.startParameter.taskNames.findAll { it.contains("testClasses") }
)

This Saved me

Accoladecreative avatar Sep 15 '24 14:09 Accoladecreative

Hello, @cortinico ! 👋

I would like to say that we would really appreciate it if someone from the React Native teams solved this issue, we would be so grateful.

Issue description: On a windows machine, for a new pure isolated (the template from npx react-natine init abc, without installing any other dependencies) latest version project of React Native.

On a windows machine, using Android Studio, when we run: Menu => Build => Clean Project Menu => Build =>Rebuild Project

This issue appears:

Unable to make progress running work. There are items queued for execution but none of them can be started

build-error

The issue will not be solved, unless we add this code to the root build gradle file:

gradle.startParameter.excludedTaskNames.addAll(
        gradle.startParameter.taskNames.findAll { it.contains("testClasses") }
)

buildscript {
    // code
}

Thanks a lot for you, and for the React Native team for your hard work and consistent effort! 🙏

This save me

rafiiAP avatar Sep 23 '24 09:09 rafiiAP

@rafiiAP You're welcome, bro! 😁

OmarThinks avatar Sep 26 '24 10:09 OmarThinks