React-native - Build failed due to double-conversion - ios

I have created new react-native project through terminal.
react-native init PlayWithAnimation
when I run the react-native app through Xcode. I got this error.
/bin/sh -c \"/Users/sumit/Desktop/React\ Native/RNN/ios/build/Build/Intermediates/React.build/Debug-iphonesimulator/double-conversion.build/Script-190EE32F1E6A43DE00A8543A.sh\"
/Users/sumit/Desktop/React >Native/RNN/ios/build/Build/Intermediates/React.build/Debug-iphonesimulator/double-conversion.build/Script-190EE32F1E6A43DE00A8543A.sh: line 2: cd: /Users/sumit/Desktop/React: No such file or directory
/Users/sumit/Desktop/React >Native/RNN/ios/build/Build/Intermediates/React.build/Debug-iphonesimulator/double-conversion.build/Script-190EE32F1E6A43DE00A8543A.sh: line 3: /Users/sumit/Desktop/React Native/RNN/node_modules/react-native/React/scripts/ios-install-third-party.sh: No such file or directory
/Users/sumit/Desktop/React
Native/RNN/ios/build/Build/Intermediates/React.build/Debug-iphonesimulator/double-conversion.build/Script-190EE32F1E6A43DE00A8543A.sh: line 3: exec: /Users/sumit/Desktop/React Native/RNN/node_modules/react-native/React/scripts/ios-install-third-party.sh: cannot execute: No such file or directory
The following build commands failed:
PhaseScriptExecution Install\ Third\ Party /Users/sumit/Desktop/React\
Native/RNN/ios/build/Build/Intermediates/React.build/Debug-iphonesimulator/double-conversion.build/Script-190EE32F1E6A43DE00A8543A.sh
(1 failure)
These are the version which I have used:
node v8.0.0
npm 5.0.3
react-native-cli: 2.0.1
react-native: 0.46.0
xcode 8.3.3
I have checked related to other stackoverflow Q & A but did't get proper solution.
Temporary Solution:
It works smoothly if I create react-native with version="0.44.0". But in version 0.45.0, 0.46.0, 0.47.0 builds are failed and same "double-conversion" issue is getting. And one more thing, when I create new project third-party directory is missing.
node_modules/react-native/ (missing third-party directory)
What would be the problem ?
Tried Solution 1:
I did the following steps:
download the files needed inside the .sh, put it in the ~/.rncache/.
copy the downloaded files into node_modules/react-native/third-party/, ran tar -zxf *** to each file.
build again. But not worked.
Tried Solution 2:
Handling third party build error on react-native 0.46x.
and tried with github issue.
I was really excited to finally get started with React Native but this bug absolutely kills my ability to proceed. I'd really appreciate if someone could help me out with this.

Got the solution from jerry han here: The life saver
Hi Bala, As you can see the error log, That error was from ‘WhiteSpace’ on your working path.
Real Path : /Users/sumit/Desktop/React\ Native/
On cd cmd log : /Users/sumit/Desktop/React:
You should rename your working path to ‘/Users/sumit/Desktop/react_native’.
That will be helpful for you.
With developing or operation work, you may be better not to use ‘space’ on the path.

For me, what worked was just updating the Code Signing preference in Xcode to something different and back again.
E.g. I have Automatically manage signing originally turned on. Turning that off and back on again seems to resolve this issue.

Related

NativeScript IOS project.pbxproj not found

I am trying to run the hello world nativescript app using the command "tns run ios" but i am getting "Unable to apply changes on device: <device id>. Error is: ENOENT: no such file or directory, open '/<path_to_project>/NativeTest/platforms/ios/NativeTest.xcodeproj/project.pbxproj'.". Running it in Xcode works. I really ran out of ideas . Also, i checked and the file is actually there
After hours of time spent with this issue i found a fix, so maybe my answer would help somebody else. The issue was caused by me setting in XCode the dev team in the project. After i set the team project for the current project, i create a new project and it automatically got the team id i set at the old project without my intervention and now it works without errors. Yay
ns clean did it for me like it told me to do 😆 The platforms/ios folder appears to be invalid. If the build fails, run 'ns clean' and rebuild the app.
I was running npm run ios

React-Native: Build error GeneratedInfoPlistDotEnv.h file not found

I had a old React-Native project which I wanted to give it a try again and when trying to run the project on iOS (Android works perfect) I get the error that Debug-iphonesimulator/GeneratedInfoPlistDotEnv.h file not found.
If I run the project from the command react-native run-ios, than the build will succeed.
What can cause this issue and how can it be fixed?
I have tried to fix it with the comments from this issue but no success.
React-Native verision: 0.47
Full error:
<built-in>:1:10: fatal error:
'/Users/myUser/Library/Developer/Xcode/DerivedData/Project-gcaxrvbcwgkfhkadevoqxcprxszw/Build/Products/Debug-iphonesimulator/GeneratedInfoPlistDotEnv.h' file not found
I fixed by copying file GeneratedInfoPlistDotEnv.h (in /ios/build/Build/Products/) to the path mentioned in the error message.
The path mentioned in error message for simulator is not same as real phone, you need to copy for a second time.
The development for React Native just like droped in a deep black hole, what you need to do is just climb and climb and climb...
Changing the Info.plist preprocessor prefix file to works for me ${CONFIGURATION_BUILD_DIR}/../GeneratedInfoPlistDotEnv.h
Image of code in Xcode 9
If you're coming from React version 0.60 and above, you should be referencing the package from GitHub instead of NPM. The author hasn't released auto-linking support on NPM yet, even though it's already merged!?
Try these steps after you unlink and uninstall the existing version of react-native-config. Remember to revert to default Info.plist preprocessor settings in XCode build settings.
yarn add https://github.com/luggit/react-native-config.git
cd ios && pod install
You don't have to add any other post-install scripts, just run the app like usual and it should work fine. Make sure you undo any other fixes before doing this.

An application bundle was not found at the provided path... ":CFBundleIdentifier", Does Not Exist

I was working through this tutorial, however when I used the react native cli to generate a new project, it would not be able to launch ( with react-native run-ios). I kept getting the above error and I've tried troubleshooting for hours, I think it might be a problem with Xcode as I recently updated it but I'm not sure. Here is the full error message:
Installing build/Build/Products/Debug-iphonesimulator/auth.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
Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/auth.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist
If anyone has encountered this problem and fixed it please let me know what works for you! This has put me at a complete standstill and I would greatly appreciate any help. Could this be a versions issue that react native has not caught up with yet? Thanks!
There is something wrong with react-native init
Please do not initialize the project with react-native init ProjectName
You should append react-native version argument in the end.
For example:
react-native init ProjectName --version 0.44.2
If you are using XCode 10 try downgrading to XCode 9.4.1, by downloading and installing this version in official apple portal.
There might be a lot of possibilities of how to fix it, most of them are clearing npm cache, uninstalling node_modules, deleting ios and android folder and rebuilding, so you should try all of them. But downgrading XCode is what helped me after 5 hours at it
Good luck, don't be discouraged with this error, eventually you will find out the solution!

React Native Build Commands Failed: PhaseScriptExecution ... (domain=NSPOSIXErrorDomain, code=2)

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.
sudo npm start in project root solves the issue, but react-native run-ios still BUILD FAILED.
Thanks for your time viewing my question.
Try running react-native upgrade
See Github thread: https://github.com/facebook/react-native/issues/7308#issuecomment-219597774
For me port 8081 was in use :
lsof -n -i4TCP:8081
1.Go to File -> Project settings
2.Click the Advanced button
3.Select "Custom" and select "Relative to Workspace" in the pull down
4.Change "Build/Products" to "build/Build/Products"
5.click done, done
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.
For me I just needed to edit the iOS project build settings
Product Bundle Identifier was not set
You need to set it for both the Project and 2 Targets
Open your react-native project in Xcode
Create a new schema with project name.
the problem will be solved
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
For me, I needed to upgrade my version of XCode from Yosemite to Sierra.
This can be done via App Store > Updates.
What worked for me was running pod install from the ios directory
Running
npx pod-install
solved the problem for me.
Open Your Xcode project
Run it
You should have 2 errors from RCTSRWebSocket.m
add (void) to the beginning of both line :
SecRandomCopyBytes(kSecRandomDefault, sizeof(uint32_t), (uint8_t *)mask_key);
become
(void)SecRandomCopyBytes(kSecRandomDefault, sizeof(uint32_t), (uint8_t *)mask_key);
Save and Re-run your project with Xcode or terminal. It should work for sure. I have tested all the solution before, this one is the only who worked for me.
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];
}
I fixed my issue, you can try it if you are in the same condition.
I encountered the same error:
Print: Entry, ":CFBundleIdentifier", Does Not Exist
When I clone an existing react-native project from learning react native.
I initialize (using {react-native init yourProjectName}) a new project with the same name in a different directory
copy every useful *.ios.js file to this new project from the one I clone elsewhere.
This works for me.
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
For me, my problem was that Mcafee is running on port 8081, so I run the app on a different port following this answer https://stackoverflow.com/a/50649969/5323419
Basically:
react-native run-ios --port 1234
react-native start --port 1234
I am using React native 0.55+
Try to run
npx pod-install
Also check the permissions. Maybe you should run react-native run-ios with sudo?
For my case:
If your project folder name called like "Example Project"
You must change it to "Example_Project"
Spaces are causen this error.

mupdf not building in xcode

Not able to build mupdf. I am getting the following error:
Generating cmap and font files
Apple broke Xcode external targets yet again, and I can't be bothered to fix it.
Run the 'make generate' command manually from now on!
If you see an error while running GEN, you've forgotten.
Building libraries for i386.
GEN generated/cmap_cns.h
/bin/sh: ./build/debug-ios-i386/cmapdump: No such file or directory
make: * [generated/cmap_cns.h] Error 127
Do what the error message tells you to do.
Open a terminal, cd to the mupdf directory, and run "make generate".
The same problem.After "make generate", I restarted Xcode, then build successfully.
I was able to generate the MuPDF library without using any make generate or shell script.
I wrote a small step-by-step tutorial on this post.
Cheers

Resources