I use cocoapods to add the latest Realm (10.1.0), and open the .xcworkspace to compile the project directly after completion, and an error message appears when compiling, prompting "framework not found realm-sync". Can someone help me solve this problem?
platform:ios,'11.0’
use_frameworks!
target 'tessss' do
pod 'RealmSwift', '~> 10.1.0'
end
enter image description here
Related
I want run my app on emulator
But I get this error:
no such module 'Kingfisher'
pod update, pod install, delete DerivedData folder, restart xcode, use xcworkspace, use xcodeproj and ... not solved my problem!
OS: 11.4
xcode: 12.4
My pod:
platform :ios, '11.0'
use_frameworks!
target 'Name' do
pod 'QuickBlox'
pod 'Quickblox-WebRTC'
pod 'Alamofire'
pod 'Kingfisher'
pod 'NVActivityIndicatorView/Extended'
pod 'PulsingHalo'
pod 'ImageScrollView'
pod 'Firebase/Core'
pod 'Firebase/Messaging'
end
please use these commands in order in the project directory
1- pod deintegrate
2- rm podfile.lock
3- pod install
then clean project and build it should work
It happens to me sometimes.
first, clean build and then rebuild the project.
if there is no success try pod install, otherwise restart your device.
In my case Kingfisher worked with iOS and not with macOS. I used Xcodes package installer and not pod install. In order to fix my "no such module 'Kingfisher'" error for macOS:
I had to go to my TARGETS. (on the left side of General/Signing/etc)
Click on your macOS target.
Click "Build Phases" (2nd to last on the top row)
Go down to 'Link Binary with libraries.'
Click the '+' button and add the Kingfisher library.
If you have the error in your iOS version then add the library to that target instead. This won't fix everyone's issue, but no other solution I could find online worked and finally after clicking around I found this library was missing and it fixed my error, so I hope it helps someone.
Adding this to podfile helps me
post_install do |installer|
installer.pods_project.build_configurations.each do |config|
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
end
end
When I try to build my project, I get a compile time error saying that a "Module map file" for my pod cannot be found and that I am missing a "SwiftShimes" module.
This is weird because all my modulemap files are where they should be when I install my pods.
I am using Xcode 10.2 and Cocoapods 1.6.1.
I have tried the following ->
deintegrating cocoapods from my project
cleaning the project
deleted ModuleCache and DerivedData
restarting my computer
This is the type of error I am getting ->
Module map file '/Users/kaunamohammed/Library/Developer/Xcode/DerivedData/OutNow-gxdxvzwmnijmrlajtbtyclkhrgqs/Build/Products/Debug-iphoneos/CodableFirebase/CodableFirebase.modulemap' not found
I expect my project to build properly but this is not the case and I am not sure what else to do.
This is what my Podfile looks like
platform :ios, '10.0'
workspace 'OutNow'
target 'OutNow' do
use_modular_headers!
#Pods for OutNow
pod 'Instabug'
pod 'SwiftMessages'
pod 'CodableFirebase'
pod 'Firebase/Core'
pod 'Firebase/Auth'
pod 'Firebase/Storage'
pod 'Firebase/Firestore'
pod 'Firebase/Messaging'
pod 'Firebase/DynamicLinks'
pod 'MarqueeLabel/Swift'
pod 'RxSwift', '4.4.2'
pod 'RxCocoa', '4.4.2'
pod 'Kingfisher', '5.3.1'
pod 'InstantSearchClient', '6.0'
pod 'CoordinatorLibrary', '1.0.5'
pod 'UIScrollView-InfiniteScroll', '1.1.0'
target 'OutNowTests' do
inherit! :search_paths
# Pods for testing
end
end
In case it helps anyone else, I was able to solve this issue a different way. I was accidentally opening up my .xcproject instead of my .xcworkspace. When I opened the correct file, the error went away.
I fixed this problem myself. I can tell you what I did. Not sure which steps did it exactly, but below are all steps:
Copy the contents of your Podfile somewhere safe
Run: pod cache clean --all
Remove "Podfile"-file from the dir.
Xcode: Product > Clean Build Folder
Run: pod init. A new "Podfile"-file is added to the dir
Start adding parts of your original Podfile to this file
Run: pod install
Try to build your project again
In my case, I think the row use_frameworks! in the "Podfile" did the trick.
Hope this help you guys out!
I had this issue only when I wanted to make an archive. On the other hand, debug worked fine. After a while I noticed that min iOS version was different between my Target, Project and Podfile min iOS version. After syncing them all to same value (iOS 11) Xcode offered me Validate Project Settings - Update to recommended settings option which I accepted and I was able to archive my project.
I spent a whole day trying to figure out how to solve this issue. I was facing issue in my project on M1 machine.
I enabled "Open using Rosetta" option in Xcode and worked for me.
Here is how you do that:
Open Finder --> Applications --> Right click "Xcode" --> Get Info --> check "Open using Rosetta"
I solve this issue by removing OTHER_SWIFT_FLAGS custom flag in Swift Compiler - Custom Flags
OTHER_SWIFT_FLAGS = "$(inherited) -D COCOAPODS -Xcc -fmodule-map-file=\"${PODS_ROOT}/modulePath/moduleName.modulemap\"";
I faced this same issue but with Fastlane using gym build_app.
I ensured that min iOS version was synched between my Target, Project, and Podfile as mentioned by Josip B. This allowed me to archive my app using XCode but it still failed using Fastlane.
After lots of searching, it was able to resolve my issue by ensuring the IPHONEOS_DEPLOYMENT_TARGET version for each of my installed Pods inherited the version from my Podfile using this Podfile post-install script:
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'
end
end
end
Reference this post: https://stackoverflow.com/a/63489366/10211406
In case you are building on command line with xcodebuild, make sure you are using
xcodebuild -workspace ...
instead of just xcodebuild or
xcodebuild -project ...
I had this issue too, I'm not very familiar with XCode, but I opened the .xcodeworkspace file and then clicked build, which was successful!
It´ s a bit of a hack but try adding this in your podfile:
post_install do |installer|
installer.pods_project.targets.each do |target|
if (target.name&.eql?('FBReactNativeSpec'))
target.build_phases.each do |build_phase|
if (build_phase.respond_to?(:name) && build_phase.name.eql?('[CP-User] Generate Specs'))
target.build_phases.move(build_phase, 0)
end
end
end
end
make sure you add it to your bridge file, and Try to add this at the end of your podfile:
post_install do |installer_representation|
installer_representation.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ONLY_ACTIVE_ARCH'] = 'NO'
config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
end
end
end
I am currently unable to compile my podfile in Xcode10, and there doesn't seem to be much information online regarding how to fix this issue...
The current message I am getting is:
Showing All Messages
:-1: missing input '(File location)...Podfile.o' and no rule to build it
And this is my podfile:
source 'https://github.com/CocoaPods/Specs.git'
use_frameworks!
target 'App' do
project '/Users/Oskilla/Desktop/Swift/App/App.xcodeproj'
pod 'GoogleMaps'
pod 'GooglePlaces'
pod 'Google-Maps-iOS-Utils'
pod 'INSPhotoGallery'
end
Does anyone have any ideas on how to fix this issue?
Thanks a lot
You don't compile a Podfile. You use the CocoaPods gem to install and setup a CocoaPods integrated workspace:
Getting Started with CocoaPods
open terminal, cd /toPodFileDir/, then pod install
then open the xcworkspace file in your project folder and try to compile.
If you get errors after trying the above, let me know and I can edit.
None of my 'Firebase' pods are found.
I updated to Xcode 9.
Ran 'pod update'
deitegrated my pods, and re-installed
Deleted 'Derived Data' folder contents
Build from 'Generic Devices'
Added the paths in the Header Search Path in the Build Settings $(inherited)
and
"$(SRCROOT)/Pods"
and
"${PODS_ROOT}/Firebase/Core/Sources"
Cleaned, build, closed the app, re-installed Xcode, restarted the system, and did it all again.
2 Swift Compiler Errors are always there.
'FirebaseAnalytics/FirebaseAnalytics.h' file not found
and
Could not build Objective-C module 'Firebase'
I'm on Sierra 10.12.6
None of these has worked so far to get rid of them. Does anyone know of any other possible solutions?
Here is the pod file info.
Uncomment the next line to define a global platform for your project
platform :ios, '10.0'
target 'MP' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for MP
pod 'Firebase'
pod 'Firebase/Analytics'
pod 'Firebase/Core'
pod 'Firebase/Database'
pod 'Firebase/Auth'
pod 'Firebase/Storage'
end
------ UPDATE ------
as Hexfire suggested below. I removed pods and manually added the frameworks.
After some fiddling with the pathing for my MP.h file, that first error is gone, however now I am getting these compiler errors now...
:0: error: PCH file '/Users/.../Library/Developer/Xcode/DerivedData/MP-gwnwsbrisiyspxepcxkbrojwtfrs/Build/Intermediates.noindex/PrecompiledHeaders/MP-swift_ZJX6RAPYV1IT-clang_2SW1CJQDTFSBO.pch' not found: module file not found
clang importer creation failed
I built a .pch file 'MP.pch' and I pointed to it in the Build Settings Prefix Header with $(SRCROOT) with no luck. Do I have to put all of my Framework paths in there as well?
All of this seems related to the search paths. Does anyone have any other thoughts here? Perhaps an example of the build settings syntax? For example $(SRCROOT) with quotes or without? $(SRCROOT)/MP.pch or just $(SRCROOT)?
One of the good ways to make this work is by not using CocoaPods. You can grab all necessary Firebase libraries from here and use within your app (if link doesn't work, go here, and scroll down to "Integrate without CocoaPods").
After downloading:
Unzip and see the README file for which Frameworks to include in to your project.
Add the ObjC linker flag in your Other Linker Settings in your target's build settings.
This is a valid option and 100% workable.
P.S. If Firebase is the only pod you are using, you can quickly and safely clean your project from any CocoaPods trails by using pod deintegrate command.
Good luck!
If All Of this do not work Try this for once
run sudo gem install cocoapods
You can check your version by typing pod --version anywhere on your terminal.
Make sure you are using latest Version of it
In my project I got cocoapod installed. Here is the structure of Podfile
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
workspace 'TempWorkspace'
inhibit_all_warnings!
target 'proj1' do
pod 'ApplicationInsights', '1.0-beta.4'
pod 'Google/Analytics'
pod 'AFNetworking', '0.9.1'
pod 'MBProgressHUD'
pod 'Reachability'
end
target 'proj1Tests' do
end
target 'proj1UITests' do
end
In this, ApplicationInsights and GoogleAnalytics pod are not creating any issues. But if I add any pod except these 2 in this file, this is giving me following error
"ld: framework not found AFNetworking clang: error: linker command failed with exit code 1 (use -v to see invocation)"
Its not just about AFNetworking only if I write any other pod name also then also it is giving me same error with that pod name.
I tried looking for pod limitations but not it has not given me anything relevant.
If somebody has any idea please tell me.
Thanks in advance!!!
I hope it will help someone with a similar problem with Pods, this answer worked for me on XCode 8:
Delete all your Podfiles from the pods folder (Pods folder should
be empty)
Delete the xcworkspace file
run pod install
Change Build Active Architectures Only to NO for your target
and for all your pods (Click on Pods project and then on each single
Pod)
Add $(inherited) to the Framework Search Path setting of
your target
I run into this problem because I was trying to install the latest Atlas pod which is implicitly installing the latest LayerKit pod and a reference to a framework was missing. For those with a similar problem remember to add use_frameworks! to your podfile.
That same exact problem happened to me. The problem was that I was opening the .xcodeproj file instead of the .xcworkspace file. Once I opened the workspace file all my build errors were gone.
I had the same problems twice. I only use AFNetworking 3.0.4 or 3.1.0.
The method I handled with is to delete all the files:
podFile files, the Podfile.lock file, xcworkspace, the 'Copy Pods Resources' and 'Check Pods Manifest.lock' in Build phases of targets.
After deleting all these, I write the file of podFile and pod install. the problem is solved.