Config Validation Error: "project.android.mainFilePath" is not allowed
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/"]
};
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?
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.