Open Finni123 opened 1 week ago
Unfortunately I realized that the app still crashes when I view the map, then I navigate to another page and then I navigate back to the map again. It seems like the big overlay image is loaded into memory once more instead of being reused, which causes the memory limit to be exceeded. How can I fix this?
Unfortunately I realized that the app still crashes when I view the map, then I navigate to another page and then I navigate back to the map again. It seems like the big overlay image is loaded into memory once more instead of being reused, which causes the memory limit to be exceeded. How can I fix this?
On what platforms does this occur, and does it occur with and without Impeller?
Also, please report this issue to Flutter with an example using flutter_map (they're used to it by now :D) if you have time. If not, please provide the image here if you can and I'll file the report.
You can find the image I used here. I built for iOS on a real iPhone 7, with and without Impeller. Disabling Impeller made it somewhat better and the app crashes later, but it still crashes. Unfortunately I don't have a lot of time currently, so if you can replicate the crash, I would be grateful if you could file the report.
What is the bug?
I added a large (about 7000x8000 pixel with 5.6 MB) image from my local assets to a map as a
RotatedOverlayImage
. On Android, everything works fine, but on iOS, zooming in on the image causes the app to crash with this error:How can we reproduce it?
Do you have a potential solution?
This comment gave me the idea to try to disable Impeller as described here: Use
flutter run --enable-impeller
or add<key>FLTEnableImpeller</key><false/>
toInfo.plist
.This indeed fixes it, the map does not crash anymore, and it runs with better performance too.
I thought it would be good to post this here, so that other people who run into this issue can find the solution.
Platforms
Android 14, Windows 10, Flutter 3.22.1
Severity
Fatal: Causes the application to crash