You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
"Text must not be null or empty" error occurs on Android Studio. #468
Oh I just thought that outputting a helpful message with autolinking docs link if the config command output is empty would be really helpful. Would you like to contribute that?
Setting root to the project root, it will try to run node ./node_modules/react-native/cli.js config in the project root, and report error on this line : this.packageName = json["project"]["android"]["packageName"].
Setting the root to rn-app-1, gives error on this line def json = new JsonSlurper().parseText(reactNativeConfigOutput)
Both errors makes sense, since the project root does not contain an rn app, and ./node_modules/react-native/cli.js is not a valid path from the workspace root.
What does work is keeping the root at the rn-app-1 workspace and change the command to /node_modules/.bin/react-native config.
I know there is an option using the nohoist of react-native, but I would rather not, since DX is quite bad, we had it before, and upgrading dependencies could take up to 15 minutes ⌛️
So, is there some setting I have missed, or would there be a possibility to add some config to tell rn-cli where to look for the rn-app config?
Reacted by wr9, Dino Trojak, adam-olser, Pavel Zbytovský, Jan Václavík, Toni U.P., Filip Messa, Augusto Calaca, Ivan Croitor, Don Holly and 1 more
is the issue with Azure DevOps build? I do not get this error locally, but my Azure DevOps person consistently does. Do you or anyone know if the above is something that must be applied when building react-native in Azure?
please first verify the npm -v and node -v gives you some version number.
The problem was with using yarn. I use yarn instead of npm and was getting this error. when I reinstalled node then the problem was resolved. No need to change the node_modules files as it did manage to run but created several other problems later on. Hope this helps yarn lovers!
Activity
thymikee commentedon Jul 4, 2019
You'll need to set custom root (likely same for iOS). Here are the docs on it :) https://github.com/react-native-community/cli/blob/master/docs/autolinking.md#custom-root-monorepos-1
thymikee commentedon Jul 4, 2019
Oh I just thought that outputting a helpful message with autolinking docs link if the config command output is empty would be really helpful. Would you like to contribute that?
kidandcat commentedon Jul 4, 2019
mikemcelligott commentedon Aug 14, 2019
The above did not fix the problem for me, but a similar update is getting me much closer (but still not working app.... and this is a brand new app):
{root}/node_modules/@react-native-community/cli-platform-android/native_modules.gradle:173
-def command = "node ./node_modules/react-native/cli.js config"
+def command = "node ./node_modules/react-native/local-cli/cli.js config"
ErnesII commentedon Aug 16, 2019
For me it was just something stupid, in the file react-native.config.js, I just commented these lines:
tbergquist-godaddy commentedon Aug 27, 2019
Hi, I am also getting this error, and . I cannot seem to configure it correctly with the current options(I am hoping there is something I missed 😊 )
currently we have a structure like
Setting root to the project root, it will try to run
node ./node_modules/react-native/cli.js configin the project root, and report error on this line :this.packageName = json["project"]["android"]["packageName"].Setting the root to
rn-app-1, gives error on this linedef json = new JsonSlurper().parseText(reactNativeConfigOutput)Both errors makes sense, since the project root does not contain an rn app, and
./node_modules/react-native/cli.jsis not a valid path from the workspace root.What does work is keeping the root at the rn-app-1 workspace and change the command to
/node_modules/.bin/react-native config.I know there is an option using the
nohoistof react-native, but I would rather not, since DX is quite bad, we had it before, and upgrading dependencies could take up to 15 minutes ⌛️So, is there some setting I have missed, or would there be a possibility to add some config to tell rn-cli where to look for the rn-app config?
tbergquist-godaddy commentedon Aug 28, 2019
@thymikee @grabbou please ^^ 🙏
ldco2016 commentedon Sep 27, 2019
@thymikee , how can I confirm if this -> https://github.com/react-native-community/cli/blob/master/docs/autolinking.md#custom-root-monorepos-1
is the issue with Azure DevOps build? I do not get this error locally, but my Azure DevOps person consistently does. Do you or anyone know if the above is something that must be applied when building react-native in Azure?
alishgiri commentedon Nov 2, 2019
please first verify the
npm -vandnode -vgives you some version number.The problem was with using yarn. I use yarn instead of npm and was getting this error. when I reinstalled node then the problem was resolved. No need to change the node_modules files as it did manage to run but created several other problems later on. Hope this helps yarn lovers!