Fails to determine project configuration

See original GitHub issue

I’m trying to run react native in a monorepo, and if I run the project with the old 2.9 version, I can run in development mode, if I override the native_modules.gradle-file like this:

-    def command = "node ./node_modules/react-native/cli.js config"
+    def command = "../../node_modules/react-native/cli.js config"

As well as run react-native start in my mobile folder, and run-android in my root folder in a separate terminal window.

But then can’t build for production, due to it not finding the node_modules/react-native/cli.js-file when I run with the --variant=release flag.

Now I’ve upgraded to version 3.0.1 of the @react-native-community/cli package, And added a configuration file in my root folder like so:

// react-native.config.js
module.exports = {
  project: {
    android: {
      sourceDir: './packages/mobile/android',
    },
    ios: {
      project: './packages/mobile/ios/mobile.xcodeproj',
    },
  },
}

Then I run yarn react-native run-android --root packages/mobile from root. However, it keeps complaining about my configuration.

React Native CLI failed to determine Android project configuration. This is likely due to misconfiguration. Config output: <config output>

If I run react-native config in my root directory, this is what I get:

{
  "root": "C:\\Users\\glink\\Documents\\projects\\my-project",
  "reactNativePath": "C:\\Users\\glink\\Documents\\projects\\my-project\\node_modules\\react-native",
  "dependencies": {},
  "commands": [<commands omittted for brevity>],
  "assets": [],
  "platforms": {
    "ios": {},
    "android": {}
  },
  "haste": {
    "providesModuleNodeModules": [
      "react-native"
    ],
    "platforms": [
      "ios",
      "android"
    ]
  },
  "project": {
    "ios": {
      "sourceDir": "C:\\Users\\glink\\Documents\\projects\\my-project\\packages\\mobile\\ios",
      "folder": "C:\\Users\\glink\\Documents\\projects\\my-project",
      "pbxprojPath": "C:\\Users\\glink\\Documents\\projects\\my-project\\packages\\mobile\\ios\\mobile.xcodeproj\\project.pbxproj",
      "podfile": "C:\\Users\\glink\\Documents\\projects\\my-project\\packages\\mobile\\ios\\Podfile",
      "podspecPath": null,
      "projectPath": "C:\\Users\\glink\\Documents\\projects\\my-project\\packages\\mobile\\ios\\mobile.xcodeproj",
      "projectName": "mobile.xcodeproj",
      "libraryFolder": "Libraries",
      "sharedLibraries": [],
      "plist": [],
      "scriptPhases": []
    },
    "android": {
      "sourceDir": "C:\\Users\\glink\\Documents\\projects\\my-project\\packages\\mobile\\android",
      "isFlat": true,
      "folder": "C:\\Users\\glink\\Documents\\projects\\my-project",
      "stringsPath": "C:\\Users\\glink\\Documents\\projects\\my-project\\packages\\mobile\\android\\src\\main\\res\\values\\strings.xml",
      "manifestPath": "C:\\Users\\glink\\Documents\\projects\\my-project\\packages\\mobile\\android\\app\\src\\main\\AndroidManifest.xml",
      "buildGradlePath": "C:\\Users\\glink\\Documents\\projects\\my-project\\packages\\mobile\\android\\build.gradle",
      "settingsGradlePath": "C:\\Users\\glink\\Documents\\projects\\my-project\\android\\settings.gradle",
      "assetsPath": "C:\\Users\\glink\\Documents\\projects\\my-project\\packages\\mobile\\android\\src\\main\\assets",
      "mainFilePath": "C:\\Users\\glink\\Documents\\projects\\my-project\\packages\\mobile\\android\\src\\main\\java\\com\\mobile\\MainApplication.java",
      "packageName": "com.mobile"
    }
  }
}

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
sibeliuscommented, Nov 26, 2019

I’ve solved like this on native_modules.gradle

- def command = "${npx} --quiet --no-install react-native config"
+ def command = "yarn --silent react-native config"
` ``
0reactions
DevineDecryptercommented, Jul 1, 2021

is there a way to add android tv as a platform in the react-native-video’s platforms?

module.exports = {
  assets: ['./assets/fonts'],
  dependencies: {
    'react-native-video': {
      platforms: {
        android: {
          sourceDir: '../node_modules/react-native-video/android-exoplayer',
        },
      },
    },
  },
};
Read more comments on GitHub >

github_iconTop Results From Across the Web

React Native CLI failed to determine Android project ...
I'm trying to build my android project but I'm facing a configuration error. Previously I built an app bundle, but after that, I'm...
Read more >
React Native CLI failed to determine Android project ...
Any working Proguard Configuration for Android App with React Native with obfuscation? ... error Android project not found. Are you sure this is...
Read more >
Existing project now fails with "No configuration was found in ...
A project which has been building successfully for weeks has started failing for no reason with “No configuration was found in your project” ......
Read more >
Top 10 Reasons for Project Failure (And How to Prevent Them)
Example: There isn't a way to measure project success when important documents are not kept or are not easy to locate. Poor leadership....
Read more >
Project Configuration Default Settings - MicroStrategy
To access the Project Configuration Editor in Developer, right-click the project source and choose Project Configuration.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found