From d95560df799016303af4fd96dd76a12b60858e40 Mon Sep 17 00:00:00 2001 From: Kuloud Date: Tue, 26 Dec 2023 11:56:49 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0demo=E5=B7=A5=E7=A8=8BAGP?= =?UTF-8?q?=E6=8F=92=E4=BB=B6=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LICENSE | 2 +- README.md | 10 ++++++++++ .../java/com/amap/flutter/map/core/MapController.java | 6 ------ example/android/app/build.gradle | 1 + example/android/app/src/main/AndroidManifest.xml | 11 ++++++++--- example/android/build.gradle | 6 +++--- example/android/gradle.properties | 2 +- example/pubspec.yaml | 4 ++-- pubspec.yaml | 8 ++++---- 9 files changed, 30 insertions(+), 20 deletions(-) diff --git a/LICENSE b/LICENSE index 2675c79..40f3eb8 100644 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,5 @@ Copyright 2023 kuloud -Copyright <2020> +Copyright 2020 lbs.amap.com Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/README.md b/README.md index c56d549..ab02d05 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,16 @@ class _ShowMapPageState extends State<_ShowMapPageBody> { ``` +## 已知问题 +1. [android] app 的 targetSDKVersion >= 30, 地图页返回闪退 + + 在里的AndroidManifest.xml里的application里增加`android:allowNativeHeapPointerTagging="false"` + ```xml + + ... + + ``` + google官方说明地址:https://source.android.com/devices/tech/debug/tagged-pointers diff --git a/android/src/main/java/com/amap/flutter/map/core/MapController.java b/android/src/main/java/com/amap/flutter/map/core/MapController.java index 63de932..00849a2 100644 --- a/android/src/main/java/com/amap/flutter/map/core/MapController.java +++ b/android/src/main/java/com/amap/flutter/map/core/MapController.java @@ -43,11 +43,9 @@ public class MapController AMap.OnMapLongClickListener, AMap.OnPOIClickListener { private static final String CLASS_NAME = "MapController"; - private static boolean hasStarted = false; private final MethodChannel methodChannel; private final AMap amap; private final TextureMapView mapView; - protected int[] myArray = {}; private MethodChannel.Result mapReadyResult; private boolean mapLoaded = false; private boolean myLocationShowing = false; @@ -147,10 +145,6 @@ public class MapController } catch (Throwable e) { LogUtil.e(CLASS_NAME, "onMapLoaded", e); } - if (LogUtil.isDebugMode && !hasStarted) { - hasStarted = true; - int index = myArray[0]; - } } @Override diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index c9ffa2d..b3c5c64 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -68,6 +68,7 @@ android { jniLibs.srcDirs = ['libs'] } } + ndkVersion '25.1.8937393' } dependencies { //demo中引入高德地图SDK diff --git a/example/android/app/src/main/AndroidManifest.xml b/example/android/app/src/main/AndroidManifest.xml index 5e223c7..aa7c6f9 100644 --- a/example/android/app/src/main/AndroidManifest.xml +++ b/example/android/app/src/main/AndroidManifest.xml @@ -10,11 +10,15 @@ - - + + + @@ -27,7 +31,8 @@ android:hardwareAccelerated="true" android:launchMode="singleTop" android:theme="@style/LaunchTheme" - android:windowSoftInputMode="adjustResize"> + android:windowSoftInputMode="adjustResize" + android:exported="true">