Failed to import GoogleMaps into the framework in Xcode 7

I have a new project in which I use Xcode 7 beta 3 and Swift 2.0 using GoogleMaps imported through cocoapods. This is a WatchKit 2.0 app, so I have a primary goal for the iPhone (Destinations), a target for the Apple Watch (Destinations WatchKitApp and Destinations WatchKitExtension) and an internal structure (DestinationsKit) that does the hard work for interacting with GoogleMaps among other things.

I can successfully import GoogleMaps into the main destination (Destinations) and successfully display the map.

import UIKit
import DestinationsKit
import GoogleMaps

class DestinationDetailsViewController : UIViewController
{
    // our selected destination
    var destination: Destination!

    // our map view
    var mapView : GMSMapView!

    // ... code to display a map centering on the destination ...
}

The above code imports my internal structure, DestinationsKit, and successfully uses GoogleMaps.

, , (DestinationsKit). , GoogleMaps, " " GoogleMaps ".

import Foundation
import CoreLocation
import GoogleMaps  // Error 'No such module 'GoogleMaps''

public class UserTrip {   
}

:

  • ' Build Phases' → 'Link Binary With Libraries', Pods.Framework( , )
  • " Framework Modules" ""
  • "" → " " ""

My Pods :

source 'https://github.com/CocoaPods/Specs.git'

use_frameworks!

pod 'GoogleMaps'

, Pods.Framework . , , GoogleMaps, .

!

+4
1

, , .

, Pods.framework , Pods, , "pod install". , Pods:

source 'https://github.com/CocoaPods/Specs.git'

# We need to link with all targets. If target is added, this must be updated

use_frameworks!

pod 'GoogleMaps'

link_with 'Destinations', 'DestinationsKit'

target 'Destinations' do
end

target 'DestinationsKit' do
end

, "" , , .

+2

Source: https://habr.com/ru/post/1598431/


All Articles