App error with Testfligt

We developed an App that uses Mapkit, using MkPolygon in order to represent Shapefiles on the map.

The fact is that the app works properly from Xcode using the emulator, but as soon as we publish it and install it using TestFlight, the polygons are drawn incorrectly, there are vertices that are not displayed in the correct place.

The two Apps are identical, and the data that is loaded is also. Any idea what might be failing?


Can you share a small code example? Also, did you test a release build on a device before sending it to TestFlight? If not, you should also look at the App Testing Guide for how to thoroughly test in order to find these bugs before going to TestFlight.
In fact the application works properly and does not give any error, simply the result shown on the map is completely different from the iPad emulator or running the app directly to the iPad from xcode, which when we download the app from TestFlight or from the App Store.

I don't know what else to look at, I generated a log file of the polygon coordinates when generating it and these are correct, but when displaying it from the App downloaded from TestFlight or the App Store it is displayed with vertices incorrectly positioned. With exactly the same data, from the emulator or running the App from the iPad the polygons are displayed correctly.

(I failed to upload a screenshot of both versions, if possible it would be much easier to understand what is going on).

This is the code when I create de Polygon (ShpPolygon is a subclass of MKPolygon, coords are the coordinates I have readed from Sapefile)

Code Block
let coordinates: UnsafeBufferPointer<CLLocationCoordinate2D> = {
return coords.withUnsafeBufferPointer { pointer -> UnsafeBufferPointer<CLLocationCoordinate2D> in
return pointer
}
}()
let polygon = ShpPolygon(coordinates: coordinates.baseAddress!, count: coords.count)
...
mapView.addOverlays(polygon)



It sounds like you're not testing the release build on the device — please see the section of the App Testing Guide that covers this. Regular debug builds you create by hitting the Run button in Xcode are different than Release builds. Since you're seeing the difference only through TestFlight, that's generally an indicator you're not testing the same build, and why I highlighted the App Testing Guide. As an example of why this can differ, we had a demo a few years ago at WWDC that showed a running route incorrectly going through the water of San Francisco Bay, but only sometimes, even though the point data was correct.

Beyond following through on those suggestions, plus the ones in the linked video, you should break the problem down into a small Xcode project that still reproduces the problem. Frequently, you can figure out the issue by narrowing the code paths in use and focusing in on the relevant code like this.
App error with Testfligt
 
 
Q