this question has been asked a ton of times already but I'm still not able to understand how to really solve this...
I'm a beginner guy in iOS i never did iOS before and I do not understand how this things works, like armv64, armv7, armv64e, armv7s... There are a ton of configurations in the project file I don't understand and I don't even know if they are right or wrong...
My situation at the moment is I'm trying to publish an app to app store but I received an e-mail saying this
ITMS-90809: Deprecated API Usage - Apple will no longer accept submissions of new apps that use UIWebView as of April 30, 2020 and app updates that use UIWebView as of December 2020. Instead, use WKWebView for improved security and reliability. Learn more
Well to my understanding I need to stop using in my app UIWebView and start using WKWebView.
It's ok I did change my code to support WKWebView, but the problem is I still get the error because i have an external library referenced in my Pods.
The library is named AFNetworking and through some research on this post they recommend to change on my Podfile from:
pod 'AFNetworking', '~> 3.0'
to
pod 'AFNetworking', '~> 4.0'
Very well I did change it but it also forced me to changed my deployment target from:
platform :ios, '8.0'
to
platform :ios, '9.0'
Because of this error, "Specs satisfying the AFNetworking (~> 4.0) dependency were found, but they required a higher minimum deployment target."
After I did that i launched the file .xcworkspace and when I try to build I always get these errors of duplicate symbols, lipo, mach-o linker, etc... And honestly this is really confusing to me.
I did try the clean / build method, deintegrate and install pods again, but doesn't solve it, can you please help me ?
EDIT
My Podfile pods:
pod 'MagicalRecord', '~> 2.2'
pod 'MLPAutoCompleteTextField', '~> 1.5'
pod 'MBProgressHUD', '~> 1.1.0'
pod 'ECSlidingViewController', '~> 1.3'
pod 'Fabric', '~> 1.7'
pod 'Crashlytics', '~> 3.9'
pod 'AFNetworking', '~> 4.0'
pod 'Firebase/Messaging'
Image of errors:
Thanks for everyone that helped me trying to get this fixed.
I was able to fix it by doing these steps:
I removed some librarys I had referenced in my target, by going to project view -> target -> general and then here I removed some duplicated librarys I had.
After that I closed XCode and then went to my project folder in finder and deleted, pods folder, podfile.lock, .xcworkspace file.
I also added a line in my podfile use_frameworks!
Open terminal, go into project folder, and did the following commands:
pod deintegrate
pod install
After that opened the newly created .xcworkspace file, clean project and then build.
I think the problem I had is that I had these frameworks in my project targets and they were the same as in the pods so that's why I had the issue of duplicate symbols.
Related
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.
Specs:
Xcode 8.2,
CocoaPods 1.1.1,
OSX 10.12.2
I split my project in 2 projects. One contains my providers (does api calls, database access, etc), the other the UI.
The UI project depends on the providers project. My configuration is working with the simulator but not with the device.
On device, I get:
dyld: Library not loaded: #rpath/Alamofire.framework/Alamofire
Referenced from:
/private/var/containers/Bundle/Application/EAD65532-DD02-4DA6-9877-7937F9D69F26/xxxxx.app/Frameworks/Providers.framework/Providers
Reason: image not found
This is my podfile:
use_frameworks!
workspace 'xxxxx.xcworkspace'
project 'xxxxx.xcodeproj'
project 'Providers/Providers.xcodeproj'
def shared
pod 'QorumLogs'
pod 'Reachability', '~> 3.2'
pod 'RealmSwift'
end
target 'Providers' do
project 'Providers/Providers.xcodeproj'
pod 'Alamofire', '~> 4.0'
pod 'Valet'
pod 'Starscream'
pod 'ChameleonFramework/Swift', :git => 'https://github.com/ViccAlexander/Chameleon.git'
shared
end
target 'xxxxx' do
project 'xxxxx.xcodeproj'
platform :ios, '8.0'
pod 'SwiftValidator', :git => 'https://github.com/i-schuetz/SwiftValidator.git', :branch => 'remove_delegate_callback'
pod 'SwiftCharts', :git => 'https://github.com/i-schuetz/SwiftCharts.git'
pod 'Google/SignIn'
pod 'SwipeView', '~> 1.3.2'
pod 'CMPopTipView', '~> 2.0'
pod 'KLCPopup', '~> 1.0'
pod 'ChameleonFramework/Swift', :git => 'https://github.com/ViccAlexander/Chameleon.git'
pod 'HockeySDK'
shared
end
I also added the binary of Providers to my UI target under "Embedded binaries"
It seems the UI project can't load the dependencies of Providers project. Don't know if this makes sense, but I also tried nesting the configuration of my UI project in Providers, in the podfile, and add inherit! :search_paths to it but it also didn't help.
It works only when I use the same dependencies in both projects.
Ideas?
Edit
I also get this warning when executing pod install, don't know if it's related:
[!] The Podfile contains framework targets, for which the Podfile does
not contain host targets (targets which embed the framework). If this
project is for doing framework development, you can ignore this
message. Otherwise, add a target to the Podfile that embeds these
frameworks to make this message go away (e.g. a test target).
While updating a Swift 2.2 project using the AlamoFire third party framework I ran into several issues just like yours including the dreaded dyld: Library not loaded ...... image not found.
After spending several hours reading about different explanations for the problem,trying to figure it out myself, and implementing many of the suggested fixes, I reached an impasse. Some of the solutions worked on simulator and not iPhone which gave me (false) encouragement to keep trying to fix the problem.
I eventually reached the conclusion that starting with a clean slate may be a better strategy. I had already shown that a new Swift 3 project could use AlamoFire 4.0 and other third party frameworks such as ReactiveSwift (via cocoapds) without a problem. I think this may be a general strategy that avoids the difficulty of tracking down build, build phase, or file location problems.
So here it is. It's very simple. Create a NEW project. Install the AlamoFire and all the other frameworks using cocoapods and test it to make sure it works. At this point delete files you will be replacing such as ViewController.swift and the Main.Storyboard, then drag over all the files from your old project. I converted to swift 3 before I did this to make things even easier. I rebuilt the project and it worked first time! Even the storyboard links were preserved like magic. 1h of work (if that) instead of several! I hope this works for you too!
I've run into a problem with Xcode (using Swift) that has me completely stumped. I realize that this question has been asked and answered, but none of the answers have worked for me, and my situation seems to be a bit different than the others, as all of my pods are failing (not just a specific one). They all worked fine a week ago.
I use Cocoapods for some of the more common Swift frameworks (e.g. Alamofire, Eureka, Kingfisher, SwiftyJSON, etc.). They were all working fine in Xcode 7. However, one of the (automatic) updates bumped up my Xcode version, after which it became mandatory to specify your target in the podfile. I did this and ran pod install. The pods are all still there, but now every import statement that relates to these frameworks fails.
At first I thought it was an Alamofire issue, as that's the first one that failed with the "No such module 'Alamofire'" error. I tried everything I could with Alamofire, including the following:
Clean and rebuild
Clean build folder
Restart Xcode
Re-boot computer
Delete all derived data
Added framework to "Linked Frameworks and Libraries"
Added framework to "Link Binary with Libraries"
Verified that I am opening the workspace rather than the project
Re-installed CocoaPods
Re-installed Xcode ver 7.3.1
Nothing would remove the "No such module ..." error. Finally, I removed Alamofire from the pods and just dragged the Alamofire project into my project. This allowed me to remove the import statements for Alamofire. However, to my dismay, now the next framework caused "No such module". I moved the next three frameworks into my project, and it looks like it is just going to keep going. Apparently, none of my Pods frameworks are being recognized anymore. I installed Xcode 8 and tried that with Swift 2.3, but I get the same "No such module" errors.
I really would prefer to use Cocoapods, as it makes upgrades a lot easier, along with other bonuses. I'm guessing I have some setting wrong that is screwing up all my pods, but have not had any luck finding it. This is a bit of a disaster as it has shut down development for several days, with no sign of a fix. If there is anything I can do or provide to assist in finding a solution, just let me know. If anyone could provide any possible solutions or even things to try, it would be greatly appreciated. I'm currently working with Xcode version 7.3.1.
My pod file looks something like this:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
target 'Y2GOsp' do
use_frameworks!
# Pods for Y2GOsp
pod 'Alamofire', '~> 3.0'
pod 'AlecrimCoreData', '~> 4.0'
pod 'Kingfisher', '~> 2.4'
pod 'Eureka', '~> 1.6'
pod 'SwiftyJSON', :git => 'https://github.com/SwiftyJSON/SwiftyJSON.git', :branch => 'xcode7'
pod 'PhoneNumberKit', '~> 0.1'
pod 'PKHUD'
pod 'Dollar'
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '2.2'
end
end
end
Comments from #l'L'l led me to the solution. I went to
build settings > frameworks search path
and set it to the following:
$(inherited) (non-recursive)
$(PROJECT_DIR)/build/Debug-iphoneos (non-recursive)
$(SRCROOT) (recursive)
It is now correctly finding the pod frameworks.
Make sure you opened the .xcworkspace file in Xcode and not just the .xcodeproj file.
In Pod file
Uncomment below lines to define a global platform for your project
platform :ios, '10.0'
use_frameworks!
Now in xcode
a) Clean your project
b) Make sure that all your "Pods" > "Build Settings" > "Build Active Architecture Only" is set to "NO"
c) Now, build project
Sometimes pod deintegrate and then pod install helps me as well
try to make the version of your SDK into earlier versions
pod 'Alamofire', '~> 3.0'
pod 'AlecrimCoreData', '~> 4.0'
pod 'Kingfisher', '~> 2.4'
pod 'Eureka', '~> 1.6'
pod 'SwiftyJSON', :git => 'https://github.com/SwiftyJSON/SwiftyJSON.git', :branch => 'xcode7'
pod 'PhoneNumberKit', '~> 0.1'
pod 'PKHUD'
pod 'Dollar'
for example change 3.0 to available previous version, it worked once for me when i was facing the same issue.
pod 'Alamofire', '~> 2.4' #I am assuming prev available version is 2.4
But it doesn't have to be the "Alamofire" version result in "No such Module", you may try every one in your list in the pod file.
I had the same problem and I just solved it by making sure that my "Find Implicit Dependencies" is checked. Go to Edit Scheme -> Build. Previously I uncheck this so my xCode will run a little bit faster. Never realized that it will later throw me this error.
Although the question is long time ago, "no such module" error made me in Xcode 13 struggle for 3 days. I found many different solutions here, but still cannot fix it. Until I tried applying different solutions together and found my own solution.
My issue is that I can build the app on device, but shows "no such module" when building it on simulator. It seems there is something wrong while building pods.
Therefore, I added use_frameworks! & use_modular_headers! in Podfile.
target 'Application' do
use_frameworks!
use_modular_headers!
pod 'ChameleonFramework/Swift', :git => 'https://github.com/wowansm/Chameleon', :branch => 'swift5'
pod "BSImagePicker", "~> 3.1"
pod 'FirebaseCoreInternal'
I also changed the Build Setting of the Pods to exclude building pods in architecture of arm64. I did the same in my Project and Target's Build Settings.
Image of Pods' Build Settings
Please note that if you install new pod to the project, the Build Settings of Pods will be reset. You need to mannaully change back to exclude arm64.
For me the problem was that I updated the name of a build configuration within my project, but I didn't select the new build configuration in the scheme that used that build configuration. Updating the build configuration within the scheme to the new name fixed the issue!
You should excluded Architecture to nothing, also I did run the pod install command to install the pods.
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
I've been having a sporadic issue when attempting to reference KIF in my Swift project.
My project stopped compiling after I did a "clean", and has been giving me the error: No such module 'KIF'
Here is my cocoapods file entry for KIF:
target 'MyProjectTests', :exclusive => true do
pod 'KIF', '~> 3.0', :configurations => ['Debug','QA']
end
(This is the recommended cocoapods config from KIF's readme.)
I can get it to compile again by changing the cocoapods entry from the above to:
pod 'KIF', '~> 3.0'
But the project crashes when attempting to run:
dyld: Library not loaded: #rpath/XCTest.framework/XCTest
Referenced from: /Users/albertbori/Library/Developer/CoreSimulator/Devices/29008343-5A97-47FB-B0E6-66D18A331BDA/data/Containers/Bundle/Application/C0E16F80-9A08-4228-96F7-8A24F08AB066/MyProject.app/Frameworks/KIF.framework/KIF
Reason: image not found
Then, if I switch it back to the original config, and do a pod install, testing with KIF works again...
How can I reference KIF correctly to ensure stable building and development with that framework?
After posting this issue on CocoaPods issue tracker, kylef helped me realize that I was inadvertently double-linking the pods.
Here is his pull request to resolve the issue on an example project I made.
In summary, the Podfile should look something like this, if you want to link both the root project and a test project, but conditionally add an extra pod to the test target:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
pod 'MBProgressHUD', '~> 0.8'
pod 'Locksmith'
target 'catch22Tests' do
pod 'KIF', '~> 3.0'
end
In this case, you DO NOT want to use: link_with 'catch22', 'catch22Tests' or it will link catch22Tests twice.