CartoDB / mobile-sdk

CARTO Mobile SDK core project
https://carto.com/docs/carto-engine/mobile-sdk/
BSD 3-Clause "New" or "Revised" License
184 stars 65 forks source link

Undefined symbol error when accessing proxy classes in Swift #538

Open asdafa3 opened 1 year ago

asdafa3 commented 1 year ago

Description

We added support for the Mapsforge binary file format to the Carto SDK and implemented it successfully. Initially, we integrated the implementation in the core project for testing purposes. Now, we are in the process of moving the codebase to a fork of the libs-carto repository. We would ultimately like to contribute the changes to the CartoMobileSDK repository.

We are building the SDK as xcframework and framework using Xcode 14.3, and it builds without any issues. The build script and CMakeLists.txt are identical to the latest master, with the exception of the necessary changes to include the library, which is also built correctly.

However, when using the Objective-C proxy classes in Swift, we encounter errors like the following:

Undefined symbol: carto::Way::getTags() const

These errors occur only when we actually access the proxy classes. Importing the CartoMobileSDK alone builds the test app successfully.

We assume that the swig interface we created broke, although there shouldn't be any changes cause compared to the previous working version only the path of the header files has changed because of the outsourcing to the library.

Do you have any guess where the root of the issue could be or any tips to debug it?

Additional Information

Please let me know if you need any further information to address this issue.

mtehver commented 1 year ago

Hi. Sounds interesting. I remember I briefly looked into Mapsforge vector tiles a while ago and it seemed pretty different from Mapbox approach. I guess the implementation is far from trivial.

Regarding the issue, I suggest to check that:

1) wrappers definitions are added under 'all/modules' 2) references to generated classes are included in 'ios/objc/CartoMobileSDK.h'

If you have successfully built your library for Android and the issue is related to iOS only, then I think the second one is highly likely.