poulpix/PXGoogleDirections

Conflicts with Google Places SDK

KRUBERLICK opened this issue · 11 comments

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?

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

@poulpix
any updates for this ?

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.

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!

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

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...

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!

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 ?

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

hpbl commented

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

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