def localProperties = new Properties() def localPropertiesFile = rootProject.file('local.properties') if (localPropertiesFile.exists()) { localPropertiesFile.withReader('UTF-8') { reader -> localProperties.load(reader) } } def flutterRoot = localProperties.getProperty('flutter.sdk') if (flutterRoot == null) { throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") } def flutterVersionCode = localProperties.getProperty('flutter.versionCode') if (flutterVersionCode == null) { flutterVersionCode = '1' } def flutterVersionName = localProperties.getProperty('flutter.versionName') if (flutterVersionName == null) { flutterVersionName = '1.0' } apply plugin: 'com.android.application' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { compileSdkVersion 29 lintOptions { disable 'InvalidPackage' } defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "com.amap.flutter.amap_map_example" minSdkVersion flutter.minSdkVersion targetSdkVersion 29 versionCode flutterVersionCode.toInteger() versionName flutterVersionName } signingConfigs { debug { //keystore中key的别名 keyAlias 'androiddebugkey' //keystore中key的密码 keyPassword 'android' //keystore的文件路径,可以是绝对路径也可以是相对路径 storeFile file('../debug.keystore') //keystore的密码l storePassword 'android' } } buildTypes { release { // TODO: Add your own signing config for the release build. // Signing with the debug keys for now, so `flutter run --release` works. signingConfig signingConfigs.debug //关闭混淆, 否则在运行release包后可能出现运行崩溃, TODO后续进行混淆配置 minifyEnabled false //删除无用代码 shrinkResources false //删除无用资源 } } sourceSets { main { jniLibs.srcDirs = ['libs'] } } } dependencies { //demo中引入高德地图SDK implementation 'com.amap.api:3dmap:9.8.3' } flutter { source '../..' }