CocoaPods - Unable to find a specification for `GoogleMaps` - ios

I'm new to iOS, i already have Alamofire and MarqueeLabel on my Podfile and now trying to add GoogleMaps, it keeps showing this message,
[!] Unable to find a specification for `GoogleMaps`
My Podfile looks like this
# Uncomment the next line to define a global platform for your project
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
target 'Migapixel' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
pod 'GoogleMaps'
pod 'Alamofire',
:git => 'https://github.com/Alamofire/Alamofire.git',
:branch => 'master',
:tag => '4.0.0'
pod 'MarqueeLabel/Swift',
:git => 'https://github.com/cbpowell/MarqueeLabel.git'
# Pods for Migapixel
post_install do |installer| installer.pods_project.targets.each do |target| target.build_configurations.each do |config| config.build_settings['ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES'] = 'NO' end end end
target 'MigapixelTests' do
inherit! :search_paths
end
target 'MigapixelUITests' do
inherit! :search_paths
# Pods for testing
end
end
i even tried this
pod 'GoogleMaps',
:git => 'https://github.com/CocoaPods/Specs.git'
What am i doing wrong?

Try removing source 'https://github.com/CocoaPods/Specs.git' and moving use_frameworks! out of the target block. Moreover you don't need to manually set the git path for both Alamofire and MarqueeLabel.
Try this:
platform :ios, '9.0'
use_frameworks!
target 'Migapixel' do
pod 'GoogleMaps'
pod 'Alamofire'
pod 'MarqueeLabel/Swift'
# Pods for Migapixel
end
post_install do |installer| installer.pods_project.targets.each do |target| target.build_configurations.each do |config| config.build_settings['ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES'] = 'NO' end end end
target 'MigapixelTests' do
inherit! :search_paths
end
target 'MigapixelUITests' do
inherit! :search_paths
# Pods for testing
end
Edit:
It seems that there's something wrong with your local repo.
Try cleaning and reinstalling:
pod repo remove master
pod setup

i resolved the issue like that with these step:
open terminal.
go to your project path.
type:
pod repo update
install pod again.

After trying many things Here is the fix!!
Imp: Make sure that you have these lines in your PodFile
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
target 'YOUR_APPLICATION_TARGET_NAME_HERE' do
pod 'GoogleMaps'
end
If the above is fine then you need to update the pods:
try the following steps:
Open a new terminal and run the following command in a temp directory.
pod try GoogleMaps
keep patience! It will take some time but will update the pod.
Now try to install the pod in ur project again. It should work.Else try to run the following commands in the project dir:
pod repo update
try again.
Comment in the case of any issue!!

Go to your project directory and delete pods folder and .lock file then run
pod repo update
it helps for me.

Related

No podspec found for xyz module

Hey I am trying to fetch .podspec file in my podfile. But I am getting weried issue
[!] No podspec found for `kotlinmultiplatformsharedmodule` in `https://github.com/vivek-modi/MultiplatformProject/tree/master/app/kotlinmultiplatformsharedmodule`
My project link and my .podspec file are store in this location.
podfile
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
source 'https://github.com/vivek-modi/MultiplatformProject.git'
target 'PodIosProject' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for PodIosProject
pod 'kotlinmultiplatformsharedmodule', :path => "https://github.com/vivek-modi/MultiplatformProject/tree/master/app/kotlinmultiplatformsharedmodule"
target 'PodIosProjectTests' do
inherit! :search_paths
# Pods for testing
end
target 'PodIosProjectUITests' do
# Pods for testing
end
end
Can someone suggest me what am I doing wrong here?

Can App Clip be used in an iOS Cocoapods project?

Our App was created in 2018 mid using Swift 4, and other 3rd party depended with Cocoapods.
I add one Clip target, the project structure is different from that given by the download link under session. Run this target, here are the crash errors:
Reason: image not found
dyld: Library not loaded: #rpath/Alamofire.framework/Alamofire
Referenced from: /private/var/containers/Bundle/Application/57185773-B735-4EE5-BB51-790DF004A85B/kt_iOS_Clip.app/kt_iOS_Clip
Reason: image not found
dyld: launch, loading dependent libraries
DYLD_LIBRARY_PATH=/usr/lib/system/introspection
DYLD_INSERT_LIBRARIES=/Developer/usr/lib/libBacktraceRecording.dylib:/Developer/usr/lib/libMainThreadChecker.dylib:/Developer/Library/PrivateFrameworks/DTDDISupport.framework/libViewDebuggerSupport.dylib:/Developer/Library/PrivateFrameworks/GPUTools.framework/libglInterpose.dylib:/usr/lib/libMTLCapture.dylib
Here is Podfile:
platform :ios, '10.0'
inhibit_all_warnings!
target '<Main App>' do
use_frameworks!
pod 'SnapKit' , '4.2.0'
pod 'Alamofire' , '4.7.3'
......
target '<Main App>Tests' do
inherit! :search_paths
end
swift_41_pod_targets = ['Spring','PKHUD', 'FSPagerView', 'SQLite.swift','FaveButton']
post_install do | installer |
installer.pods_project.targets.each do |target|
if target.name == 'Cache'
target.build_configurations.each do |config|
level = '-Osize'
config.build_settings['SWIFT_OPTIMIZATION_LEVEL'] = level
puts "Set #{target.name} #{config.name} to Optimization Level #{level}"
end
end
if swift_41_pod_targets.include?(target.name)
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '4.1'
end
end
end
end
target '<Main App>UITests' do
inherit! :search_paths
end
end
As other answers mentioned, separate app clip target and use_modular_headers! worked for me
platform :ios, '13.0'
target 'MainAppTarget' do
use_frameworks!
pod 'Firebase/Analytics'
pod 'Firebase/RemoteConfig'
target 'MainAppTargetTests' do
inherit! :search_paths
end
end
target 'AppClipTarget' do
use_modular_headers!
pod 'Firebase/Analytics'
target 'AppClipTargetTests' do
inherit! :search_paths
end
target 'AppClipTargetUITests' do
end
end
I fixed this problem by adding another target in my podfile which pointed to the AppClip target
Ref: https://www.natashatherobot.com/cocoapods-installing-same-pod-multiple-targets/
YES, but NO at present (2020.7.15).
igor-makarov had commit an app clip support to master, now just wait for next CocoaPods release.
https://github.com/CocoaPods/CocoaPods/commit/3a5deed0adfa306307027753898cca5e23be14bd
I think the right way to do it is having another target (in my case I placed it outside the main one, because I only want a few pods).
However, Cocoapods needs to update something to export/setup everything right. Since App Clips were introduced recently, Cocoapods hasn't released a new stable version with the fix (https://github.com/CocoaPods/CocoaPods/pull/9882). So we just have to wait a bit, I guess. In the meantime, you can add the Embed Pods Frameworks manually and it will work fine.
Ref: https://developer.apple.com/forums/thread/652683?login=true
What worked for me is doing:
sudo gem install cocoapods --pre
Cocoapods latest stable release at the time of this post was not supporting the app clip target with cocoaPods.

Cocoapod can't identify my target after it was renamed

I had been using cocoapods to pod stuff but after I've renamed my whole xcode project, the cocoapod doesn't reconise my renamed target when I am trying to pod lottie, and I don't know how to replace the target with the new one
This error showed in terminal
[!] Unable to find a target named `Infinity Math`, did find `Infinity Math.temp_caseinsensitive_rename`, `Infinity Math.temp_caseinsensitive_renameTests`, and `Infinity Math.temp_caseinsensitive_renameUITests`.
My Pod file
platform :ios, '12.0'
target 'Infinity Math' do
use_frameworks!
pod 'UITextField+Shake', '~> 1.2'
pod 'SPAlert'
pod 'CBFlashyTabBarController'
pod 'Spring', :git => 'https://github.com/MengTo/Spring.git'
pod 'lottie-ios'
target 'InfinityMathTests' do
inherit! :search_paths
end
target 'InfinityMathUITests' do
inherit! :search_paths
end
end
What should I do next in order to pod new pods?
Give the targets in the Podfile the same names that show up in Xcode:
target 'Infinity Math' do
target 'Infinity MathTests' do
target 'Infinity MathUITests' do
I've fixed it by renaming the target to the ones in the error
InfinityMath.temp_caseinsensitive_rename,
InfinityMath.temp_caseinsensitive_renameTests, InfinityMath.temp_caseinsensitive_renameUITests
It's weird

No such Module Firebase

I have a react-native project and I have to link my xCode project with firebase. Even though I used CocoaPod and manual ways I am getting the error
"No such module as firebase.h".
I have followed all the steps correctly.
Uncomment the next line to define a global platform for your project
platform :ios, '9.0'
target 'App' do
# Uncomment the next line if you're using Swift or would like to use
dynamic frameworks
# use_frameworks!
# Pods for App
target 'App-tvOSTests' do
inherit! :search_paths
# Pods for testing
end
target 'AppTests' do
inherit! :search_paths
# Pods for testing
end
pod 'Google-Mobile-Ads-SDK'
pod 'Firebase/Core', '~> 5.6.0'
pod 'GoogleIDFASupport'
end
target 'App-tvOS' do
# Uncomment the next line if you're using Swift or would like to use
dynamic frameworks
# use_frameworks!
# Pods for App-tvOS
end
I also faced this problem. I was using react-native-firebase package. Please try following their official docs . I would rate their documentation 10/10 as they've explained every possible scenario a developer would face during integration.
Just change value with deployment target of your app.
platform :ios, 'value'
inhibit_all_warnings!
def sharedpods
pod 'Google-Mobile-Ads-SDK'
pod 'Firebase/Core', '~> 5.6.0'
pod 'GoogleIDFASupport'
end
target 'AppTests’ do
use_frameworks!
sharedpods
end
target 'App-tvOSTests’ do
use_frameworks!
sharedpods
end
target 'App-tvOS’ do
use_frameworks!
sharedpods
end
#post_install do |installer|
# installer.pods_project.targets.each do |target|
# puts "#{target.name}"
# end
#end

The bundle “MyProjectUITests” couldn’t be loaded because it is damaged or missing necessary resources. Try reinstalling the bundle

I'm willing to add unit and UI tests to my app.
I first configured unit tests with success, I tried to do the same with UI tests. Here is my Podfile, after adding a new UI Testing Bundle target :
platform :ios, '8.0'
use_frameworks!
inhibit_all_warnings!
def shared_pods
pod 'Bolts'
pod 'Branch'
pod 'FBSDKCoreKit'
pod 'FBSDKLoginKit'
pod 'FBSDKShareKit'
pod 'GoogleAnalytics'
pod 'GooglePlaces'
pod 'Parse'
pod 'Toast-Swift'
end
target 'MyTarget' do
shared_pods
end
target 'MyTargetUITests' do
shared_pods
end
target 'MyTargetUnitTests' do
shared_pods
end
However, when I try to run the automatically created MyProjectUITests test case, which only contains the basic setup and without even a #testable import MyProject:
import XCTest
class MyProjectUITests: XCTestCase {
override func setUp() {
continueAfterFailure = false
XCUIApplication().launch()
}
}
I'm getting this error:
Running tests...
The bundle “MyProjectUITests” couldn’t be loaded because it is damaged or missing necessary resources. Try reinstalling the bundle.
(dlopen_preflight(/var/containers/Bundle/Application/5A1FE39F-E675-4A47-9BF4-FBCDB96F5821/MyProjectUITests-Runner.app/PlugIns/MyProjectUITests.xctest/MyProjectUITests): Library not loaded: #rpath/libswiftSwiftOnoneSupport.dylib
Referenced from: /private/var/containers/Bundle/Application/5A1FE39F-E675-4A47-9BF4-FBCDB96F5821/MyProjectUITests-Runner.app/PlugIns/MyProjectUITests.xctest/Frameworks/Toast_Swift.framework/Toast_Swift
Reason: image not found)
What is wrong? Thanks for your help.
EDIT : for information, it works fine when I remove that Toast_swift pod from my UI test target and let it only in my app and unit test targets.
Check out this issue on the cocoapods github issue tracker.
I'm still a little confused as to why this became a problem but the setting the ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES to YES using this script fixed the issue for me.
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
# This works around a unit test issue introduced in Xcode 10.
# We only apply it to the Debug configuration to avoid bloating the app size
if config.name == "Debug" && defined?(target.product_type) && target.product_type == "com.apple.product-type.framework"
config.build_settings['ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES'] = "YES"
end
end
end
end
Try adding inherit! :search_paths
and also changing ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES in post_install
use_frameworks!
def shared_pods
pod 'SomePod'
end
target 'App_name' do
shared_pods
end
target 'App_nameTests' do
inherit! :search_paths
shared_pods
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES'] = 'YES'
end
end
end
I too faced this issue and none of the other suggestions worked.
After a while I found out that specifically using print() anywhere in your code will somehow force libswiftSwiftOnoneSupport.dylib to be loaded and the issue will go away.
I'm using Xcode 10.1, Swift 4.2 and the pod that was giving me this issue was Nimble.
Hope this helps!

Resources