Xcode Architecture issue - ios

I am using xcode 6.4 in my project, it contains cocoapods where Pods are as follows:
pod 'ZXingObjC', '~> 3.0'
pod 'Google-Mobile-Ads-SDK'
pod 'iRate'
pod 'NewRelicAgent'
pod 'GoogleAnalytics'
pod 'Appirater'
pod 'Crashlytics'
But, after I update my pods I am getting the error which I attached to this image: Error is becuase of one pod

Need One project prefix header file
And add in bulid setting this .pch file.

So
FOR OBJECTIVE_C
yes this podfile should work,
FOR SWIFT add,this line too
use_frameworks!
YOU DON'T HAVE TO MENTION THE VeRSION OF ANY LIBRARY IF NOT MENTIONED ON COCOAPODS.
Lastly if you have taken care of all these
then try cleaning project cmd
+ shift+ k and then run project.
If still not working then delete manually the dependencies folders and reinstall them
# if there is problem with Google MobileAds-ios-Sdk, then you are stuck. Because there is some problem with them, and hence it would be better to install Google MobileAds-ios-Sdk manually only

Related

Many build errors after pod update

I have many pods installed in my project. Everything worked fine since my last pod update. After last pod update, I have 28 build errors starting with "Could not build module xxx".
Here is my podfile:
target 'projectXXX' do
use_frameworks!
pod 'Firebase'
pod 'Firebase/Database'
pod 'Firebase/Auth'
pod 'Firebase/Storage'
pod 'Firebase/Messaging'
pod 'Firebase/Crash'
pod 'TwitterKit'
pod 'Fabric'
pod 'Crashlytics' end
I tried to uninstall - install cocoapods.
I tried to deintegrate pod from project, install, remove .workspace file and deriveData folder... still got these errors.
I'm running out of ideas. Please, any other solution?
Thanks you very much
EDIT
I have just discovered that my Pods.framework is in red state as visible on screenshot below. Maybe this can help?
First try to remove cocoa pods completely
gem install cocoapods-deintegrate
pod deintegrate
gem install cocoapods-clean
pod clean
Then install again like this
pod setup
open -a Xcode Podfile
In Pod file add like this
# Uncomment this line to define a global platform for your project
platform :ios, '10.0'
# Uncomment this line if you're using Swift
use_frameworks!
target 'TestProject' do
pod 'Firebase'
pod 'Firebase/Database'
pod 'Firebase/Auth'
pod 'Firebase/Storage'
pod 'Firebase/Messaging'
pod 'Firebase/Crash'
pod 'TwitterKit'
pod 'Fabric'
pod 'Crashlytics'
end
target 'ProjectTests' do
end
pod install
Updating Xcode can resolve this issue. Thing is, pods might support multiple swift versions, so pods should be able to specify a range of swift versions.
Before Updating check if PODS_ROOT user-definer value in Build Settings of target is not deleted may be accidently. If so Try to add PODS_ROOT=${SRCROOT}/Pods
It's possible that you use old pods repositories and after update (that was few month ago) you need to specify which pod repository to use. I suggest that you need old one. See how looks my pod file for old project:
source 'https://github.com/CocoaPods/Old-Specs.git'
platform :ios, '9.0'
use_frameworks!
xcodeproj 'SF'
#link_with 'SF'
target 'SF' do
pod 'TransitionKit'
pod 'MBProgressHUD'
pod 'PureLayout'
pod 'UICountingLabel'
pod 'MWPhotoBrowser', :git => 'https://github.com/pash3r/MWPhotoBrowser.git', :branch => 'skyFlyWork'
end
What could cause the issue:
- Breaking changes in Pods/APIs
- Breaking changes due to support/non-support of Swift versions
If you are using a versioning system (Git, etc.).
Retrieve an older version of Podfile.lock.
Read that file (it's a text file, you can do more somePath/Podfile.lock in Terminal.app), and the "explicit" versions of your pods should be there.
You should get something like:
PODS:
- GSKStretchyHeaderView (1.0.3)
- Masonry (1.1.0)
...
PODFILE CHECKSUM: someCheckSum
COCOAPODS: 1.1.1
When you do pod 'Firebase' you don't specify a version, so you should get the last one. But if some versions are not compatible, you can get issues.
So you may add the '~> 1.0.3' (for instance if I take my example of GSKStretchyHeaderView). More informations on how to use it here.
So this way you should get back on a older version when everything was working. Now, you can check the documentation of each pods (and their respective podspec looking for "hidden" dependencies) and update them one by one checking which one is the culprit, and then maybe rising a flag (an issue) on their repo/git if needed.
For next dev, I'd suggest to set "version", to at least majors using the "optimistic operator ~>". If they respect the rules of versions, (major/minor/patch), then at least determine the major/minor, a patch shouldn't break anything, but fix things. A minor may have breaking change, while a major has a lot of probability to not be compatible with previous work (different declaration, classes renames, etc.).
If you don't use a versioning system like Git, I STRONGLY suggest you do now.
But if that's your case and you still have the issue. Remember a date when everything was working fine after a pod update/install. Then, go to each Git of your pods, and read the history to find the version at that date and set that version in your podfile for that pod.
Shen you are doing pod update which update all libraries most of the libraries on swift4 still some of them in swift3
If libraries are in swift 4 and your project in swift 3.2 you have two possibilities
you can migrate project to swift4
(or)
you need to rollback to the swift 3.2 supported pods
If project in swift4 libraries in swift3 you need to migrate those libraries into swift4 to solve current problem

Issues installing Alamofire pod (~4.4) in Xcode Project

I am trying to use Alamofire for my Swift project. The following is the podfile:
platform :ios, '9.0'
target 'CocoaExample' do
use_frameworks!
pod 'Alamofire', '~> 4.4'
end
I have spent around 5-6 hrs searching for solutions and tried but no luck.
Please let me know how to resolve the issue to install Alamofire ~4.4.
Follow the below steps to install Pods.
As I have just done it in sample project and it works for me :
Before we proceed make sure that you have pods installed on your computer.
With your project directory Open the terminal and hit below command
pod init
This will create Podfile in same directory.
Open Podfile and add target :
pod 'Alamofire', '~> 4.4'
fire commmand 'pod install'
This will install pod and it create pod workspace in your project.
close your xcode and go in the same directory. there will be file call yourprojectname.xcworspace . Open this file then you are all set to go.

Firebase Unity iOS Problems

I have setup Firebase successfully under my Android build in Unity, but am really battling getting it working in my iOS build.
Unity Firebase project was setup and looks fine:
I have followed all the steps on:
https://firebase.google.com/docs/unity/setup
I have installed CocoaPods:
skywalker:sl leonard$ pod --version
1.2.0
Here is the top level generated iOS project:
skywalker:sl leonard$ ls
Classes Libraries
Data MapFileParser
Info.plist MapFileParser.sh
LaunchScreen-iPad.png Unity-iPhone
LaunchScreen-iPad.xib Unity-iPhone Tests
LaunchScreen-iPhone.xib Unity-iPhone.xcodeproj
LaunchScreen-iPhoneLandscape.png UnityData.xcassets
LaunchScreen-iPhonePortrait.png build
I don't see the GoogleService-Info.plist file being added and also expected a Podfile (but I'm just guessing that it would generate one).
The project generates errors and trying to manually resolve them just creates more errors.
Here is the project right after the first build:
Trying to resolve this modules disabled error:
Then after building this is what I see:
I then tried adding the GoogleMobileAds.framework iOS framework:
After running again I get these errors:
After reading online about these errors there's a lot of mention around CocoaPods, but running pod init just created a blank workspace and didn't resolve my issue.
I had a similar problem and was able to get my app building in XCode by going to the App's Xcode directory and running "pod init". This created the podfile. I then edited that file with SublimeText (apparently some editors cause problems editing this file, I'm not fully clear on why) and adding the pods I needed. My podfile ended up looking like this:
platform :ios, '7.0'target
'Unity-iPhone' do
pod 'Firebase/Analytics', '~> 3.10'
pod 'Firebase/Auth', '~> 3.10'
pod 'Firebase/Core', '~> 3.10'
pod 'Firebase/Messaging', '~> 3.10'
pod 'Firebase/RemoteConfig', '~> 3.10'
end
I then ran "pod install" in the same directory and that created the .xcworkspace file (this took some time, as it installed several prerequisites). Opening the .xcworkspace file, I was then able to successfully build and run my app. I've run into additional run time issues (which is why I was on StackOverflow today), but that at least got the project compiling.
You will need a copy of the GoogleServices-info.plist file into the app's xcode directory. Unity copied it automatically for me, but YMMV.
Hope this helps.
Could you link the contents of you podfile? If you just added
pod 'Firebase/Core'
then that might not be enough: https://firebase.google.com/docs/ios/setup#available_pods
pod 'Firebase/Core' Prerequisite libraries and Analytics
pod 'Firebase/AdMob' AdMob
pod 'Firebase/Messaging' Cloud Messaging / Notifications
pod 'Firebase/Database' Realtime Database
pod 'Firebase/Invites' Invites
pod 'Firebase/DynamicLinks' Dynamic Links
pod 'Firebase/Crash' Crash Reporting
pod 'Firebase/RemoteConfig' Remote Config
pod 'Firebase/Auth' Authentication
pod 'Firebase/Storage' Storage
You might have to add all pods for the features you are using.
Disclaimer: I'm currently trying to get my build to run on ios as well (works like a charm on android). Just realized this issue myself, I also only included pod 'Firebase/Core' before.

Cocoapods frameworks not installing properly

I can't seem to understand what is going on with my project and cocoapods, Xcode cannot find the frameworks except Firebase which is why I am confused. I'm getting the error Project ' file not found. Xcode also gives me the error, In file included from <built-in>:342: I have tried to clean and build, emptying Xcode's cache and reinstalling Xcode. Can anyone please explain this thanks.
Here's my podfile:
# Uncomment this line to define a global platform for your project
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
target 'Soar_iPad' do
# Comment this line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for Soar_iPad
pod 'Firebase'
pod 'Firebase/Auth'
pod 'ExpandingMenu', '~> 0.1'
pod 'SwiftyJSON'
end
I figured out what was wrong and why Xcode could not find the pod files. It was because my directory had double quotation marks in it, for example I had /username/Desktop/Project "MyApp"/Project and Xcode could not find my pod files. But for some reason I found that using single quotes worked so for example /username/Desktop/Project 'MyApp'/Project. It's weird but glad a solution was found. Thanks to everyone that helped!
Delete workspace (.xcworkspace)
Delete Podfile.lock and Pods/ directory
Make sure your project builds
Upgrade cocoapods gem install cocoapods (optional)
Close project and run pod install
Can you try this:
pod deintegrate
pod install
If it doesn't work, create a new project and add the same Podfile (just change the target name). Run pod install.
If it compiles fine, then your project must have been misconfigured somehow. You may want to migrate your project into that newly created one. (copy all files and add project references)
If it does not compile, I think there is something wrong with your system.
Please try those steps and let me know if it works.
It seems that you cocoapods is the latest version.
Try to install cocoapods that lower than 1.0.
config the podfile and run pod install.

Xcode No such Module

I am trying to use the cocoapod Alamofire in Swift. However, I get the error "No Such Module" when I Import Alamofire I am using Xcode 7.2 Alamofire 3.0 and Swift 2 The following are the steps I took
1) In terminal I ran
$ sudo gem install cocoapods
There were no errors then
2) I ran
cd ~/Path/To/Folder/Containing/Project (once in the project folder I ran)
pod init
3) Then
open -a Xcode Podfile
4) Then I added
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
pod 'Alamofire', '~> 3.0'
to the Podfile
5) Then I ran
pod 'Alamofire', '3.0'
followed by
pod install
I added $(SRCROOT) to runpath and buildpath.
Also I found this answer No such module "Armchair" saying to add the pre-release but I don't really understand how to do this or if this is my problem. Maybe this is obvious ,however I'm new to Swift and am not understanding.
Also should Alamofire show up in my frameworks, or pods folder? It isn't in either.
files in project
After pod init you must use the new <YourProject>.xcworkspace instead of <YourProject>.xcodeproj.
The xcworkspace contains your project and your pods after pod install.

Resources