flutter集成高德地图打包后闪退

app/build.gradle

release {
            signingConfig signingConfigs.release
            //  // 设置混淆
            minifyEnabled true
            consumerProguardFiles "proguard-rules.pro"
        }

添加代码 minifyEnabled true consumerProguardFiles "proguard-rules.pro"
在build.gradle同级目录下创建文件proguard-rules.pro

#搜索
#-keep   class com.amap.api.services.**{*;}
#
#2D地图
#-keep class com.amap.api.maps2d.**{*;}
#-keep class com.amap.api.mapcore2d.**{*;}
#
#导航
#-keep class com.amap.api.navi.**{*;}
#-keep class com.autonavi.**{*;}
#3D 地图 V5.0.0之后:
-keep   class com.amap.api.maps.**{*;}
-keep   class com.autonavi.**{*;}
-keep   class com.amap.api.trace.**{*;}

#高德定位
-keep class com.amap.api.location.**{*;}
-keep class com.amap.api.fence.**{*;}
-keep class com.autonavi.aps.amapapi.model.**{*;}

-keep class com.loc.**{*;}

你可能感兴趣的:(flutter,Android,android,gradle,android,studio)