Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build error on ios device when enter 'yarn react-native run-ios' command #718

Closed
yunyami0605 opened this issue Jan 10, 2023 · 9 comments
Closed

Comments

@yunyami0605
Copy link

yunyami0605 commented Jan 10, 2023

environment

"react": "18.1.0",
"react-native": "0.70.3",
"react-native-config": "^1.4.11"

problem

build error comes up when enter 'yarn react-native run ios' (= yarn ios) command on the vscode

error

warning: Run script build phase 'Bundle React Native code and images' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'daesodong' from project 'daesodong')
warning: Run script build phase 'Start Packager' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'daesodong' from project 'daesodong')

** BUILD FAILED **


The following build commands failed:
        PhaseScriptExecution [CP-User]\ Config\ codegen /Users/cookie/####/Developer/Xcode/DerivedData/####-encgjdoyhlanbofkoxoagoqingng/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-config.build/Script-46EB2E0001CC10.sh (in target 'react-native-config' from project 'Pods')
(1 failure)

special note

it works fine on android and xcode build process
.env file has no blank sentence

how to solve this problem?

@yunyami0605
Copy link
Author

i solve to change version 1.4.6

@yeviDev
Copy link

yeviDev commented Jan 11, 2023

I saw this postings at fun. There seem to latest version be a lot of bugs and errors in any module haha.

@mthahzan
Copy link

mthahzan commented Feb 8, 2023

Is there a fix for this? I am seeing this problem after upgrading the React Native version to 0.71.2 and React Native Config version to 1.5.0. I prefer to not downgrade RN Config if at all possible.

@dibenduCfcs
Copy link

iOS bug #737 please refer this

@dibenduCfcs
Copy link

Please try

On Xcode create three different files for prod, dev, staging.
In that go Build->Pre-actions
Add Script

cp "${PROJECT_DIR}/../.env.development" "${PROJECT_DIR}/../.env"
touch "${PROJECT_DIR}/../node_modules/react-native-config/ios/ReactNativeConfig/BuildDotenvConfig.rb"

Change development to production or staging

@dibenduCfcs
Copy link

environment

"react": "18.1.0", "react-native": "0.70.3", "react-native-config": "^1.4.11"

problem

build error comes up when enter 'yarn react-native run ios' (= yarn ios) command on the vscode

error

warning: Run script build phase 'Bundle React Native code and images' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'daesodong' from project 'daesodong')
warning: Run script build phase 'Start Packager' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'daesodong' from project 'daesodong')

** BUILD FAILED **


The following build commands failed:
        PhaseScriptExecution [CP-User]\ Config\ codegen /Users/cookie/####/Developer/Xcode/DerivedData/####-encgjdoyhlanbofkoxoagoqingng/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-config.build/Script-46EB2E0001CC10.sh (in target 'react-native-config' from project 'Pods')
(1 failure)

special note

it works fine on android and xcode build process .env file has no blank sentence

how to solve this problem?
Please try

On Xcode create three different files for prod, dev, staging.
In that go Build->Pre-actions
Add Script

cp "${PROJECT_DIR}/../.env.development" "${PROJECT_DIR}/../.env"
touch "${PROJECT_DIR}/../node_modules/react-native-config/ios/ReactNativeConfig/BuildDotenvConfig.rb"

Change development to production or staging

@dibenduCfcs
Copy link

Please run this command after adding this code to package.json file

"ios:dev": "react-native run-ios --scheme 'TestAppDevelopment'",
"ios:prod": "react-native run-ios --scheme 'TestAppProduction'",
"ios:staging": "react-native run-ios --scheme 'TestAppStaging'"

After adding this code
run yarn ios:dev or yarn ios:prod or yarn ios:staging

@glennweb
Copy link

glennweb commented Jun 28, 2023

For me it all turned out to be a mismatch between the version of ruby in .ruby-version. And the version shown when typing rbenv global in the shell. Follow the rbenv instruction on how to install the correct version or change to a specific version

@yeviDev
Copy link

yeviDev commented Jun 28, 2023

@glennweb It is really nice answer. I saw good. LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants