'The 'Pods' target has transitive dependencies that include static binaries' when installing GCM

前端 未结 5 1867
感情败类
感情败类 2020-12-06 04:45

I\'m trying to install Google Cloud Messaging for my iOS application (using swift). I\'ve added it to my Podfile like so:

# Uncomment this line to define a          


        
5条回答
  •  半阙折子戏
    2020-12-06 05:04

    Update

    With Cocoapods V 0.38.2 it is now possible to use GMC, or any other Objective-C frameworks with Swift frameworks like Alamofire

    Make sure that you use use_frameworks! in the podfile

    # Uncomment this line to define a global platform for your project
    # platform :ios, '8.2'
    use_frameworks!
    
    target 'Project' do
        pod 'Google'
        pod 'Google/CloudMessaging'
        pod 'Alamofire'
    end
    
    target 'ProjectTests' do
    
    end
    

    Old Answer

    I'm using a Swift project too and i'm only using Objective-C frameworks, because Swift & Objective-C frameworks didn't work for me yet.

    Try install GCM only without use_frameworks! and without the Alamofire framework (written in Swift)

    # Uncomment this line to define a global platform for your project
    # platform :ios, '8.2'
    
    target 'Project' do
        pod 'Google'
        pod 'Google/CloudMessaging'
    end
    
    target 'ProjectTests' do
    
    end
    

    I ran into some problems when I'm importing GCM in the bridging header file. I'm curious if you encounter the same problems.

    Solution for Google Cloud Messaging when the BridingHeader or GGLInstanceIDDelegate is not working, is to install 'Google' pod 'Google'

提交回复
热议问题