I am trying to reference Esri's Runtime SDK in my Flutter tests, but I am encountering the following error when running my test suite:
Invalid argument(s): Failed to load dynamic library 'example/macos/Pods/Runtimecore/Runtimecore.xcframework/macos-arm64_x86_64/Runtimecore.framework/Runtimecore'
test:
void main() { test('ArcGISMap instance should be created', () { final arcGISMap = ArcGISMap(); expect(arcGISMap, isNotNull); }); }
What is the recommended way to mock or test Esri-related functionality in Flutter?
Solved! Go to Solution.
Unit tests necessarily run on the "host" platform (macOS or Windows). The Maps SDK for Flutter does not support macOS or Windows, so unit tests can't be used to test the Maps SDK.
The recommended way is to use integration tests. Integration tests run on the emulator/simulator or device (iOS and Android), which makes them a little harder to deal with, but that is the only way to run our functionality (well, also "widget tests"). Note that you don't necessarily have to use the "testWidgets" method in your integration tests -- you can also use the "test" method as you would in a unit test.
Unit tests necessarily run on the "host" platform (macOS or Windows). The Maps SDK for Flutter does not support macOS or Windows, so unit tests can't be used to test the Maps SDK.
The recommended way is to use integration tests. Integration tests run on the emulator/simulator or device (iOS and Android), which makes them a little harder to deal with, but that is the only way to run our functionality (well, also "widget tests"). Note that you don't necessarily have to use the "testWidgets" method in your integration tests -- you can also use the "test" method as you would in a unit test.