英文:
Flutter app crashes on entering one particular screen only
问题
我正在开发一款电子商务应用,在进入产品详情页面时,应用程序在加载时卡住,一段时间后崩溃,没有显示任何特定的与应用程序相关的错误,我无法识别并处理,后端也没有错误,API响应完全正常。
这在Android模拟器和iOS模拟器上都发生了,在真实设备上也是一样的。
控制台日志显示 -
I/scudo ( 7103): Scudo OOM: 进程已耗尽11664大小类的256M内存。
有人可以帮忙吗?
英文:
I'm developing an e-commerce application, and on entering the product details screen, the app gets stuck at loading , and then crashes after a while, it doesn't show any specific app related, error which I can recognize and work on, neither is there any error on tha backend, the API responses load perfectly.
And this happens on both Android emulators and iOS simulator, same on real devices as well.
The console logs shows -
I/scudo ( 7103): Scudo OOM: The process has exhausted 256M for size class 11664.
Can anyone please help with this?
答案1
得分: 0
尝试运行:
dart pub cache clean
和:
flutter clean
然后运行:
dart pub upgrade
尝试为目标平台重新构建你的项目。
希望它能够正常工作 🤞
英文:
Try running:
dart pub cache clean
and:
flutter clean
Then run:
dart pub upgrade
and try rebuilding your project for the target platform.
I hope it works 🤞
答案2
得分: 0
我认为问题出在你的productDetailsProvider上。由于你没有提供关于它的详细信息,我认为你的代码在成功获取后没有将状态设置为“ProductDetailsSuccessState”,然后它一直保持在加载状态。
英文:
I believe that the problem is in your productDetailsProvider. Since you did not provide the detail about it, I think your code did not set the state to ProductDetailsSuccessState
after fetching successfully and you then it kept loading
答案3
得分: 0
所以问题已解决,是我一直在使用的ListView.builder用于显示产品评论(这部分我最不希望成为问题的部分),深藏在我的小部件树中,实际上是导致问题的原因!
英文:
So solved it, it was a ListView.builder I had been using to show the product reviews(the section which I was least expecting to be the culprit), nested deep inside my widget tree that was actually causing the issue!
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论