Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Project Doesn't Build With SwiftPM #326

Closed
michael-mckenna opened this issue Aug 11, 2020 · 9 comments
Closed

Project Doesn't Build With SwiftPM #326

michael-mckenna opened this issue Aug 11, 2020 · 9 comments
Assignees
Labels
priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@michael-mckenna
Copy link

Environment details

OS type and version: Xcode 12 Beta 4, MacOS Catalina
Library version and other environment information: 3.2.1

Steps to reproduce

  1. Create a new Xcode project with Storyboard
  2. Add this dependency via SwiftPM
  3. Build (CMD+B)

Code example

No Code Required

Stack trace

Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_GMSMutablePath", referenced from:
      objc-class-ref in GoogleMapsUtils(GMUGeoJSONParser.o)
      objc-class-ref in GoogleMapsUtils(GMUKMLParser.o)
  "_OBJC_CLASS_$_GMSGroundOverlay", referenced from:
      objc-class-ref in GoogleMapsUtils(GMUGeometryRenderer.o)
  "_OBJC_CLASS_$_GMSCoordinateBounds", referenced from:
      objc-class-ref in GoogleMapsUtils(GMUGeometryRenderer.o)
      objc-class-ref in GoogleMapsUtils(GMUDefaultClusterRenderer.o)
      objc-class-ref in GoogleMapsUtils(GMUGeoJSONParser.o)
  "_OBJC_CLASS_$_GMSPolygon", referenced from:
      objc-class-ref in GoogleMapsUtils(GMUGeometryRenderer.o)
  "_OBJC_CLASS_$_GMSMarker", referenced from:
      objc-class-ref in GoogleMapsUtils(GMUGeometryRenderer.o)
      objc-class-ref in GoogleMapsUtils(GMUDefaultClusterRenderer.o)
      __OBJC_$_CATEGORY_GMSMarker_$_GMSMarker_GMUClusteritem in GoogleMapsUtils(GMSMarker+GMUClusteritem.o)
  "_OBJC_METACLASS_$_GMSSyncTileLayer", referenced from:
      _OBJC_METACLASS_$_GMUHeatmapTileLayer in GoogleMapsUtils(GMUHeatmapTileLayer.o)
  "_OBJC_CLASS_$_GMSPolyline", referenced from:
      objc-class-ref in GoogleMapsUtils(GMUGeometryRenderer.o)
  "_OBJC_CLASS_$_GMSSyncTileLayer", referenced from:
      _OBJC_CLASS_$_GMUHeatmapTileLayer in GoogleMapsUtils(GMUHeatmapTileLayer.o)
  "_kGMSTileLayerNoTile", referenced from:
      -[GMUHeatmapTileLayer tileForX:y:zoom:] in GoogleMapsUtils(GMUHeatmapTileLayer.o)
  "_GMSProject", referenced from:
      -[GMUGridBasedClusterAlgorithm clustersAtZoom:] in GoogleMapsUtils(GMUGridBasedClusterAlgorithm.o)
      -[GMUWeightedLatLng initWithCoordinate:intensity:] in GoogleMapsUtils(GMUWeightedLatLng.o)
      -[GMUClusterItemQuadItem initWithClusterItem:] in GoogleMapsUtils(GMUNonHierarchicalDistanceBasedAlgorithm.o)
      -[GMUNonHierarchicalDistanceBasedAlgorithm clustersAtZoom:] in GoogleMapsUtils(GMUNonHierarchicalDistanceBasedAlgorithm.o)
  "_GMSUnproject", referenced from:
      -[GMUGridBasedClusterAlgorithm clustersAtZoom:] in GoogleMapsUtils(GMUGridBasedClusterAlgorithm.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

@michael-mckenna michael-mckenna added triage me I really want to be triaged. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Aug 11, 2020
@michael-mckenna
Copy link
Author

@arriolac I had a bunch of misc build errors I had to resolve. After resolving I tried building the project but got an issue with this library. I was able to replicate on a brand new project.

@arriolac
Copy link
Contributor

hmm strange. x86_64 is a supported architecture. I will take a look

@arriolac arriolac added priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. and removed triage me I really want to be triaged. labels Aug 11, 2020
@arriolac
Copy link
Contributor

I was able to add this library via SPM on the SwiftDemoApp under samples/SwiftDemoApp. You can check my branch chris/fix/326.

Are there other steps you can share so I can try to repro? I also double checked the architectures included in the .xcframework and confirmed that "x86_64" was included.

@michael-mckenna
Copy link
Author

michael-mckenna commented Aug 12, 2020

I couldn't load your sample.
Screen Shot 2020-08-12 at 5 17 47 PM
even after logging in.

However, I noticed the url you're using is [email protected]:googlemaps/google-maps-ios-utils.git but I'm using https://github.com/googlemaps/google-maps-ios-utils.git. Not sure if that will make a difference.

I have pushed a sample app here. All I did was:

  1. Create a new Xcode project with Storyboard selected
    Screen Shot 2020-08-12 at 5 21 15 PM

  2. Add this dependency via SwiftPM at version 3.2.1 with url https://github.com/googlemaps/google-maps-ios-utils.git
    Screen Shot 2020-08-12 at 5 20 12 PM
    Screen Shot 2020-08-12 at 5 20 17 PM

  3. Add -ObjC under "Other Linker Flags"
    Screen Shot 2020-08-12 at 5 27 48 PM

  4. Build (CMD+B)
    Screen Shot 2020-08-12 at 5 20 58 PM

@michael-mckenna
Copy link
Author

Using the linked repo on another device I was able to replicate the same issue. So unlike the Carthage issue I had a while back, I don't think the issue is device based this time =P

@arriolac
Copy link
Contributor

Have you included the Maps SDK (either via CocoaPods or Carthage) to your project? Note that the Maps SDK does not support SPM yet.

@michael-mckenna
Copy link
Author

Awkward, no I did not lol. Makes sense. In all fairness I thought it would've been automatically pulled in, which seemed to be the case with Carthage where google maps was a transitive dependency so I didn't add a separate line for that

@arriolac
Copy link
Contributor

Maps SDK can definitely be packaged transitively. I choose not to go that route, but now thinking about it, that's probably a lower friction integration.

@arriolac
Copy link
Contributor

@michael-mckenna I'm going to close this issue. Let's continue the discussion of packaging Maps SDK for iOS transitively in #329. Thanks for bringing this up, hopefully implementing #329 will ease some integration pains!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

2 participants