在我的用例中,我需要确保我的地图可以在不崩溃的情况下动态调整大小,您可以建议使用resizeToAvoidBottomPadding,但我的问题是,如果我使用facebook杂谈头并打开它的键盘,我的应用程序就会崩溃(这使得应用程序调整大小,迫使地图调整大小,从而导致崩溃)
下面的代码位于子路由内部(在包含底部选项卡栏的路由中,因此下面的代码位于该条的一个按钮中)
@override
Widget build(BuildContext context) {
return Stack(
children: <Widget>[
GoogleMap(
onMapCreated: _onMapCreated,
mapType: MapType.normal,
initialCameraPosition: CameraPosition(
target: LatLng(30, 40),
zoom: 11,
),
onCameraMove: (pos) {
setState(() {
// do something
});
},
onCameraIdle: () {
setState(() {
// do something
});
},
),
TextField(),
],
);
}编辑:这是我在控制台中得到的错误消息:
E/flutter (16068): [ERROR:flutter/shell/platform/android/platform_view_android_jni.cc(39)] java.lang.AbstractMethodError: abstract method "void io.flutter.plugin.platform.PlatformView.onInputConnectionLocked()"
E/flutter (16068): at io.flutter.plugin.platform.VirtualDisplayController.onInputConnectionLocked(VirtualDisplayController.java:166)
E/flutter (16068): at io.flutter.plugin.platform.PlatformViewsController.lockInputConnection(PlatformViewsController.java:370)
E/flutter (16068): at io.flutter.plugin.platform.PlatformViewsController.access$1000(PlatformViewsController.java:36)
E/flutter (16068): at io.flutter.plugin.platform.PlatformViewsController$1.resizePlatformView(PlatformViewsController.java:165)
E/flutter (16068): at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.resize(PlatformViewsChannel.java:120)
E/flutter (16068): at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.onMethodCall(PlatformViewsChannel.java:57)
E/flutter (16068): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:222)
E/flutter (16068): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:96)
E/flutter (16068): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:656)
E/flutter (16068): at android.os.MessageQueue.nativePollOnce(Native Method)
E/flutter (16068): at android.os.MessageQueue.next(MessageQueue.java:323)
E/flutter (16068): at android.os.Looper.loop(Looper.java:136)
E/flutter (16068): at android.app.ActivityThread.main(ActivityThread.java:6776)
E/flutter (16068): at java.lang.reflect.Method.invoke(Native Method)
E/flutter (16068): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1496)
E/flutter (16068): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1386)
E/flutter (16068): at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:107)
E/flutter (16068):
F/flutter (16068): [FATAL:flutter/shell/platform/android/platform_view_android_jni.cc(76)] Check failed: CheckException(env).
F/libc (16068): Fatal signal 6 (SIGABRT), code -6 in tid 16068 (m.dm.dm_testing)
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'samsung/a7xeltexx/a7xelte:7.0/NRD90M/A710FXXU2CQG4:user/release-keys'
Revision: '3'
ABI: 'arm'
pid: 16068, tid: 16068, name: m.dm.dm_testing >>> com.dm.dm_testing <<<
signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
Abort message: '[FATAL:flutter/shell/platform/android/platform_view_android_jni.cc(76)] Check failed: CheckException(env).
'
r0 00000000 r1 00003ec4 r2 00000006 r3 00000008
r4 ec60358c r5 00000006 r6 ec603534 r7 0000010c
r8 ffcc802c r9 db59415c sl 00000032 fp db594110
ip 0000000b sp ffcc7f08 lr ea8f04c7 pc ea8f2d30 cpsr 000e0010
backtrace:
#00 pc 0004ad30 /system/lib/libc.so (tgkill+12)
#01 pc 000484c3 /system/lib/libc.so (pthread_kill+34)
#02 pc 0001dd99 /system/lib/libc.so (raise+10)
#03 pc 00019521 /system/lib/libc.so (__libc_android_abort+34)
#04 pc 00017160 /system/lib/libc.so (abort+4)
#05 pc 00fa7b9f /data/app/com.dm.dm_testing-1/lib/arm/libflutter.so (offset 0xf99000)
#06 pc 00f9dde1 /data/app/com.dm.dm_testing-1/lib/arm/libflutter.so (offset 0xf99000)
#07 pc 00f9cad7 /data/app/com.dm.dm_testing-1/lib/arm/libflutter.so (offset 0xf99000)
#08 pc 00fcfb83 /data/app/com.dm.dm_testing-1/lib/arm/libflutter.so (offset 0xf99000)
#09 pc 00fa81f5 /data/app/com.dm.dm_testing-1/lib/arm/libflutter.so (offset 0xf99000)
#10 pc 00fab943 /data/app/com.dm.dm_testing-1/lib/arm/libflutter.so (offset 0xf99000)
#11 pc 00011e77 /system/lib/libutils.so (_ZN7android6Looper9pollInnerEi+614)
#12 pc 00011b83 /system/lib/libutils.so (_ZN7android6Looper8pollOnceEiPiS1_PPv+26)
#13 pc 00097325 /system/lib/libandroid_runtime.so (_ZN7android18NativeMessageQueue8pollOnceEP7_JNIEnvP8_jobjecti+22)
#14 pc 7594bd55 /data/dalvik-cache/arm/system@framework@boot.oat (offset 0x38c0000)
Lost connection to device.谢谢你的帮助。
发布于 2019-09-26 16:47:15
这是一个bug 与3.5.0级的变化有关。它目前固定在颤振主通道中。
如果您现在想解决这个问题,请将android.enableDexingArtifactTransform=false添加到您的gradle.properties文件中,以禁用新的Gradle更改。
发布于 2019-09-25 22:15:20
你完了..。
https://stackoverflow.com/questions/58106961
复制相似问题