有时,在我的地图活动中,有50%的时间会出现以下错误:
Fatal Exception: java.lang.NullPointerException: Attempt to get length of null array
at java.nio.ByteBufferAsIntBuffer.put(ByteBufferAsIntBuffer.java:122)
at com.google.maps.api.android.lib6.gmm6.vector.gl.buffer.o.e(:com.google.android.gms.dynamite_mapsdynamite@19420048@19.4.20 (040400-271418971):20)
at com.google.maps.api.android.lib6.gmm6.vector.gl.buffer.o.d(:com.google.android.gms.dynamite_mapsdynamite@19420048@19.4.20 (040400-271418971):36)
at com.google.maps.api.android.lib6.gmm6.vector.gl.drawable.a.a(:com.google.android.gms.dynamite_mapsdynamite@19420048@19.4.20 (040400-271418971):66)
at com.google.maps.api.android.lib6.gmm6.vector.gl.drawable.ao.a(:com.google.android.gms.dynamite_mapsdynamite@19420048@19.4.20 (040400-271418971):227)
at com.google.maps.api.android.lib6.gmm6.vector.cl.a(:com.google.android.gms.dynamite_mapsdynamite@19420048@19.4.20 (040400-271418971):274)
at com.google.maps.api.android.lib6.gmm6.vector.bz.a(:com.google.android.gms.dynamite_mapsdynamite@19420048@19.4.20 (040400-271418971):359)
at com.google.maps.api.android.lib6.gmm6.vector.bg.run(:com.google.android.gms.dynamite_mapsdynamite@19420048@19.4.20 (040400-271418971):85)
我不知道可能是什么问题,有时它的工作,有时它会给我这个错误,特别是在我的LG g6。我找了好几天却什么也没找到。有人能给我指一下有什么问题吗?
发布于 2022-06-27 07:39:59
当我带着地图离开屏幕,太快地回到屏幕上时,我在我的颤音应用程序上显示了同样的错误。我想在这里讨论这个问题:
https://issuehint.com/issue/flutter/flutter/105584
他们提到了颤振3的一个问题,并建议回到颤振2.10。
**编辑:有一个开放的问题在吉顿:https://github.com/flutter/flutter/issues/105965
其中一位用户说:
“到目前为止,我唯一能想到的就是--在屏幕上使用GoogleMap小部件--延迟Navigator.pop +,同时拒绝用户做任何事情。”
Future<void> _delayedPop(BuildContext context) async {
unawaited(
Navigator.of(context, rootNavigator: true).push(
PageRouteBuilder(
pageBuilder: (_, __, ___) => WillPopScope(
onWillPop: () async => false,
child: Scaffold(
backgroundColor: Colors.transparent,
body: const Center(
child: CircularProgressIndicator.adaptive(),
),
),
),
transitionDuration: Duration.zero,
barrierDismissible: false,
barrierColor: Colors.black45,
opaque: false,
),
),
);
await Future.delayed(const Duration(seconds: 1));
Navigator.of(context)
..pop()
..pop();
}
我不确定这是你的情况下的问题,因为你在两年前发布了这个帖子,但也许它会帮助其他人!
https://stackoverflow.com/questions/58367663
复制