首页 > 解决方案 > GoogleMaps pod in module(framework): is implemented in both

问题描述

In my project I have some main targets and some modules (framewoks). My pod file:

platform :ios, '10.0'

use_frameworks!
inhibit_all_warnings!

def shared_pods
#     pod 'GoogleMaps'
# some other pods....
end


abstract_target 'defaults' do

# main
    target 'MyMainTarget' do
        shared_pods
    end
    target 'MyMainTarget-dev' do
        shared_pods
    end

# modules   
    target 'MyModule' do
# some other pods...
        pod 'GoogleMaps'
    end
end

In this pods, I see warnings about duplicated GoogleMaps, for example:

Class GMSMapsClearcutClient is implemented in both 
/private/var/containers/Bundle/Application/8BD854BD-F85C-4480-9FCB-C704FD8370EB/MyMainTarget-dev.app/Frameworks/MyModule.framework/MyModule (0x108905208)
and 
/private/var/containers/Bundle/Application/8BD854BD-F85C-4480-9FCB-C704FD8370EB/MyMainTarget-dev.app/MyMainTarget-dev (0x105cab3d0).
One of the two will be used. Which one is undefined.

And my app crash on showing google map with reason: Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[GMSx_GMPCClientVectorTileExtensionsRoot indoorBuildingMetadata]: unrecognized selector sent to class 0x102f21988'

shared_pods dont contain GoogleMaps, GoogleMaps included only in MyModule. MyModule inluded in MyMainTarget-dev: General -> Frameworks, Libraries and Embedded Content.

I think, that imports should next: MyMainTarget-dev <- MyModule <- GoogleMaps.

But obviously this is not true in my case. I dont understand, why in this scheme GoogleMaps imports in MyMainTarget-dev.app/MyMainTarget-dev. I suspect this is due with Build Settings -> Framework Search Paths (at now it $(inherited)), but my experiments with this parametr dont bring results

This problem only with GoogleMaps, other pods work good in this scheme (SnapKit, ObjectMapper for example).

What I doing incorrect? Any ideas what could be the problem?

标签: iosxcodegoogle-mapscocoapods

解决方案


推荐阅读