cli icon indicating copy to clipboard operation
cli copied to clipboard

Config Validation Error: "project.android.mainFilePath" is not allowed

Open Aure77 opened this issue 3 years ago • 1 comments

Environment

yarn run v1.22.18
$ /Users/me/Documents/bddf_app_pri/node_modules/.bin/react-native config
error Failed to load configuration of your project.
Config Validation Error: "project.android.mainFilePath" is not allowed
    at readConfigFromDisk (/Users/me/Documents/bddf_app_pri/node_modules/@react-native-community/cli-config/build/readConfigFromDisk.js:68:11)
    at loadConfig (/Users/me/Documents/bddf_app_pri/node_modules/@react-native-community/cli-config/build/loadConfig.js:59:65)
    at setupAndRun (/Users/me/Documents/bddf_app_pri/node_modules/@react-native-community/cli/build/index.js:200:45)
    at Object.run (/Users/me/Documents/bddf_app_pri/node_modules/@react-native-community/cli/build/index.js:162:11)
    at Object.<anonymous> (/Users/me/Documents/bddf_app_pri/node_modules/react-native/cli.js:16:7)
    at Module._compile (node:internal/modules/cjs/loader:1105:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
info Run CLI with --verbose flag for more details.
error Command failed with exit code 1.

with [email protected] & @react-native-community/[email protected]

Description

yarn react-native info or yarn react-native config crash with message "project.android.mainFilePath" is not allowed when using react-native.config.js with mainFilePath defined. This settings was working with previous version of cli.

Reproducible Demo

create react-native.config.js with this content:

module.exports = {
  project: {
    ios: {},
    android: {
      mainFilePath:
        "./src/main/java/org/yours/CustomApplication.java"
    }
  },
  assets: ["./src/assets/fonts/"]
};

Aure77 avatar Oct 12 '22 18:10 Aure77

Hi @Aure77 mainFilePath is indeed not supported but I won't name this as a bug. What do you want to achieve by passing this config? Maybe platforms.android.sourceDir would help?

adamTrz avatar Oct 14 '22 08:10 adamTrz

There hasn't been any activity on this issue in the past 3 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 7 days.

github-actions[bot] avatar Jan 13 '23 03:01 github-actions[bot]