我的项目有一个问题,它包含大约 200 个资产图像,大约 130 兆字节,没有使用互联网,它在几分钟后缓慢地显示图像,它崩溃了,我尝试清理并创建新项目,但我得到了相同的结果错误。 这是我的日志
Performing hot restart...
Syncing files to device Android SDK built for x86...
Restarted application in 29,624ms.
F/libc ( 4781): Fatal signal 11 (SIGSEGV), code 1, fault addr 0x0 in tid 4822 (1.io)
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'google/sdk_google_phone_x86/generic_x86:7.0/NYC/4409132:user/release-keys'
Revision: '0'
ABI: 'x86'
pid: 4781, tid: 4822, name: 1.io >>> com.company.project <<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
eax 00000000 ebx 8c29dac4 ecx a7880000 edx 9868b500
esi 05b8d800 edi 00000000
xcs 00000073 xds 0000007b xes 0000007b xfs 0000003b xss 0000007b
eip 8ba42285 ebp 8a201018 esp 8a200ff0 flags 00010286
backtrace:
#00 pc 000af285 /data/app/com.company.project-1/lib/x86/libflutter.so (offset 0x1208000)
Lost connection to device.
这是我的代码
myMethod(context) {
return GridView.count(
childAspectRatio: 1.0,
padding: EdgeInsets.all(16),
crossAxisCount: 2,
crossAxisSpacing: 18,
mainAxisSpacing: 18,
children: getTypesMethods.map<Widget>((data) {
return myTabButton(
foodType: data,
);
}).toList(),
);
}
myTabButton(FoodType foodtype){
return Container(
width: 0.4 * MediaQuery.of(context).size.width,
height: 0.4 * MediaQuery.of(context).size.width,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(8)),
border: Border.all(color: Color(0xffEBEBEB), width: 1),
color: Colors.white,
),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
ClipRRect(
borderRadius: BorderRadius.circular(8.0),
child: SizedBox(
width: 0.4 * MediaQuery.of(context).size.width,
height: 0.27 * MediaQuery.of(context).size.width,
child: Container(
decoration: new BoxDecoration(
image: new DecorationImage(
colorFilter: new ColorFilter.mode(
Colors.white.withOpacity(1), BlendMode.dstATop),
image: new AssetImage(foodType.image),
fit: BoxFit.fill,
),
),
),
// child: Image.asset(
// foodType.image,
// fit: BoxFit.fill,
// ),
),
),
SizedBox(
width: 0.4 * MediaQuery.of(context).size.width,
height: 0.1 * MediaQuery.of(context).size.width,
child: Center(
child: Text(
foodType.typeName,
style: TextStyle(fontFamily: fontBold, color: Colors.black),
),
)),
],
),
);
}
请帮助我解决我的问题,我已经遇到这个问题一周了,我需要完成这个项目
对我来说,我将模拟器从 android 6.0 升级到了 android 13,这是最新版本。然后错误就消失了。