Search code examples
skmaps

Can I link to ScoutMaps and GoogleMaps?


If you set up a test project (called skobblerGoogleMapTest) that has the following Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, :deployment_target => '6.0'
pod 'ScoutMaps-iOS-SDK'
pod 'GoogleMaps'
link_with ['skobblerGoogleMapTest']

You will get the following set of link errors:

duplicate symbol ___gl_noBeginData in:
    /Users/tomhorn/dev/skobblerGoogleMapTest/Pods/GoogleMaps/Frameworks/GoogleMaps.framework/GoogleMaps(tess.o)
    /Users/tomhorn/dev/skobblerGoogleMapTest/Pods/ScoutMaps-iOS-SDK/SKMaps.framework/SKMaps(tess.o)
duplicate symbol ___gl_noEdgeFlagData in:
    /Users/tomhorn/dev/skobblerGoogleMapTest/Pods/GoogleMaps/Frameworks/GoogleMaps.framework/GoogleMaps(tess.o)
    /Users/tomhorn/dev/skobblerGoogleMapTest/Pods/ScoutMaps-iOS-SDK/SKMaps.framework/SKMaps(tess.o)
duplicate symbol ___gl_noVertexData in:
    /Users/tomhorn/dev/skobblerGoogleMapTest/Pods/GoogleMaps/Frameworks/GoogleMaps.framework/GoogleMaps(tess.o)
    /Users/tomhorn/dev/skobblerGoogleMapTest/Pods/ScoutMaps-iOS-SDK/SKMaps.framework/SKMaps(tess.o)
duplicate symbol ___gl_noEndData in:
    /Users/tomhorn/dev/skobblerGoogleMapTest/Pods/GoogleMaps/Frameworks/GoogleMaps.framework/GoogleMaps(tess.o)
    /Users/tomhorn/dev/skobblerGoogleMapTest/Pods/ScoutMaps-iOS-SDK/SKMaps.framework/SKMaps(tess.o)
duplicate symbol ___gl_noErrorData in:
    /Users/tomhorn/dev/skobblerGoogleMapTest/Pods/GoogleMaps/Frameworks/GoogleMaps.framework/GoogleMaps(tess.o)
    /Users/tomhorn/dev/skobblerGoogleMapTest/Pods/ScoutMaps-iOS-SDK/SKMaps.framework/SKMaps(tess.o)
duplicate symbol ___gl_noCombineData in:
    /Users/tomhorn/dev/skobblerGoogleMapTest/Pods/GoogleMaps/Frameworks/GoogleMaps.framework/GoogleMaps(tess.o)
    /Users/tomhorn/dev/skobblerGoogleMapTest/Pods/ScoutMaps-iOS-SDK/SKMaps.framework/SKMaps(tess.o)
ld: 6 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

So it looks like both ScoutMaps and GoogleMaps are linking to a tess.c which defines these symbols (some kind of GL tessellator callback mechanism? O_o).

I imagine it would be possible for ScoutMaps (or GoogleMaps, though that is less likely ;) ) to define these callbacks with different names?

If someone from ScoutMaps sees this, that would be awesome.


Solution

  • Indeed, using an older version than 1.10.1 - June 2015 of Google Maps SDK will cause this issue. Try with the 1.10.0 version of Google Maps SDK.

    Google stopped supporting iOS6, so this line:

    platform :ios, :deployment_target => '6.0'
    

    Results in older versions of the libraries being downloaded. Change it to:

    platform :ios, :deployment_target => '7.0'
    

    and everything works.