Swift 3.0 xCode 8 Migration pod - ios

i have some problems with xCode 8.
I have converted my .xCodeproject in swift 3.0 sintax
i Have installed all cocoapods compatible with swift 3.0
Here my pods
So every pod require the legacy swift version OR xCode return ditto error OR xCode return some error about the pods sintax. Please help me.

to remove the pods requiring legacy swift version manually changed to YES task, add this script to your podfile. It will go through your pods and set it to use the 3.0 version
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |configuration|
configuration.build_settings['SWIFT_VERSION'] = "3.0"
end
end
end

1.latest xcode 8
2.if already pod file created in your project so then u do this command
open -e podfile
and then
use_frameworks!
target '<your project name>' do
pod 'Alamofire', '~> 4.4'
//your all pod put here above end
end

Related

Unable to build project with Stream Chat iOS SDK

I'm trying to use the new Stream iOS Chat SDK and am unable to get it to build after I install it via Cocoapods. The project was building with the other pods listed before we added StreamChat. I am using Xcode 10.2 (Does not work with 10.1), Swift 4.2, and Cocoapods version 1.7.4. We used the pod install command listed on Stream's website:
pod install --repo-update
Our Podfile looks like this:
platform :ios, '11.0'
inhibit_all_warnings!
target 'Project-iOS' do
use_frameworks!
# Pods for Project-iOS
pod 'ReachabilitySwift', '4.3.0'
pod 'SwiftKeychainWrapper', '3.2.0'
pod 'CropViewController'
pod 'StreamChat'
target 'Project-iOSTests' do
inherit! :search_paths
# Pods for testing
end
target 'Project-iOSUITests' do
inherit! :search_paths
# Pods for testing
end
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '4.2'
end
end
end
*Note that I tried this with and without the post_install bit at the end - but was having to manually change the pods to 4.2 since for many 5.0 isn't supported yet.
These are the errors I'm seeing when I try and build:
Edit: I also tried to get this running in a new blank project with just the StreamChat pod targeting iOS 11 (Basically just as the instructions on the site state for the ChatDemo) and ran into the same type of issues.
Related to your first question be sure to use Xcode 10.2 or later and Swift 5.
No need force pods to Swift 4.2. Try to remove these lines from your Podfile, then your project should compile without any errors:
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '4.2'
end
end
end

Xcode 10 Realm Swift "Module compiled with Swift 4.1.2 cannot be imported by the Swift 4.2 compiler"

I just updated to Xcode 10 but can't make my project compile because of Realm.
When I use import RealmSwift I have this issue:
Module compiled with Swift 4.1.2 cannot be imported by the Swift 4.2
compiler
I use Cocoapod and updated my pods. I have the last version of RealmSwift which is supposed to be Xcode 10 compatible. In the preferences the CLT is set to Xcode 10. In my project settings the language is set to Swift 4.
Using Realm (3.10.0)
Using RealmSwift (3.10.0)
I tried:
clean project and build folder
remove Realm from pods, build project then re-add
delete derived data
Here's my podfile:
source 'https://github.com/CocoaPods/Specs.git'
workspace 'ProjectName'
use_frameworks!
platform :ios, '10.0'
#deduplicate_targets: 'false'
inhibit_all_warnings!
def sharedPods
pod 'TwitterKit'
#pod 'TwitterCore'
pod 'Fabric'
pod 'Crashlytics'
pod 'RealmSwift'
end
target 'ProjectName' do
sharedPods
pod 'Firebase/Core'
pod 'Firebase/Messaging'
pod 'FBSDKCoreKit'
pod 'FBSDKLoginKit'
pod 'FBSDKShareKit'
target 'ProjectNameTests' do
inherit! :search_paths
pod 'TwitterKit'
end
end
target 'ProjectNameExtension' do
sharedPods
end
post_install do |installer_representation|
installer_representation.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '4.2'
end
end
end
I also tried removing the last part or changing with Swift 4.0 and even Swift 3.2.
I already saw similar questions on SOF but any reply worked for me.

Remove deprecated iOS framework warning in specific pod

I'm trying to not see this warning in the Atlas pod since its not my library.
'UIMutableUserNotificationCategory' is deprecated: first deprecated in
iOS 10.0 - Use UserNotifications Framework's UNNotificationCategory
I am using
inhibit_all_warnings!
in my pod file.
I also tried pod 'Atlas', '1.1.5', :inhibit_warnings => true which didn't work.
I'm thought if I change the platform from iOS 9 to iOS like this
platform :ios, '9.0'
It would no longer show the warning.
update
-Wno-deprecated worked when I put it in Atlas build settings under complier flags -> c++ flags.
Any way to do this in the podfile? so a pod install will not break it.
Add to your podfile the following statement, and then run pod install
pod 'YourPodToIgnore', :inhibit_warnings => true
Any way to do this in the podfile? so a pod install will not break it.
In this way you can set it the build_settings for every target:
post_install do |installer|
installer.pods_project.targets.each do |target|
installer.pods_project.build_configurations.each do |config|
config.build_settings['OTHER_CFLAGS'] = "-Wno-deprecated"
end
end
end

Workspace warning : Target Pods cannot link framework Foundation.framework

When building the workspace throws a warning:
Target Pods - {AppName} product Pods_{AppName} cannot link framework Foundation.framework
This started after updating to Xcode 9.4. I updated CocoaPods to the latest version, v1.5.3, but it didn’t resolve the warning.
This is due to using the new build system in Xcode. The issue has not been resolved in the latest version of CocoaPods yet, v1.5.3 as of writing this.
For now, you can resolve the warning by adding this post_install action to your pod file:
post_install do |installer|
podsTargets = installer.pods_project.targets.find_all { |target| target.name.start_with?('Pods') }
podsTargets.each do |target|
target.frameworks_build_phase.clear
end
end
After updating your pod file run pod install again.
Source: CocoaPods: Cannot link framework Xcode warning

GoogleSignIn/GIDSignIn.h file not found

I'm new to Unity iOS development and wanted to include a Google Play services in my Unity app. I've downloaded the Unity package (installed Cocoa, made sure my Pod file is set up correctly etc).
However, when I build my app I get GoogleSignIn/GIDSignIn.h file not found.
So far I've tried:
Installing 'Google/SignIn' using Cocoa (throws an invalid name
exception that)
Linking the GoogleSignIn bundle through Xcode linked
libraries (makes no difference)
Upgrading all packages (same as in Google/Signin) Adding
$(inherited) to linker flags (no change)
checking FrameWork Search path,Header Search path
Pods file:
platform :ios, '9.0'
target 'Unity-iPhone' do
pod 'GooglePlayGames', '~> 5.0'
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'NO'
end end end
I go through this links:
“GooglePlus/GooglePlus.h file not found” when trying to build my project
https://github.com/playgameservices/play-games-plugin-for-unity/issues/1526
https://github.com/playgameservices/play-games-plugin-for-unity/issues/1460
Change the pod file from below and again install the pod
platform :ios, '9.0'
target 'Unity-iPhone' do
pod 'GooglePlayGames', '~> 5.0'
pod 'Google/SignIn'
end

Resources