Warrick
Warrick

Reputation: 1953

Google Maps Utilities IOS Pod error

I'm having trouble adding Google Maps IOS Utilities (for marker clustering) to my swift xcode project with pods. When I run pod install it fails with the following error:

The 'Pods-App' target has transitive dependencies that include static binaries: (/Users/warrick/Projects/orix/App/Pods/GoogleMaps/Subspecs/Base/Frameworks/GoogleMapsBase.framework, /Users/warrick/Projects/orix/App/Pods/GoogleMaps/Subspecs/Maps/Frameworks/GoogleMapsCore.framework, and /Users/warrick/Projects/orix/App/Pods/GoogleMaps/Subspecs/Maps/Frameworks/GoogleMaps.framework)

Google maps works fine, but as soon as I add the utilities it breaks.

What does this error message mean, and how can I go about resolving it?

Here is my Podfile:

# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
workspace '../app'

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

  pod 'GoogleMaps'
  pod 'Google-Maps-iOS-Utils'

  # Firebase - used for notifications
  pod 'Firebase/Core'
  pod 'Firebase/Messaging'

  target 'AppTests' do
    inherit! :search_paths
    # Pods for testing
  end

end

Upvotes: 6

Views: 9786

Answers (3)

Ragu Ram
Ragu Ram

Reputation: 69

i found the error on my project, it was the version difference in podfile and deployment info. so i changed the version in deployment info as like podfile, now the error got cleared .

enter image description here

enter image description here

Upvotes: 0

Ilya Shvedikov
Ilya Shvedikov

Reputation: 184

This is an issue that doesn’t have an out of the box solution due to Cocoapods limitations. The limitation occurs when an application is built in Swift, you are including use_frameworks! in your podfile, and are using a transitive dependency that is provided as a static library (such as Google Maps).

Becase Google will not provide a dynamic framework (until it supports iOS 7), the current workaround is to integrate Google Maps IOS Utilities manually into your project.

The integration steps are described here: https://github.com/googlemaps/google-maps-ios-utils/blob/b721e95a500d0c9a4fd93738e83fc86c2a57ac89/Swift.md

  • Remove Google-Maps-iOS-Utils from the Podfile (if it is there). In your project create a group named 'Google-Maps-iOS-Utils'.
  • Download the repo into your local computer.
  • Add the folders inside the src directory into your project by right clicking on the 'Google-Maps-iOS-Utils' group and selecting "Add Files to ..." (Make sure you select the target as your app target to avoid undefined symbols issue).
  • Make sure "Use Header Map" is ON for your app target in XCode Settings (it is ON by default in XCode).
  • Add a bridging header file with #import "GMUMarkerClustering.h" (note the relative path).
  • Open the umbrella header GMUMarkerClustering.h (under the Google-Maps-iOS-Utils/Cluster group) and change all the import paths to relative. For example, change #import <Google-Maps-iOS-Utils/GMUCluster.h> to #import "GMUCluster.h". (The 'Use Header Map' setting will resolve the relative path correctly).
  • Build your project.
  • That's it.

Upvotes: 16

Vahida Havaldar
Vahida Havaldar

Reputation: 524

I was able to install pod, error disappeared after I removed use_frameworks! from pod file because our project is in swift and added following lines to podfile pod 'GoogleMaps' # Objective-C pod pod 'Google-Maps-iOS-Utils', :git => 'https://github.com/googlemaps/google-maps-ios-utils'

Upvotes: 1

Related Questions