Skip to content

Building from source fails with the error: Missing cliPath or nodeExecutableAndArgs from build config. Please set project.ext.react.cliPath to the path of the react-native cli.js #28466

@gagangoku

Description

@gagangoku

Description

To fix a bug in ReactNative, i have cloned the repository and building it.
Have followed all the instructions in https://github.com/facebook/react-native/wiki/Building-from-source

However, I get the following error when I try to build:

~/work/helo/helo_app_rn/android (rn_fix) $ ./gradlew clean
Configuration on demand is an incubating feature.

> Configure project :
Warning: Please apply google-services plugin at the bottom of the build file.

> Configure project :app
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html

FAILURE: Build failed with an exception.

* Where:
Script '/Users/gagandeepsingh/work/helo/helo_app_rn/node_modules/react-native/react.gradle' line: 113

* What went wrong:
A problem occurred configuring project ':app'.
> Failed to notify project evaluation listener.
   > Missing cliPath or nodeExecutableAndArgs from build config. Please set project.ext.react.cliPath to the path of the react-native cli.js

* 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

BUILD FAILED in 4s

React Native version:

info Fetching system and libraries information...
System:
    OS: macOS High Sierra 10.13.6
    CPU: (12) x64 Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
    Memory: 20.41 MB / 16.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 11.13.0 - /usr/local/bin/node
    Yarn: Not Found
    npm: 6.7.0 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.5.3 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
    Android SDK:
      API Levels: 23, 25, 26, 27, 28
      Build Tools: 23.0.1, 25.0.3, 26.0.2, 26.0.3, 27.0.3, 28.0.2, 28.0.3
      System Images: android-19 | ARM EABI v7a, android-27 | Google Play Intel x86 Atom, android-28 | Intel x86 Atom_64, android-28 | Google APIs Intel x86 Atom, android-28 | Google Play Intel x86 Atom
      Android NDK: Not Found
  IDEs:
    Android Studio: 3.4 AI-183.6156.11.34.5522156
    Xcode: 10.1/10B61 - /usr/bin/xcodebuild
  Languages:
    Python: 2.7.15 - /usr/local/bin/python
  npmPackages:
    @react-native-community/cli: ^4.5.0 => 4.5.0
    react: 16.9.0 => 16.9.0
    react-native: github:gagangoku/react-native#master => 1000.0.0
  npmGlobalPackages:
    *react-native*: Not Found

Steps To Reproduce

Provide a detailed list of steps that reproduce the issue.

The following diff:

diff --git a/android/app/build.gradle b/android/app/build.gradle
index 3288ecd..3a3148a 100644
--- a/android/app/build.gradle
+++ b/android/app/build.gradle
@@ -231,7 +231,8 @@ dependencies {
     implementation "com.google.firebase:firebase-firestore:19.0.0"
 
     implementation fileTree(dir: "libs", include: ["*.jar"])
-    implementation "com.facebook.react:react-native:+"  // From node_modules
+    implementation project(':ReactAndroid')
+//    implementation "com.facebook.react:react-native:+"  // From node_modules
 
     if (enableHermes) {
         def hermesPath = "../../node_modules/hermes-engine/android/";
diff --git a/android/build.gradle b/android/build.gradle
index 03923ad..cd68844 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -14,6 +14,7 @@ buildscript {
     dependencies {
         classpath("com.android.tools.build:gradle:3.4.2")
         classpath 'com.google.gms:google-services:4.3.3'        // Google Services plugin
+        classpath 'de.undercouch:gradle-download-task:4.0.0'
 
         // NOTE: Do not place your application dependencies here; they belong
         // in the individual module build.gradle files
@@ -36,6 +37,13 @@ allprojects {
         jcenter()
         maven { url 'https://jitpack.io' }
     }
+    configurations.all {
+        resolutionStrategy {
+            dependencySubstitution {
+                substitute module("com.facebook.react:react-native:+") with project(":ReactAndroid")
+            }
+        }
+    }
 }
 
 apply plugin: 'com.google.gms.google-services'
diff --git a/android/settings.gradle b/android/settings.gradle
index ff8050d..6af1222 100644
--- a/android/settings.gradle
+++ b/android/settings.gradle
@@ -1,3 +1,8 @@
 rootProject.name = 'helo_app_rn'
 apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
+
+include ':ReactAndroid'
+project(':ReactAndroid').projectDir = new File(
+        rootProject.projectDir, '../node_modules/react-native/ReactAndroid')
+
 include ':app'

diff --git a/package.json b/package.json
index ebd3ae0..815c511 100644
--- a/package.json
+++ b/package.json
@@ -11,6 +11,7 @@
   },
   "dependencies": {
     "@react-native-community/audio-toolkit": "^2.0.2",
+    "@react-native-community/cli": "^4.5.0",
     "@react-native-community/masked-view": "^0.1.6",
     "@react-native-community/slider": "^2.0.8",
     "@react-navigation/native": "^5.0.5",
@@ -38,7 +39,7 @@
     "react": "16.9.0",
     "react-facebook-pixel": "^0.1.3",
     "react-ga": "^2.7.0",
-    "react-native": "0.61.5",
+    "react-native": "github:gagangoku/react-native#master",
     "react-native-android-wifi": "0.0.41",
     "react-native-branch": "^4.3.0",
     "react-native-camera": "^3.19.0",

Expected Results

Expected the build to succeed

Snack, code example, screenshot, or link to a repository:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs: Triage 🔍StaleThere has been a lack of activity on this issue and it may be closed soon.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions