steps to reproduce:
installed versions:
react 15.4.2
react-native 0.40.0
create a new Project
react-native init reactNativeTest
Running Project
1) Start Xcode
2) Open Project reactNativeTest
3) Run App
when I run it in xcode I get hellot of deprecation warnings, semantic issues and CoreFoundation Errors.
see screenshot
These are known issues in React Native 0.40 (reported in React Native github project as issue #11736) that occur for others (myself as well) on a fresh project.
As of 17 minutes ago, there are a number of pull requests which reduce some of the issues.
One commenter on the issue reports that "Those are warning and you can mostly ignore those warning. You project should run fine with those warning." I've confirmed this, but hopefully we'll get these warnings cleaned up soon.
Why
The OS Deployment target is way too low for many of these dependencies. Some are set to iphone 4!
I created a bug in React Native with this same solution
Solution
Copy function min_OSTarget_post_install into your Podfile
Call the function within post_install
pod install
See hundreds of Xcode warnings dissapear
Code
def min_OSTarget_post_install(installer)
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
if Gem::Version.new('8.0') > Gem::Version.new(config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'])
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0'
end
end
end
end
post_install do |installer|
...
min_OSTarget_post_install(installer) // ADD THIS LINE
end
Related
I am new to React Native. I am trying to build my app on my ios device. It is building fine in the emulator but whenever I try to do it on my ios device I am getting the following error (picture attached).
It used to build regularly on ios device. It stopped working after I installed firebase to it following the documentation,
https://rnfirebase.io/#3-ios-setup
Not sure but it might be a flipper issue with static libraries? But really struglling here on this for a few days. I even tried enabling and disabling the bitcode option in build setting and still the same error.
Seems like this is a problem with react native 0.69.1. The workaround (as detailed here) is to disable bitcode in xcode settings:
Then add the following to post_install in your podfile:
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'NO'
end
end
It should look like this:
Make sure to comment out flipper as well
Finally run pod install in the iOS directory
I'm using Xcode 10.2, Swift 5.
With Debug scheme, no issue happens, but with Release scheme when I build or archive, it shows Command compileSwift failed with a nonzero exit code.
I've tried delete DerivedData / Clean / pod deintegrate & pod install & pod update. None of these works.
For my project problem was related to pod Cache which gives error when Optimization Level for Release is set to Optimize for Speed [-O]. I have set Compilation Mode to Whole Module again and set optimization level for the pod in pod file:
post_install do |installer|
installer.pods_project.targets.each do |target|
# Cache pod does not accept optimization level '-O', causing Bus 10 error. Use '-Osize' or '-Onone'
if target.name == 'Cache'
target.build_configurations.each do |config|
level = '-Osize'
config.build_settings['SWIFT_OPTIMIZATION_LEVEL'] = level
puts "Set #{target.name} #{config.name} to Optimization Level #{level}"
end
end
end
end
Refrence: https://github.com/hyperoslo/Cache/issues/233#issuecomment-477749560
I fixed this issue by going Pods Project then to the building settings and setting Compilation Mode to Incremental for Release. Then clean and archive, should compile fine then.
So I had same issue when updating my project to Swift 5.
For some reason, Cocoapods (latest version, 1.6.1) set the SWIFT_VERSION of some pods to Swift 5 even if they're released as Swift 4, 4.1, 4.2 pods.
So I had to add a post install script that set the correction version of swift like so
post_install do |installer|
installer.pods_project.targets.each do |target|
if target.name == 'CryptoSwift' || target.name == 'SwiftyBeaver'
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '4.2'
end
end
end
end
I had the same issue after upgrading to Xcode 10.2. After following the steps below it worked for me:
Update pods
Clean project folder
Change Pods project's Swift Language Version to Unspecified and (as suggested by #Neil Faulkner) Compilation Mode to Incremental
I had to set "Optimization Level" in "Swift Compiler - Code Generation" to "Release" - "No Optimization [-Onone]" from "Optimize for speed" to make Cache pass Archive.
Same with SwiftyBeaver
It seems a problem related to Xcode 10.2. Also other pod projects seems to be fine with Optimization, like Toucan or XCGLogger.
In my case it just appeared probably because I ran project again while it was building.
So what I did was not only clean but also folder clean my project using
SHITF + ALT + COMMAND + K
also I deleted derived data and the project was up and running again.
you can follow this steps...
Make sure to change Swift version to your current version.
Update all your pods.
Clean all derived data of Xcode.
Now Restart your Mac.
You are getting all those error's just because of pods..so either you need to update every pod that you are using.
I'm using Xcode 10.2, Swift 5.
With Debug scheme, no issue happens, but with Release scheme when I build or archive, it shows Command compileSwift failed with a nonzero exit code.
I've tried delete DerivedData / Clean / pod deintegrate & pod install & pod update. None of these works.
For my project problem was related to pod Cache which gives error when Optimization Level for Release is set to Optimize for Speed [-O]. I have set Compilation Mode to Whole Module again and set optimization level for the pod in pod file:
post_install do |installer|
installer.pods_project.targets.each do |target|
# Cache pod does not accept optimization level '-O', causing Bus 10 error. Use '-Osize' or '-Onone'
if target.name == 'Cache'
target.build_configurations.each do |config|
level = '-Osize'
config.build_settings['SWIFT_OPTIMIZATION_LEVEL'] = level
puts "Set #{target.name} #{config.name} to Optimization Level #{level}"
end
end
end
end
Refrence: https://github.com/hyperoslo/Cache/issues/233#issuecomment-477749560
I fixed this issue by going Pods Project then to the building settings and setting Compilation Mode to Incremental for Release. Then clean and archive, should compile fine then.
So I had same issue when updating my project to Swift 5.
For some reason, Cocoapods (latest version, 1.6.1) set the SWIFT_VERSION of some pods to Swift 5 even if they're released as Swift 4, 4.1, 4.2 pods.
So I had to add a post install script that set the correction version of swift like so
post_install do |installer|
installer.pods_project.targets.each do |target|
if target.name == 'CryptoSwift' || target.name == 'SwiftyBeaver'
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '4.2'
end
end
end
end
I had the same issue after upgrading to Xcode 10.2. After following the steps below it worked for me:
Update pods
Clean project folder
Change Pods project's Swift Language Version to Unspecified and (as suggested by #Neil Faulkner) Compilation Mode to Incremental
I had to set "Optimization Level" in "Swift Compiler - Code Generation" to "Release" - "No Optimization [-Onone]" from "Optimize for speed" to make Cache pass Archive.
Same with SwiftyBeaver
It seems a problem related to Xcode 10.2. Also other pod projects seems to be fine with Optimization, like Toucan or XCGLogger.
In my case it just appeared probably because I ran project again while it was building.
So what I did was not only clean but also folder clean my project using
SHITF + ALT + COMMAND + K
also I deleted derived data and the project was up and running again.
you can follow this steps...
Make sure to change Swift version to your current version.
Update all your pods.
Clean all derived data of Xcode.
Now Restart your Mac.
You are getting all those error's just because of pods..so either you need to update every pod that you are using.
I installed RealmSwift using Cocoapods. It installed successfully, but when compiling it shows 96 errors as shown below
I have tried every solution I found on the internet. I have deintegrated the pods and installed again, but I keep getting the same errors. Please help!
It looks like Xcode is trying to run Realm Swift against the wrong version of Swift. A couple of things that I recommend you try:
Make sure to run pod spec update to update your local copy of Realm to the latest version.
Make sure you've followed the Realm CocoaPods instructions and added this to the bottom of your podfile:
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '3.0.2'
end
end
end
If that still doesn't fix it for you, please update your question with a copy of your podfile so we can review it. :)
When building my XCode project, for one of my cocoapod dependencies, libffi, I get 5 build errors, all along the lines of /Pods/libffi/ios/include/ffi_common.h:77:1: Unknown type name 'ffi_status'
Any ideas what I could try to debug it? I've already tried cleaning the project.
I have the same issue. Xcode 5.1 and Xcode 6.0 GM, both ios device and simulator.
This is also worked for me : http://cameronspickert.com/2014/01/20/remove-the-arm64-architecture-from-cocoapods-targets.html.
I had this problem compiling an open source project on iPhone 6 simulator.
Built it for earlier devices and it worked fine
There is an up-to-date solution. The problem is still the same, the 64-bit arch support for some third party library. Add this at the bottom of your Podfile:
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |configuration|
target.build_settings(configuration.name)['ARCHS'] = '$(ARCHS_STANDARD_32_BIT)'
end
end
end
It's a bit different (updated) from the indicated in one of the post above.