I'm using XCode 11.5 and created a empty project integrated with cocoapods 1.10.0.
When I add some dependency, the build phase "[CP] Embed Pod Frameworks" fails with following message:
/Users/jeferson/Projects/AwesomeProject/ios/Pods/Target Support
Files/Pods-AwesomeProject/Pods-AwesomeProject-frameworks.sh: line 131:
ARCHS[#]: unbound variable.
Podfile:
platform :ios, '10.0'
target 'Example' do
pod 'google-cast-sdk', '4.4.6'
pod 'ComScore', '~> 6.6'
end
Note: It works only in legacy build system
How to use run cocoapods projects on simulator?
Related
I'm using cloud firestore in my flutter application and I want to run app on IOS.
When i run my app on iOS device its give me that error:
/ios/Runner/generatedPluginRegistrant.m:10:9: fatal error: module 'cloud_firestore' not found
#import cloud_firestore;
~~~~~~~^~~~~~~~~~~~~~~
1 error generated.
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Analyzing workspace
note: Constructing build description
note: Build preparation complete
Could not build the application for the simulator.
Error launching application on iPhone 12 Pro.
this is my podfile:
# Uncomment the next line to define a global platform for your project
platform :ios, '10.0'
target 'Runner' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for Runner
pod 'Firebase/Auth'
pod 'FirebaseFirestore', :git => 'https://github.com/invertase/firestore-ios-sdk-frameworks.git', :tag => '8.0.0'
end
and when i add pods i also do flutter clean and pod install and after flutter run. And i faced this problem
1-flutter clean
2-rm -rf Pods
3-rm Podfile.lock
4-sudo gem install cocoapods-deintegrate cocoapods-clean
5-Pod clean
6-pod init
7-flutter pub get
8-flutter run
Perfect
make sure the package is up to date
Just change version of cloud_firestore: in pubspec.yaml like below
cloud_firestore: ^2.2.2
Then run:
flutter clean
flutter run
I have This code in Podfile
source 'https://github.com/CocoaPods/Specs.git'
target 'Kine' do
pod 'GoogleMaps'
pod 'GooglePlaces'
end
I want Install in Terminal
cd /Users/-----
pod Install
I received this error
[!] Automatically assigning platform ios with version 11.0 on target because no platform was specified. Please specify a platform for this target in your Podfile. See https://guides.cocoapods.org/syntax/podfile.html#platform.
and in the site I see iOS 10.6 but I don't have iOS 10.6 in Xcode when I change the target in iOS 8.0 or 9.0 or 10 it's not work again and received the same error
and the libPods.a its missing (Red)
Follow these steps:
Open terminal
type
sudo gem install cocoapods
create Podfile in your project root directory
Open Podfile
Type
platform :ios, '10.0'
use_frameworks!
target 'Kine' do
pod 'GoogleMaps'
pod 'GooglePlaces'
end
open terminal goto: cd /Users/path/to/project/root
type pod Install and press enter
goto your project root using Finder
open file Kine.xcworkspace
Run your project
I have a ObjC app project with a UI Automation Swift target in it. By default the Run and Test build work successfully.
But I have to add a Cocoa Pod with a Swift framework for the UI Automation target... Podfile:
workspace 'BlahApp.xcworkspace'
platform :ios, '8.0'
project 'BlahApp/BlahApp.xcodeproj'
target 'BlahApp' do
pod 'Blahpod', '~> 2.1.6'
pod 'Mehpod', '~> 3.10.0'
end
target 'BlahAppUITests' do
use_frameworks!
platform :ios, '9.0'
pod 'autom', :git => 'https://blah.to.my.repo', :branch => 'master'
end
So I add this, do a pod install, Xcode clean, Xcode Run --> works, Xcode Test fails with:
ld: library not found for -lAFNetworking
AFNetworking is used in Blahpod.
Time wasted trying to get Xcode/Cocoapods to do what I want: 2 days
Somebody please help me here. tried other people's solution to the error message to no avail.
in build setting , search for Run Path
then add "#executable_path/Frameworks" and Remove All other Content Related to AFNetworking
I recently upgraded to Xcode 8 and an existing project to Swift 3. After having a variety of issues with Cocoapods, I decided to start over from scratch. After running pod deintegrate and deleting Podfile, Podfile.lock, and [Project].xcworkspace, I had a blank slate as far as Cocoapods was concerned.
I then took the following actions:
Opened a terminal at the project location and ran pod init, then pod install (using the stub Podfile that pod init creates).
This appeared to be successful, but came with the following two warnings:
[!] The `Xena [Debug]` target overrides the `ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES` build setting defined in `Pods/Target Support Files/Pods-Xena/Pods-Xena.debug.xcconfig'. This can lead to problems with the CocoaPods installation
- Use the `$(inherited)` flag, or
- Remove the build settings from the target.
[!] The `Xena [Release]` target overrides the `ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES` build setting defined in `Pods/Target Support Files/Pods-Xena/Pods-Xena.release.xcconfig'. This can lead to problems with the CocoaPods installation
- Use the `$(inherited)` flag, or
- Remove the build settings from the target.
At this point, opening Xcode and building the project gives the "No such module" error, which is entirely expected.
Following the instructions at this question solves this problem and rerunning pod install is a success.
Closed Xcode, added the modules I'm using to the Podfile (see below), the ran pod install again. According to the terminal output, this is successful.
Opened Xcode and built the project. I again receive the "No such module" error, specifically No such module 'ReactiveCocoa'
I have confirmed that the same problem occurs with SnapKit, Hue, KMPlaceholderTextView, KeychainSwift, and Siren, depending on the order of the import statements. For some reason, none of the Google modules are affected by this problem.
My Podfile:
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'Xena' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for Xena
pod 'ReactiveCocoa', :git => 'https://github.com/ReactiveCocoa/ReactiveCocoa.git'
pod 'SnapKit', '~> 3.0.2'
pod 'Hue', '~> 2.0.1'
pod 'KMPlaceholderTextView', '~> 1.3.0'
pod 'GooglePlacePicker'
pod 'GooglePlaces'
pod 'GoogleMaps'
pod 'KeychainSwift', '~> 7.0'
pod 'Siren'
target 'XenaTests' do
inherit! :search_paths
# Pods for testing
end
target 'XenaUITests' do
inherit! :search_paths
# Pods for testing
end
end
Make sure you are opening .xcworkspace and not .xcodeproj file.
You may further look into this post.
Also under : Target > General > Linked Frameworks and Libraries
Make sure your frameworks are there. Even Pods_Xena.framework is there
Try:
Xcode ->Preferences ->Location ->DerivedData
open the folder DerivedData and move it to Trash
Uncomment the next line to define a global platform for your project
platform :iOS, '9.0'
Uncommenting the second line in your pod file will help you.
I'm trying to include Alamofire in my Swift project following the github(https://github.com/Alamofire/Alamofire#cocoapods) instruction.
I've created a new project, navigated to the project directory and run this command sudo gem install cocoapods. Then I faced following error:
ERROR: While executing gem ... (Errno::EPERM)
Operation not permitted - /usr/bin/pod
After searching I managed to install cocoapods by running this command sudo gem install -n /usr/local/bin cocoapods
Now I generate a pod file by pod init and edited it this way:
# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'
target 'ProjectName' do
# Comment this line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for Law
pod 'Alamofire'
target 'ProjectNameTests' do
inherit! :search_paths
# Pods for testing
end
target 'ProjectNameUITests' do
inherit! :search_paths
# Pods for testing
end
end
Finally I run pod install to install Alamofire. After that I open the project and import Alamofire statement gives me following error No such module 'Alamofire'
Update-1: Results of pod install is:
Analyzing dependencies
Downloading dependencies
Using Alamofire (3.4.0)
Generating Pods project
Integrating client project
Sending stats
Pod installation complete! There is 1 dependency from the Podfile and 1 total pod installed.
Open the .xcworkspace not the .xcodeproj
go to Product -> Scheme -> Manage Schemes...
and check Alamofire true
this work for me
Sometimes with no reason xcode can't load a module Alamofire. It can happen after a work session, after opening a project. The fix for this is to select a schema -> Alamofire, and run. If the message is "Successful", the schema can be changed back to project and it will work with no problems.
I suggest you to change your pod file like this below:
# Uncomment this line to define a global platform for your project
platform :ios, '8.0'
# Uncomment this line if you're using Swift
use_frameworks!
pod 'Alamofire', '~> 3.0' <<<---- Alamofire library is cross beetween projects
target 'NotifyM' do
end
target 'NotifyMTests' do
end
target 'NotifyMUITests' do
end
Another thing is use_frameworks! you should use this if the project is Objective-C based and try to use Swift pod library.
UPDATE: for the new cocoapods version 1.x the shared library should be like this:
# There are no targets called "Shows" in any Xcode projects
abstract_target 'Shows' do
pod 'ShowsKit'
pod 'Fabric'
# Has its own copy of ShowsKit + ShowWebAuth
target 'ShowsiOS' do
pod 'ShowWebAuth'
end
# Has its own copy of ShowsKit + ShowTVAuth
target 'ShowsTV' do
pod 'ShowTVAuth'
end
end
as indicated into cocoapods website :http://guides.cocoapods.org/using/the-podfile.html
you have to clean project and build, before you can import that library.
Install this way Pod file
# Uncomment this line to define a global platform for your project
platform :ios, '8.0'
# Uncomment this line if you're using Swift
use_frameworks!
target 'NotifyM' do
pod 'Alamofire', '~> 3.0'
end
target 'NotifyMTests' do
end
target 'NotifyMUITests' do
end
I suggest that and it's work for me :
platform :ios, '8.0'
use_frameworks!
target 'App' do
pod 'SwiftyJSON', :git => 'https://github.com/SwiftyJSON/SwiftyJSON.git'
pod 'Alamofire', :git => 'https://github.com/Alamofire/Alamofire.git'
end
After that, run : pod install in your project repository
2021 M1 USERS
according to: https://developer.apple.com/forums/thread/123614?answerId=683594022#683594022
close XCode
open Finder app and show there "Applications"
right click on icon Xcode and click on "Get info" (or something similar)
there is checkbox "Open with Rosseta" (or something similar). Select it
run Xcode again and try to build
it worked for me hope it works for you.
After a lot of efforts and all solutions provided above. I have fixed on Xcode 13.0:
Use for Simulator:
Go to:
- Build settings -> EXCLUDED_ARCHS = arm64
- Build settings -> VALID_ARCHS = arm64e armv7 armv7s arm64 x86_64
Use for Realm Device:
Go to:
- Build settings -> EXCLUDED_ARCHS =
- Build settings -> VALID_ARCHS = arm64e armv7 armv7s arm64
You should tap the Target to select Alamofire and build it once before coding.
When using Cocoapods to include dependencies always open your .xcworkspace
In Podfile use use_frameworks!
Remove any linked libraries from build phases.
In Build Setting look for Framework Search Path and add $(inherited) in both debug and release.
Do the same for Header Search Path too.
Now try a clean build.