React native: xcode no such file or directory: libreact.a - xcode

I set up a project in React-Native with react-native init , and open iOS project in Xcode. whenever I tried to build, got the same error
no such file or directory: '/Users/vipinjoshi/Library/Developer/Xcode/DerivedData/AwesomeProject-eopkvbaiswfqmvgpwpyfvelrgrsk/Build/Products/Debug-iphonesimulator/libReact.a'
I can't understand what is wrong with the project. I have updated node, watchman, and react-native versions. My Xcode version is 9.2
what I tried:
1) clean and build
2) Clear Derived data

Related

XCode 14.0.1 error build: Command PhaseScriptExecution failed with a nonzero exit code (React Native project)

I'm trying to run my React Native project on XCode so that I can get it to run on my iOS device, everything works perfectly fine in VS Code and the Simulator software, but XCode simply refuses to build the project, throwing the error:
error build: Command PhaseScriptExecution failed with a nonzero exit code
This error occurs even when I try running an untouched new project (the example init project from react-native).
I tried these solutions:
deintegrating and reinstalling pods
running this command: npx react-native bundle --platform ios --dev false --entry-file index.js --bundle-output ./ios/main.jsbundle
Locking and unlocking the "login" keychain, I wasn't able to lock the keychain in the first place, the option is greyed out. What could cause that?
run pod install in the ios directory
I use:
XCode 14.0.1
M1 Macbook Air
MacOS Big Sur 12.6
React Native 9.1.3 (at least that's what npx react-native -v says, but node modules -> react-native -> package.json in my project says it's 0.70.1)
If there are any more details you need please let me know, thanks.
EDIT: Here's a screenshot of the build's report in the report navigator
screenshot

react-native run-ios fails to build

I have an existing project, that have been tested on an windows + android setup. Now I'm trying to run it on a macbook to test on an Iphone 11 simulator.
react-native-cli: 2.0.1
react-native: 0.64.0
I install the pod file and try to run
react-native run-ios
I get a the following error:
** BUILD FAILED **
The following build commands failed:
CompileC [USER]/Library/Developer/Xcode/DerivedData/andon-hkuetryxdipcrgbcxnseaqnfnaqp/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/ReactCommon.build/Objects-normal/x86_64/RCTTurboModuleManager.o [PROJECT_PATH]/node_modules/react-native/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModuleManager.mm normal x86_64 objective-c++ com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
I encountered this problem while running a React Native iOS app on macOS. After researching the issue for hours I was able to resolve it with these steps:
Clear the cache of pod by running these commands:
rm -rf ~/Library/Caches/CocoaPods
rm -rf Pods
rm -rf ~/Library/Developer/Xcode/DerivedData/*
pod deintegrate
pod setup
Navigate to the ios directory, and delete the Pods directory
While still in the ios directory, run pod install
Navigate back to the project directory, and run npx react-native run-ios
Hope this helps you too!
Probably very late to answer.
I started facing this issue after I upgraded from 0.63.4 to 0.64.2.
If we run from command line was not getting any way to find out the error. When I ran from x-code, found following error message,
/node_modules/react-native/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModuleManager.mm:172:8: 'shared_timed_mutex' is unavailable: introduced in iOS 10.0
The reason for that was the following entry in my podfile,
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0'
After I deleted the above entry it started working like a charm.
ref: https://github.com/facebook/react-native/issues/31250#issuecomment-808312355
Under XCode top menu, Goto XCode->Preferences -> Locations -> Open
Derived Data folder(By clicking the arrow button) (Find screenshot
for your references)
Finder will open Derived Data folder,
Delete Derived Data Folder
Start Metro server using npm start or yarn start
Perform Clean build using cmd+shift+k
Run the application using cmd+r

React native project deleted on xcode, can't run "run-ios react-native"

I've deleted my React native project while trying to make Google maps work on Xcode being .xcodeproje and .xcworkspace. Which means I am unable to run IOS simulator.
I've tried deleting Xcode and reinstalling but it doesn't find the react native project on Xcode. Tried linking the files and creating another project but no result. It gives the error below when I try building the simulator. The files that were in the deleted file are in my VS Codde within the ios file.
react-native run-ios --simulator="iPhone7"
error Could not find Xcode project files in "ios" folder. Run CLI with --verbose flag for more details.
Upgrade your react-native project to restore your deleted files.
1 - Delete your ios and android folder
2 - In your project directory:
react-native upgrade
3 - link for any native dependency:
react-native link
4 - And after that:
react-native run-ios

Flutter - Getting an error archiving with Xcode

I finished up my small flutter app, where I am using a webview (webview_flutter: ^0.3.5+3). All works great on simulator.
I have run flutter build iOS --release, selected runner from targets and set it to generic iOS device.
Now I want to archive it in Xcode but I keep getting this error about "Library not found for -lwebview_flutter"
I can't seem to find a solution and would really appreciate some help
If you're using Flutter plugins that installed Pods in the iOS build, make sure that you've opened the Xcode project with .xcworkspace
If that still didn't work, you can try regenerating the iOS build folder by deleting the /ios folder and run flutter create --platforms=ios to generate project files for the iOS build.

Missinig provisoning profile error when building an ios ionic app using xcode 10

I updated my version of xcode yesterday, and now when I build an ionic app that worked perfectly before I get the following error when validating the ipa:
Unable to process application at this time due to the following error: Missing Provisioning Profile - Apps must contain a provisioning profile in a file named embedded.mobileprovision..
How can I get the embedded.mobileprovision to be generated/ included?
Thanks,
Yuval
Currently the best workaround is to opt-out of the new build system:
If you're building on the command-line, you can specify --buildFlag="-UseModernBuildSystem=0":
Cordova CLI
cordova run ios --buildFlag='-UseModernBuildSystem=0'
cordova build ios --buildFlag='-UseModernBuildSystem=0'
Ionic CLI
ionic cordova run ios -- --buildFlag="-UseModernBuildSystem=0"
ionic cordova build ios -- --buildFlag="-UseModernBuildSystem=0"
If you're building with a build.json config file, you can add the following under the iOS release or debug config:
"buildFlag": [
"-UseModernBuildSystem=0"
]
If you are opening the project in the Xcode IDE, you need to change the build system in Workspace Settings to "Legacy Build System"
Solution from here
Worked For Me. Cheers.
https://github.com/apache/cordova-ios/issues/407 has an answer,
\just build with the --buildFlag="-UseModernBuildSystem=0" and adjust project settings to build using legacy mode.
It seems like this issue has been resolved with the release of cordova ios 5.0.0 ( https://cordova.apache.org/announcements/2019/02/09/cordova-ios-release-5.0.0.html ) - they added compatibility with the modern build system

Resources