Meteor cordova ios project pch errors - ios

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

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.

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

Why do I have to clean and restart project in order to run project with Firebase/Crash script file

Any idea why is that I have to clean my project, delete com.google.Symbol* and restart XCode every time I build a project that uses Firebase/Crash?
The problem seem to be with the uploading symbols script for Firebase/Crash.
Here is the process I need to perform everytime I want to run the project.
Clean project with (Shif+Command+K)
In the terminal delete com.google.Symbol
rm $HOME/Library/Preferences/com.google.Symbol*
Restart XCode
Run. It works fine but only one time, if I run it a second time I get an error.
ERROR: This is the error I get if I run the project a second time.
Here is my project and the path for the script.
If I check the Run script only when installing option in XCode, the project runs fine every time, but errors don't get symbolicated when shown in Firebase console.
Any idea what could I do to solve this issue?
FYI - I tried changing the path as follow but the behavior was the same.
"${PODS_ROOT}"/FirebaseCrash/upload-sym "${SRCROOT}"/Firebase-keys/firebase-crashreporting.json
I faced the same issue a few days ago, and it was really annoying. Use this script instead of the current one, this worked for me:
"${PODS_ROOT}"/FirebaseCrash/upload-sym-util.bash ${SRCROOT}/Project/Firebase_Crash.json

ios Could not get BatchedBridge, make sure your bundle is packaged properly

I am getting this while running app on simulator using xCode, version 9.2
I've tried other solution mentioned on Stack overflow & Github S1S2 S3 S4 but most of the solution are mentioned for android.
P.S. This project also includes purescript code explained here Integrate Pure Script in your React Native project
That's how I resolved it.
Terminate your metro bundler > react-native link > react-native run-ios
It was not bundling because of some errors which was not showing in the simulator but just this error was thrown.
create index.js, index.android.js and index.ios.js whith the same content. I do have all of them and it solved my issue
I have also faced the same issue when I changed the name of images saved in my local directory. In my case, I have just restarted metro bundler, deleted the app, and restarted the app. Issue was fixed for me.
Try this:
npx react-native-asset
then:
react-native run-ios
This issue is caused basically when some packages or images are not bundled properly, it might be caused because of improper assets path or internet issue when installing packages or reload issue. The expo bundles into a standalone library so it can be available immediately.
This error does not provide any stack to debug since it does not properly have the bundled data even for error stack.
I have just face few bundled scenarios
Scenario 1 => While the expo is running and we install a new library on fly, few times during this importing the library might not get bundled properly, so it's better to stop the expo and re-run, or try reloading the error in app. This will some time resolve the issue, or if there is some error it will show up the error stack
Scenario 2 => You have a customised asset director or have changed the asset path in app.json file improperly.
Please let me know in comments if there are any other scenarios
I had a metro bundler terminal window opened and whenever I was running npm run ios , it wasn't starting a new metro server, the problem was that. I closed the metro bundler terminal window and ran npm run ios and it opened a started a new metro server and the error was gone
I had a same issue, then I did:
rm -rf node_modules,
npm install
and restarted the metro (npm start). It worked.
In Settings, go to Privacy > Local Network to see a list of every app that requested access. I solved by allowing my app to access to the local network. (Trying to run on physical iPhone device from my mac m1 on the same wifi).
Source
Make sure that when you restart the expo project you do so with expo start -c
-c throws out the cache, otherwise the problem persisted for me.

React Native - Linked NativeModule works when run from Xcode, but not from packager

I recently added bugsnag-react-native and followed the directions for linking. When I run using the packager without Xcode, I get the following error screen.
When I search on Google for answers, the only relevant issue posted is Runtime Error: No Native client found which suggests that its a linking problem and to follow the directions, but from my perspective everything looks fine and I followed the direction.
What reason would a native module only be available when run from Xcode?
I had a similar issue and below solved it:
If you can successfully run from Xcode, then delete your ios/build folder (rm -rf ios/build) and re-run react-native run-ios.

Resources