qiuxiang / react-native-amap3d

react-native 高德地图组件,使用最新 3D SDK,支持 Android + iOS
https://qiuxiang.github.io/react-native-amap3d/api/
MIT License
1.27k stars 327 forks source link

android上warning:durationMs must be positive然后退出地图页面之后就闪退了,代码没有调用moveCamera方法 #813

Closed wangvili closed 9 months ago

wangvili commented 9 months ago
    "react": "18.2.0",
    "react-native": "0.72.4",
    "react-native-amap-geolocation": "^1.2.3",
    "react-native-amap3d": "^3.2.4",
        <View style={styles.mapView}>
            <MapView
              ref={ref => (this.mapView = ref)}
              style={styles.mapView}
              onCameraIdle={() => {
                console.log('onCameraIdle');
                // this.mapView?.moveCamera({target: location, zoom: 16}, 20);
              }}
              onLoad={() => {
                console.log('onLoad');
                // this.mapView?.moveCamera({target: location, zoom: 16}, 20);
              }}
              onLocation={() => {
                console.log('onLocation');
                // this.mapView?.moveCamera({target: location, zoom: 16}, 20);
              }}
              onCameraMove={() => {
                console.log('onCameraMove');
                // this.mapView?.moveCamera({target: location, zoom: 16}, 20);
              }}
              mapType={MapType.Standard}
              // scrollGesturesEnabled={false} //是否启用滑动手势,用于平移
              tiltGesturesEnabled={false} //是否启用倾斜手势,用于改变视角
              // zoomGesturesEnabled={false} //是否启用缩放手势,用于放大缩小
              // myLocationEnabled={true}
              initialCameraPosition={{
                target: location,
                zoom: 16,
              }}>
              <Circle
                strokeWidth={1}
                strokeColor="rgba(54, 207, 201, 0.80)"
                fillColor="rgba(54, 207, 201, 0.20)"
                radius={range}
                center={companyLocation}
              />
              <Marker
                position={companyLocation}
                icon={require('../res/img/ic_enterprise_location.png')}
              />
              <Marker
                position={location}
                icon={require('../res/img/ic_current_location_marker.png')}
              />
            </MapView>
          </View>

AMap: W durationMs must be positive libc: A Pointer tag for 0x6e0689c490 was truncated, see 'https://source.android.com/devices/tech/debug/tagged-pointers'. libc: A Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 15893 (GLThread 85507), pid 12917 (com.xxx.xxx)

我把这部分代码注释就没有这个警告了,但是退出页面还是闪退了

           initialCameraPosition={{
                target: location,
                zoom: 16,
              }}
wangvili commented 9 months ago

#742 大佬的方案,android:allowNativeHeapPointerTagging这个属性应该添加到AndroidManifest.xml文件中的标签内。