Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conflicts with Google Places SDK #28

Closed
KRUBERLICK opened this issue Feb 21, 2017 · 11 comments
Closed

Conflicts with Google Places SDK #28

KRUBERLICK opened this issue Feb 21, 2017 · 11 comments
Assignees

Comments

@KRUBERLICK
Copy link

KRUBERLICK commented Feb 21, 2017

I have pod GooglePlaces in my Podfile specified and I get an error. So, I need to do something else when using GooglePlaces SDK with PXGoogleDirections? PXGoogleDirections is only bundled with GoogleMaps SDK?

@ntphong1990
Copy link

me too,
'target has frameworks with conflicting names: googlemaps.framework.'

@embassem
Copy link

embassem commented Mar 7, 2017

@poulpix
any updates for this ?

@poulpix
Copy link
Owner

poulpix commented Mar 7, 2017

I need to do some tests to reproduce this.
Unfortunately, Google's pod management has always been a mess since they only provide static frameworks, not dynamic ones. If it's what I imagine, I'm afraid there won't be any simple workaround to this. Let me check though.

@poulpix
Copy link
Owner

poulpix commented Mar 7, 2017

I've reproduced the issue.
This is because behind the scenes, the GooglePlaces pod is using the GoogleMaps pod. This causes the issue you're all facing:

"target has frameworks with conflicting names: googlemaps.framework"

Unfortunately, the only workaround I've been able to find was to remove completely PXGoogleDirections from the Podfile, issue a pod update, and manually add all the source files directly to the project (you should add all .swift files in this directory: https://github.com/poulpix/PXGoogleDirections/tree/master/PXGoogleDirections).

While doing this, you'll also need to add pod GoogleMaps to your Podfile (and pod update again), so that all the dependencies of PXGoogleDirections are satisfied.

Cocoapods wizards, any help would be greatly appreciated on this!

@embassem
Copy link

embassem commented Mar 22, 2017

i had made the following and its worked for me

add as a submodule

add submodule https://github.com/poulpix/PXGoogleDirections.git Frameworks/External/PXGoogleDirections
change my project podfile

workspace 'MYPROJECT.xcworkspace'
project 'MYPROJECT.xcodeproj'
project 'Frameworks/External/PXGoogleDirections/PXGoogleDirections.xcodeproj'


target 'MYPROJECT' do
  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!

  # Pods for MYPROJECT
pod 'Alamofire', '~> 4.0'
pod 'AlamofireImage', '~> 3.1'
pod 'AlamofireNetworkActivityIndicator', '~> 2.0'
pod 'Moya', '8.0.0'
pod 'ObjectMapper', '~> 2.2'
pod 'Moya-ObjectMapper', :git => 'https://github.com/ivanbruel/Moya-ObjectMapper'
pod 'SwifterSwift'
pod 'GoogleMaps'
pod 'GooglePlaces'

End

target 'PXGoogleDirections' do
   
    pod 'GoogleMaps'
    
    project 'Frameworks/External/PXGoogleDirections/PXGoogleDirections.xcodeproj'
end

add reference to
PXGoogleDirections.xcodeproj
and
PXGoogleDirections/pod/pod.xcodeproj
then install pods for my project and PXGoogleDirections
and add PXGoogleDirections.framework and pods_PXGoogleDirections.Framework to MYPROJECT link frameworks

till now it works for me
i tried to add PXGoogleDirections.xcworkspace to project but it don't had the framework in it .

@poulpix

@poulpix
Copy link
Owner

poulpix commented Mar 25, 2017

Thanks @embassem, I will try to reproduce this and update the docs if it works for me. I have several open issues regarding this problem of mixing Google Pods with my own framework...

This was referenced Apr 11, 2017
@poulpix poulpix self-assigned this Apr 17, 2017
@poulpix poulpix added this to the Milestone v1.4 milestone Apr 17, 2017
@poulpix
Copy link
Owner

poulpix commented Apr 17, 2017

Closing this issue since it's being "fixed" in V1.4.
I've added hints on how to workaround the problem by using git submodules and compiling two different projects to avoid the compilation errors referenced in this issue.

Many thanks to @embassem for his help on dealing with this!

@CristianCardosoA
Copy link

Hello, after that I putted everything that @embassem said I could run the app, now when I try to open a map it says this:
reason: 'Google Maps SDK for iOS must be initialized via [GMSServices provideAPIKey:...] prior to use'

My GMSServices. provideAPIKey is already in AppDelegate

Any idea ?

@poulpix
Copy link
Owner

poulpix commented Oct 6, 2017

Hi @ChristianCardosoA, instead of calling GMSServices directly, could you please try initializing PXGoogleDirections by providing your API key to the init function?

@hpbl
Copy link

hpbl commented Jan 23, 2018

@poulpix i think you should add warning not initialize GMSServices directly on README

@poulpix
Copy link
Owner

poulpix commented Jan 27, 2018

@hpbl I’ve added a warning in the Readme in the « Usage » section. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants