mapbox-unity-sdk icon indicating copy to clipboard operation
mapbox-unity-sdk copied to clipboard

Issues about "ARPlaneAnchor" and "ARAnchor" in ARSessionNative.mm when building Mapbox Unity project in XCode

Open liu550 opened this issue 3 years ago • 0 comments

Note: If this is a bug or support ticket, please provide the following information:

  • Unity version: 2019.4.23f1
  • Mapbox SDK version: Unity SDK v2.1.1
  • The platform you're building to: iOS (iPhone only)
  • A description of what you're trying to do: I am trying to use Mapbox's Unity SDK and Niantic's Lightship SDK to build a location-based AR application. Before building this project, I tested building a project with only Lightship SDK and it worked fined on my iPhone. Then I duplicated the project and imported Mapbox's Unity SDK v2.1.1 into it. Regarding the player settings, I set the target device as "iPhone Only" and the target minimum iOS version as 11.0, the minimum requirement of using Lightship SDK. The entire Mapbox Unity SDK was imported and built, and the XCode project was successfully created by Unity with no errors. However, when building the project in XCode, I got the error
Cannot initialize a parameter of type 'id<NSCopying> _Nonnull' with an rvalue of type 'Class'

for the following two lines of code in ARSessionNative.mm

[nativeSession->_classToCallbackMap setObject:anchorCallbacks forKey:[ARPlaneAnchor class]];
[nativeSession->_classToCallbackMap setObject:userAnchorCallbacks forKey:[ARAnchor class]];

I followed the suggestions here (https://github.com/facebook/FBRetainCycleDetector/issues/115) by adding (id) or (id<NSCopying>) before ARPlaneAnchor and ARAnchor, which led to the new errors:

Unexpected interface name 'ARPlaneAnchor': expected expression

and

Unexpected interface name 'ARAnchor': expected expression

Appreciate any clues on how I may resolve the issues!

  • Steps to recreate the bug if appropriate: As described above.

liu550 avatar Jan 11 '22 19:01 liu550