My problem is that I can't import GoogleCloudMessaging, downloaded by podfile, to my Swift project.
My steps:
I installed it by
pod 'GoogleCloudMessaging', '~> 1.2'
http://i.stack.imgur.com/x3rKm.png
2.It has not ".framework", but ".a" file library. So I added this to my Linked Frameworks and Libraries:
http://i.stack.imgur.com/cImxW.png
Also I imported it to my bridging-Header and all is ok, I did not see any errors. Looks like:
#import <GoogleCloudMessaging/GoogleCloudMessaging.h>
So I tried to add library to my AppDelegate with:
import GoogleCloudMessaging
But it shows error "No such module 'GoogleClougMessaging'"
I read some posts about such problem with Google Frameworks, tried to set (changed Google to GoogleCloudMessaging):
"So Instead of adding $(SRCROOT)/Pods (recursive) I added:
"${SRCROOT}/Pods/Google" (recursive) to the Header Search Paths
"${SRCROOT}/Pods/Google" (recursive) to the Framework Search Paths"
But it did not help.
P.S.: sorry, I have not enough reputation to display images in post, so i added links to screenshots
EDIT
God, I did it.
Don't know why, but trying to 'pod Google/CloudMessaging' causes error "Specs satisfying the Google/CloudMessaging dependency were found, but they required a higher minimum deployment target.". But it was 8.0, so this is strange.
Finally I just download my project from my repo with "git clone ..." to new folder and then did "pod install", and all works fine, my 'pod Google/CloudMessaging' was installed successfully. The error with importing dissapeared, and I don't even need to put this library to Linked Frameworks and Libraries, and did not write any import to AppDelegate
Related
In order to implement Mapbox SDK, according to official docs (https://docs.mapbox.com/ios/maps/overview/#install-the-maps-sdk,
https://docs.mapbox.com/ios/navigation/overview/), adding Mapbox-iOS-SDK and MapboxNavigation through Cocoapods, always get error, shown bellow.
I thought this is related to the usage of sourcery or SwiftGen which are the parts of project or something else, but this happened on new, clean project also, where inserting SDKs was the first step.
Cleaned derived data for few times,
remove from Podfile versioning for that SDK (pod 'Mapbox-iOS-SDK', '~> 6.0.0' as pod 'Mapbox-iOS-SDK' )
even when SDK is added through CocoaPods, can't find frameworks to add into Link Binary With Libraries
even it says Copy Bundle Resources to be checked, couldn't find what to expect there
Note:
Also tried: successfully added Mapbox and MapboxMobileEvents directly into project, but as I found MapboxNavigation SDK could be implemented only through CocoaPods or Carthage, so I'm stuck here.
I would really appreciate for someone's help, who already have faced this problem.
Multiple commands produce '/Users/x/Library/Developer/Xcode/DerivedData/mbNavigationExample-ctztmwiegsuqkigkucoydhnnoaxc/Build/Products/Debug-iphoneos/mbNavigationExample.app/Assets.car':
1) Target 'mbNavigationExample' (project 'mbNavigationExample') has compile command with input '/Users/x/Desktop/mbNavigationExample/mbNavigationExample/Assets.xcassets'
2) That command depends on command in Target 'mbNavigationExample' (project 'mbNavigationExample'): script phase “[CP] Copy Pods Resources”
I have done every step that this link has instructed (https://developers.google.com/drive/ios/quickstart?ver=swift). However, I am getting an error for the line that says import GoogleAPIClient. The error states "no such module 'GoogleAPIClient'". I have read other threads that have mentioned Ruby and Cocoa Pods and both are up to date in my project.
I'm looking for any suggestion at this point I'm just baffled.
Before importing anything, make sure you build the project after the pod has completed the installation.
Also make sure you're using the .xcworkspace file too and not the stand .xcodeproj
I found out what was wrong. I found this answer: can't find Pods.modulemap - looking in wrong directory
The solution worked for me perfectly. It isn't addressing the same issue but the solution also solves this issue
Basically, do this:
Open terminal and type the following commands
cd ~/Library/Developer/Xcode/DerivedData
rm -rf Build/*
rm -rf ModuleCache/*
Close the terminal
Open Xcode and open the project
Product > Clean
Should work now!
Try the following workarounds:
Go into your build settings and define the Framework Search Paths to a folder which contains the frameworks in question. If the frameworks are placed in your project directory, simply set the framework search path to $(SRCROOT) and set it to recursive.
FRAMEWORK_SEARCH_PATHS build setting needs to point to the location of the framework.
Check these related threads:
Getting error "No such module" using Xcode, but the framework is there
No such module while importing my custom framework to the project
Close the Xcode.
Go into user(you)/Library/Developer/Xcode/DerivedData and delete the
folder contents.
If you have a build of you app in a running simulator you'll need to
also delete the build folders.
Reopen the Xcode. Clean & Build.
Bridge Google Drive API to Swift
You need 3 things:
(1) Well formed Podfile
platform :ios, '8.0'
target 'GoogleDrive' do
pod 'Google-API-Client/Drive', '~> 1.0'
end
(2) Expose Google API through the bridging headers
#import "GTMOAuth2ViewControllerTouch.h"
#import "GTLDrive.h"
(3) No reference GTLDrive required in the Swift client class
override func viewDidLoad() {
super.viewDidLoad()
// ...
let service:GTLServiceDrive = GTLServiceDrive()
service.authorizer = GTMOAuth2ViewControllerTouch.authForGoogleFromKeychainForName("Drive
API",
clientID: "YOUR_CLIENT_ID_HERE",
clientSecret: "YOUR_CLIENT_SECRET_HERE")
// ...
}
Duplicate interface definition for class 'GTMHTTPUploadFetcher'
Hope this helps!
Im trying to install the google tag manager sdk into my iOS app using swift. I've followed the instructions here
Getting Started Guide for Swift. On Section 3:Add a bridging header for Objective-C libraries. Step 7: Add these import statements to the header file:. I tried importing code into my bridging header file but when I try and build it comes up with an error that reads 'TagManager.h' file not found. - How do I solve this error and use google tag manager in swift?
I had checked Googledeveloper site given in your link.Give it a try by just adding your project name inftont of the BridgingHeader.h in Build Settings it may work. Eg: HippiTap/BridgingHeader.h
UPDATE: Tag Manager 5.0.6
At last found the reason for this issue,google has updated its TagManager pod file but not updated its tutorial
If you use pod 'GoogleTagManager’ in your pod file it will install the latest available pod (i.e)5.0.6
This version does't contain necessary file to import in BridgingHeader.h file as shown in https://developers.google.com/tag-manager/ios/v3/swift#add-bridging-header.If we use 5.0.6 pod file in xcode will look like below,
To solve this we have to reduce the version of TagManager.Now replace
pod 'GoogleTagManager’
with
pod 'GoogleTagManager’,’~> 3.15.0’
Now run pod intall in your terminal,
Installing GoogleTagManager 3.15.0 (was 5.0.6)
By changing the version of tag manager we are free to go by google's tutorial here .
Now the pod file will look like below
I think this may help you.give it a try and let me know the result.
I have installed Pod to use iOS Charts but stuck at the first line of code!
tried build and clean project - nothing
Tried to link binary with libraries with Charts-framework and then import Charts but there is warning that my project is inside of Charts module so import is ignored.
Can't understand why this class (or other classes from this pod) is not visible for main project?
According to the lib, the pod has been written in swift so make sure your pod file has use_frameworks! command in it.
Also currently the project name and the pod name are same that is Charts.
This can lead to path issues. please solve that by changing name of the project.
It will work
I'm using Cocoapods to install the following package in a brand new iOS project in Xcode.
https://github.com/jpsim/JPSVolumeButtonHandler
After adding pod 'JPSVolumeButtonHandler' to my Podfile and running pod install, I close the existing Xcode project and open the new xcworkspace file
If I then try to #import 'JPSVolumeButtonHandler.h' in my ViewController.h file, I get an error:
JPSVolumeButtonHandler file not found
I know this can sometimes be resolved by building the project, but even after doing so, I still get the same error. Anything I'm missing?
Just figured this out. In past Cocoapod libraries I had used, there was a single global file to be included that lived outside of the cocoapod library's directory.
In this case, I had to provide the full path from my Pod Root to the the header file I needed, which is located at pods/JPSVolumeButtonHandler/JPSVolumeButtonHandler.h
So my import statement now looks like:
#import "JPSVolumeButtonHandler/JPSVolumeButtonHandler.h"