I have an app running fine with React Native 0.57.7 on CircleCI on Xcode 9.
But we need to bump up Xcode version to 10.1.0.
But when I switch it, Ci stops to work, even with enabling legacy system (-UseNewBuildSystem=NO or -UseModernBuildSystem=0 being passed to Fastlane's build_ios_app), I get "Myapp.app/main.jsbundle does not exist" error.
▸ + echo 'error: File /Users/distiller/project/ios/build/Build/Intermediates.noindex/ArchiveIntermediates/Myapp/BuildProductsPath/Release-iphoneos/Myapp.app/main.jsbundle does not exist. This must be a bug with'
▸ error: File /Users/distiller/project/ios/build/Build/Intermediates.noindex/ArchiveIntermediates/Myapp/BuildProductsPath/Release-iphoneos/Myapp.app/main.jsbundle does not exist. This must be a bug with
▸ + echo 'React Native, please report it here: https://github.com/facebook/react-native/issues'
▸ React Native, please report it here: https://github.com/facebook/react-native/issues
After some hours spent just to figure out what was going on with it, I found out the issue: the build is failing silently because the docker image for Xcode 10.1.0 on CircleCI is missing some dependencies needed to build the app by React Native.
The error was just saying “main.jsbundle does not exist”. It happens when xcode runs react-native-cli bundle from react-native-xcode.sh file. And it doesn't tell the root cause for the error: watchman is missing in the docker image used by this Xcode version.
Why those images don’t have the same installed packages? I don’t know. I was only expecting the same installed packages between the images.
Adding brew install watchman makes the CI pass again:
- run:
name: "Install React Native dependencies"
command: |
brew update
brew install watchman
I wish react-native-xcode.sh could return the root error instead of just main.jsbundle does not exist
Related
I am trying to run several dependencies on my flutter project however end up always getting the same error while running the project on ios and the full terminal message looks like this:
Xcode's output:
↳
=== BUILD TARGET Runner OF PROJECT Runner WITH CONFIGURATION Debug ===
Debug.xcconfig line 1: Unable to find included file "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
Debug.xcconfig line 1: Unable to find included file "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
=== BUILD TARGET Runner OF PROJECT Runner WITH CONFIGURATION Debug ===
/Users/username/Desktop/flutter_test/xylophone/ios/Runner/GeneratedPluginRegistrant.m:6:9: fatal error: 'assets_audio_player/AssetsAudioPlayerPlugin.h' file not found
#import <assets_audio_player/AssetsAudioPlayerPlugin.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
Could not build the application for the simulator.
Error launching application on iPhone X.
Launching lib/main.dart on iPhone X in debug mode...
Warning: CocoaPods not installed. Skipping pod install.
CocoaPods is used to retrieve the iOS platform side's plugin code that responds to your plugin usage on the Dart side.
Without resolving iOS dependencies with CocoaPods, plugins will not work on iOS.
For more info, see https://flutter.dev/platform-plugins
To install:
brew install cocoapods
pod setup
Xcode build done. 5.7s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Exited (sigterm)
This occurs with every dependency that I try to use from the flutter packages and I really don't know how to fix this. The process of installing cocoapods also doesn't work.
This has an existing GitHub issue. The error you've encountered was because the time you've installed cocoapods, it was installed with different version of ruby than you currently have active.
The recommended way to fix this is to to uninstall your existing cocoapods brew uninstall cocoapods and install a fresh one, via sudo gem install cocoapods.
Referring this issue, I've the same problem. I've MacOs El Captain on VMware.
Node v. 7.8.0
npm v.4.6.1
react-native-cli 2.0.1
react-native 0.46.4
Xcode v. 8.2.1
I've two issues:
- when trying to init a new react-native project, the packages fetching hangs on getting react-native 0.46.4 package from repo. Other packages were downloaded successfully. So I've execute npm install from Windows and then copied the node_modules folder on Mac.
- when trying to run the project on iOS simulator I recieve the following error:
** BUILD FAILED **
...
In file included from /Users/michelebombardi/Desktop/ReactNativeProjects/caliup/node_modules/react-native/React/../third-party/folly-2016.09.26.00/folly/Bits.h:70:
/Users/michelebombardi/Desktop/ReactNativeProjects/caliup/node_modules/react-native/React/../third-party/folly-2016.09.26.00/folly/detail/BitIteratorDetail.h:21:10: fatal error: 'boost/iterator/iterator_adaptor.hpp' file not found
#include <boost/iterator/iterator_adaptor.hpp>
The following build commands failed:
CompileC /Users/michelebombardi/Desktop/ReactNativeProjects/caliup/ios/build/Build/Intermediates/React.build/Debug-iphonesimulator/third-party.build/Objects-normal/x86_64/Conv.o /Users/michelebombardi/Desktop/ReactNativeProjects/caliup/node_modules/react-native/third-party/folly-2016.09.26.00/folly/Conv.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
Installing build/Build/Products/Debug-iphonesimulator/CaliUp.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/CaliUp.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist`
I really need to publish my app on the app store before the end of the week.
I've already try all suggested solutions but nothin works.
Could anyone help me?
First try this:
watchman watch-del-all && rm -rf node_modules
If you install node using Homebrew uninstall it and install node from here.(https://nodejs.org/en/)
Now if you used yarn to install node modules:
Try npm install
This error is caused by a failed third party library download in the build step. In your home folder there should be a ~/.rncache directory with a number of compressed C++ libraries. The error occurs when one or more of these files fails to download completely from the github amazon s3 servers. (likely in China)
The problem sticks around because the script in the react-native xcode build doesn't know how to resume the broken download. So you can fix this by deleting your ~/.rncache folder and because these folders are extracted into your modules you should also rm -rf node_modules and reinstall.
More info can be found here and here
May be this will work. Try these steps:
Backup your icons, images etc from ios folder.
Check that app name is set for key "name" in {project-root}\app.json file.
Delete ios/ and android/ directories
Run react-native eject
Replace the icons,images etc you copied earlier
Run react-native link
Launch you app from Xcode using short cut key command+r
getting this error
** BUILD FAILED **
The following build commands failed:
CompileC /Users/karthikn/AwesomeProject/ios/build/Build/Intermediates/React.build/Debug-iphonesimulator/React.build/Objects-normal/x86_64/RCTTabBarItem.o Views/RCTTabBarItem.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
Installing build/Build/Products/Debug-iphonesimulator/AwesomeProject.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/AwesomeProject.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist
Xcode 8.2 still occur same error. Three lines bellow fixed it for me :)
Downgrade react(16.0.0-alpha.12 -> 16.0.0-alpha.6) & react-native(0.45.0 -> 0.44.0)
rm -rf node_modules/react
npm i react#16.0.0-alpha.6 -S
npm i react-native#0.44.0 -S
Then run react-native run-ios
Your build could be failing because of the current node js version installed, or due to your pod files or a number of other reasons.
This error may also be when cloning a react native repository from github.
This solution may work as I was able to recreate this issue(refer to the screen shots):
Solution one:
firstly:
If you have the latest version of node js installed you may have some compatibility issues with some of the dependencies, install the recommended version of Nodejs instead.
after installation, reinstall your dependencies and update your pod files:
npm install
cd ios
pod install
or
pod update
solution two:
this can happen if you haven't installed react native previously on your system and are trying to run a clone react native repository from github.
brew install watchman
sudo gem install cocoapods
then in the rn project clone
cd ios
pod install
Problem:
This is what the error message looks like:
legacy compatibility issues:
Build failed
Solution:
After following the above steps this issue was resolved instantly:
If it's your first project, you may have the same problem than me:
do NOT use space in your project path! 🎉 😄
If your xcode is open, close it
Remove DrivedData
Update your pod files using pod update command
Run npx react-native ios command
its worked for me i hope work for you too
There's a good chance you're running an outdated version of React-Native and your template is no longer compatible.
There are instructions provided on ways to upgrade.
The simplest would be to run react-native upgrade and you'll be prompted with files react-native wants to overwrite. Clicking yes through all the prompts solved this issue for me but if you're concerned about losing any changes, it's recommended to install npm install -g react-native-git-upgrade and merge any conflicts after running react-native-git-upgrade
Try sudo react-native run-ios
This helped me
Check this In Your info.plist Bundle identifier
Or Add this Bundle identifier name as --> com.cmpname.yourapp // change name according
DO NOT use space in project path. It had solved my problem.
Replace Boost C++ Libraries with this one Download Link
/node_modules/react-native/third-party/boost_1_63_0
seems like there is an issue with the react-native version, downgrading the version will resolve the issue. Use the following commands:
rm -rf node_modules/react
npm i react#16.0.0-alpha.6 -S
npm i react-native#0.44.0-alpha.6 -S
react-native run-ios
There are different problems that cause this issue. I'll post here what I did to resolve in my case.
1 - Delete the folder node_modules and the folders of android and ios from project root:
rm -rf node_modules/ ios/ android/
2 - Rebuild the folders:
npm install && react-native upgrade
or (If you have used yarn in the project)
yarn install && react-native upgrade
3 - After that, just run the command again:
react-native run-ios
or
react-native run-android.
I hope it helped =)
I'm cloning a proyect:
The steps are:
npm i
react-native link
When i run it react-native run-ios i have a problem with RCTWebSocket library. This problem is easy to resolve if you search a little just need remove 2 compiler flags, in Custom Compiler Flags.
Later just i run again react-native run-ios and works fine, but when the app is open, show the next error:
Searching i found that is related to upgrade, source here
but i'm using that command and not works.
When this command is executed, it starts showing me some overrides to some files and at the end of this process, the problem persists.
My react info:
react-native-cli: 1.0.0
react-native: 0.32.1
I'm running in Xcode 8 and ios 10.0
PDTA: When I start a new project works perfect
UPDATES:
When clone on another mac works, I am ensuring to have the same versions of both xcode and node.
Could it be some mac configuration problem?
The only difference between the 2 macs is the cli version:
`react-native-cli: 1.1.0` --> my mac
`react-native-cli: 1.2.0` --> the other mac
Will this be enough to cause all this problem?
With React 0.32~0.37: The problem is most likely that you are using React 15.4.x instead of 15.3.x. One of the changes between 15.3 and 15.4 was that many of the modules under react/lib were moved to react-dom/lib, which is why the packager can't find react/lib/ReactUpdates.
Ensure that your package.json file locks React to 15.3.x:
"dependencies": {
"react": "~15.3.2"
}
Then delete your node_modules folder and run yarn or npm install again. Verify that you installed React 15.3.x:
$ npm ls react
app#1.0.0 /code/app
└── react#15.3.2
Last, restart the React Native server and load your bundle again.
This has been fixed!
Update your dependencies and use react-native ^0.38.0 or newer.
Run react-native upgrade after all react-native version upgrades.
I hope someone can help me. I'm really crazy, I've tried everything.
A few days ago installed Titanium Studio on my Mac, then install Xcode. I created a "single window Application Project". Without touching anything special puslo RUN> iOS Simulator> iPhone Retina (3.5 inch).
The program begins to build until the prompt type:
[INFO]: Invoking xcodebuild
[ERROR]: ** BUILD FAILED **
[ERROR]: The following build commands failed:
[ERROR]: Ld build / Debug-iphonesimulator / helloworld.app / helloworld Normal i386
[ERROR] (1 failure)
I updated all Xcode and everything related to Titanium.
Is there any solution?
I have read a lot a lot many forums, but I have not found any solution that works. I have cleaned the build folder, and even fails.
Can you think of anything?
Try installing the command line tools for Xcode. Xcode -> Preferences, Downloads.
Also try checking if you have a folder that has the same name as the app itself?
For me this was a caching issue causing the build to fail.
Delete all DerivedData from your Library root folder
rm -rf /Users/<Your Username>/Library/Developer/Xcode/DerivedData/*
Obviously, replace <Your Username> with whatever your username is (if you're not sure, just run the $ whoami command)
We need to clean cache
If you're using npm
watchman watch-del-all; npm start -- --reset-cache;
If you're using yarn
watchman watch-del-all; yarn start --reset-cache;
Re-install pods
cd ios; pod install; cd ..;
This worked for me at the very least.