模块未发现 - 的CocoaPods

问题描述 投票:1回答:2

我想这荚安装library到我的项目的(可以说孩子xcodeproj)父项目(可以说家长xcodeproj)。

儿童.xcodeproj都有自己podfile在那里我已经添加RxSwift,RxCocoa,境界,这GeoSwift库。这里是的CocoaPods文件,如下所示

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, "9.0"
inhibit_all_warnings!
use_frameworks!

project 'LocationManager/LocationManager'

def pods 

    pod 'GEOSwift'
    pod 'RxSwift', '~> 4.0'
    pod 'RxCocoa', '~> 4.0'
    pod 'RealmSwift', '~> 3.0'
end

target 'LocationManager' do

    pods

    target 'LocationManagerTests' do

        inherit! :search_paths

        pod 'RxBlocking', '~> 4.0'
        pod 'RxTest', '~> 4.0'
    end
end

这是的LocationManager安装到另一个XCode项目作为另一个podfile

def location_pods
   pod 'GEOSwift'


   pod 'LocationManager', :git => '[email protected]:myrepo/locationmanager.git', :branch => 'users/me/add-geoswift'

end

target 'TestApp' do

   location_pods

   project 'TestApp.project'
end

当我尝试编译TestApp目标,XCode中抛出一个错误如下enter image description here GeoSwift模块没有找到。这个错误是Pods > LocationManager > MockLocationManager.swift内其他地方进口在Pods > LocationManager作品在同一个模块。此外import RxSwiftimport RxCoca工作。当我访问Pods > Targets > LocationManager > Build Phases > Target Dependencies我看除了GeoSwift enter image description here所有舱体

我想知道如何解决这个问题?添加GeoSwift这个targetDependency没有任何编译。当编译LocationManager.xcworkspace作为一个独立的实体,它完美的罚款。该模块import GeoSwift不抛出任何编译错误。

ios xcode cocoapods
2个回答
0
投票

从我所知道的CocoaPods不支持子项目。我有这个问题也和我推动我所有的分项工程为主体的项目中的文件夹,并把它们不同的目标之下。现在,这些目标可以使用的CocoaPods了。


0
投票

我有类似这样的问题。

进入豆荚:

Image of the Pods button

然后点击“生成设置”,找到名为“雨燕语言版本”行,并尝试更新到最新的(在我的情况,它是4.1)。

How to update your Swift version

这为我工作!希望这可以帮助其他人在那里了。

更多信息:Xcode 9 Swift Language Version (SWIFT_VERSION)

© www.soinside.com 2019 - 2024. All rights reserved.