React Native Build Commands Failed: PhaseScriptExe

2019-03-23 04:06发布

Environment

Mac OS X Version 10.11.3 (15D21)
Xcode Version 7.2 (7C68)
Simulator Version 9.2 (SimulatorApp-643)
react-native-cli 0.1.10
node v5.5.0

What I did before running the app

npm install -g react-native-cli
react-native init DemoProjectDELETEME
cd ./DemoProjectDELETEME
react-native run-ios

I am new to React Native. When I try to run the default app on iOS simulator I got the following errors. I found a similar issue but it does not solve my problem.

Xcode6 can't run any app in simulator ( Domain = NSPOSIXErrorDomain, Code = 3 )

After restart the machine and simulator the issues still persistent.

** BUILD FAILED **


The following build commands failed:
    PhaseScriptExecution Run\ Script /Users/x/Desktop/DemoProjectDELETEME/ios/build/Build/Intermediates/React.build/Debug-iphonesimulator/React.build/Script-006B79A01A781F38006873D1.sh
(1 failure)
Installing build/Build/Products/Debug-iphonesimulator/DemoProjectDELETEME.app
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=2):
Failed to install the requested application
An application bundle was not found at the provided path.
Provide a valid path to the desired application bundle.
Print: Entry, ":CFBundleIdentifier", Does Not Exist
/Users/x/Desktop/DemoProjectDELETEME/node_modules/promise/lib/done.js:10
      throw err;
      ^

Error: Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/DemoProjectDELETEME.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist

    at checkExecSyncError (child_process.js:464:13)
    at Object.execFileSync (child_process.js:484:13)
    at _runIOS (runIOS.js:77:34)
    at runIOS.js:24:5
    at tryCallTwo (/Users/x/Desktop/DemoProjectDELETEME/node_modules/promise/lib/core.js:45:5)
    at doResolve (/Users/x/Desktop/DemoProjectDELETEME/node_modules/promise/lib/core.js:200:13)
    at new Promise (/Users/x/Desktop/DemoProjectDELETEME/node_modules/promise/lib/core.js:66:3)
    at Array.runIOS (runIOS.js:23:10)
    at Object.run (/Users/x/Desktop/DemoProjectDELETEME/node_modules/react-native/local-cli/cli.js:86:13)
    at Object.<anonymous> (/usr/local/lib/node_modules/react-native-cli/index.js:73:7)

Got the follower error when I am trying to launch the app from Xcode.

enter image description here

sudo npm start in project root solves the issue, but react-native run-ios still BUILD FAILED.

Thanks for your time viewing my question.

13条回答
萌系小妹纸
2楼-- · 2019-03-23 04:12

Surprisingly, this was the solution for me: Open the file Views/RTCScrollView.m in Xcode and change the variable _refreshControl to refreshControl. All occurrences of _refreshControl were already marked as errors. The new code becomes:

- (void)setRefreshControl:(RCTRefreshControl *)refreshControl
{
  if (refreshControl) {
    [refreshControl removeFromSuperview];
  }
  refreshControl = refreshControl;
  [self addSubview:refreshControl];
}
查看更多
Animai°情兽
3楼-- · 2019-03-23 04:16
  1. Open your react-native project in Xcode
  2. Create a new schema with project name.
  3. the problem will be solved enter image description here
查看更多
等我变得足够好
4楼-- · 2019-03-23 04:17

For me port 8081 was in use :

lsof -n -i4TCP:8081

查看更多
相关推荐>>
5楼-- · 2019-03-23 04:18

Adding sudo in front of all commands solves the problem.

sudo react-native init ProjectName

sudo chmod 777 ProjectName

cd ProjectName
sudo react-native run-ios 
查看更多
相关推荐>>
6楼-- · 2019-03-23 04:20

Edit the file ,ProjectName/node_modules/react-native/local-cli/runIOS/runIOS.js Line no 18 : replace the entire line of code with the following :

return `build/Build/Products/${configuration}-${isDevice ? 'iphoneos' : 'iphonesimulator'}/${appName}.app`;

Line no: 146: uncomment '-derivedDataPath', 'build',

after that run the command from the terminal: sudo react-native run-ios

查看更多
甜甜的少女心
7楼-- · 2019-03-23 04:22

The problem is in the js file that builds and runs your app. Unless your project, scheme, and Product Name are all the same, you'll get errors, especially on simulators.

The good news is that I submitted a pull request that fixes the problem. Please go upvote it so we don't have worry about things breaking when we rename things.

查看更多
登录 后发表回答