NativeScript IOS project.pbxproj not found - ios

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

Related

Xcode 10 - Can't Build React Native Application

Since updating the Xcode 10, I cannot build and run my app either on a physical device or on the simulator. I have tried via the terminal and directly through Xcode. What I have tried:
Removing my repo and re pulling.
https://github.com/facebook/react-native/issues/19573
https://github.com/facebook/react-native/issues/14382
https://medium.com/#swyx/if-you-get-a-third-party-config-h-35a3c54e9278
Print: Entry, ":CFBundleIdentifier", Does Not Exist
"config.h" file not found in iOS project of React native
I do not know what is left to do. I have had all the errors outlined in the above links. the main one that I am having trouble with at the moment is that config.h does exist and cfbundleidentifier", does not exist.
After following the instructions layed out in all the links provided, all I needed to do was run npm audit fix and it started working.

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.

React-native - Build failed due to double-conversion

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.

Build operation failed without specifying any errors for React Native Xcode project

I have a React Native project that works fine most of the time(Android and iOS). But sometimes out of nowhere I receive this error when I am trying to build the Xcode project (Xcode or react-native run-ios):
Build operation failed without specifying any errors.
Individual build tasks may have failed for unknown reasons.
One possible cause is if there are too many (possibly zombie)
processes; in this case, rebooting may fix the problem.
Some individual build task failures (up to 12) may be listed below.
How do I solve this? Push to a branch on git, fresh clone, npm install, and all is working fine for a period. And after that the problem will repeat. Making fresh clones of project each time is a pain and takes long time. Is there another way or something that I don't know?
Maybe a some files that are in .gitignore is causing the problems, and after a fresh clone that solves the problem. This is the .gitignore file for my iOS project:
# Created by .ignore support plugin (hsz.mobi)
# Xcode
#
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
*.xccheckout
*.moved-aside
DerivedData
*.hmap
*.ipa
*.xcuserstate
project.xcworkspace
I had this same issue and it was fixed by deleting the contents of node_modules and doing a npm install in the parent folder.
I was faced with this problem too. And I noticed that my folder name was too long. I changed the project folder's name with the short one and this error gone. Try to change the project folder name.
It was really a time killer issue. I rebased the complete code base to a collegue's mac where it worked fine. After sparing more than a couple of morning hours I could find a solution.
Solution - Simply shorten your Project folder name (in mac).
This is undoubtedly irritating that its suggested to have longer and meaningful variable names but the folder name has to be this concise.
I had a issue with XCode 9.1 and iOS 11...
I solved this issue moving up my folder to another path, I know it doesn't make sense and is dumb but it really work for me. My project was at /Users/Me/Documents/MyProjectDir and I changed to /Users/Me/Desktop/MyProjectDir
What helped me was removing the ios/build folder in my React Native project, followed by rebuilding the project.
I highly recommend to run the build on console, to see if it outputs any other relevant information.
react-native run-ios --scheme "app-debug" # Or any aproppriate target
Read more about building+archiving from CLI here or try with other OSS tooling like fastlane.
For me it found bugs twice, that both were unrelated with the building process itself:
1) One was fixed rolling back to node v8 (LTS) apparently. It was very obscure, but I suspect had to do with having little memory available (running flow + packager + xcode + spotify + chrome on 8GB RAM MBP)
2) The other one was related to having a space on the xcode output. "App Canary.app" could not be installed. I figured it out doing ls ios/build/Build/products.... This error only happened after upgrading xcode, and wasn't happening with the release target, that did not have any whitespaces.
The only take away here is to run build directly on the console to debug further. You might find out things that are completely unrelated, and probably can't be solved by just removing the build folder.
Hope it helps.
Trashing ios/Build resolved this issue for me
In my case simulator is not shutdown correctly.
So I opened simulator manually again then I got an error that simulator is not shutdown correctly.So I relaunched the simulator successfully and built xcode project again. Error is resolved

Meteor cordova ios project pch errors

I've been working on a Meteor project using Cordova to build an iOS app. It was working very smoothly for a while and then all of a sudden I started getting this error:
❯❯❯ meteor run ios
Error while running for mobile platforms: Error running
/Users/chet/.meteor/packages/meteor-tool/.1.0.37.19du6bc++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/tools/cordova-scripts/cordova.sh
2014-12-23 13:35:00.970 xcodebuild[46060:3143193] error: InputFile /Users/chet/Code/meteor/5cmenu/.meteor/local/cordova-build/platforms/ios/5C Menu/5C
Menu-Prefix.pch 0 1418992636 959 33188... malformed line 9; 'InputFile' should have exactly five arguments
If I open the .xcodeproj in .meteor/local/cordova-build/platforms/ios/, the project runs just fine. However, its an old version of my meteor app.
I tried deleting .meteor/local, then meteor run ios. I get the same error. And when I opened the .xcodeproj, it worked when I tried running it.
I also tried meteor remove-platform ios then meteor add-platform ios. Then I ran meteor run ios. I get the same error, but again, when I opened the .xcodeproj, it worked.
Theres a similar [issue posted here](https://github.com/meteor/meteor/issues/3105
).
A couple things I've tried are deleting the Xcode DerivedData folder, and cleaning my Xcode build cache for the project by running cmd+shift+K which seems totally unnecessary for this problem.
I also found a similar issue here that said this is a "non-fatal error".
Any ideas how to fix this problem?
So one of the ways reset your Xcode build is with rm -rf .meteor/local/. Then meteor run ios-device will build a new project. However, when you do this, you end up with his PCH error because of some sort of caching.
You'll find a path in your error that looks something like this
/var/folders/x5/mdr8syvj7lsb_sg_pr0j7y_h0000gn/C/com.apple.DeveloperTools/6.1.1-6A2008a/Xcode/SharedPrecompiledHeaders/
Notice the SharedPrecompiledHeaders part. Delete the app that starts with your app name. Then do this all over
rm -rf .meteor/local/
meteor run ios-device
Works every time
You have a space in your path, which is being interpreted as another argument.
/Users/chet/Code/meteor/5cmenu/.meteor/local/cordova-build/platforms/ios/5C Menu/5C
More info here: https://github.com/meteor/meteor/issues/3105#issuecomment-75580362

Resources