amap_map/example/android/app/build.gradle

80 lines
2.4 KiB
Groovy
Raw Normal View History

2023-12-22 21:23:24 +08:00
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 {
2023-12-23 11:31:14 +08:00
compileSdkVersion 33
2023-12-22 21:23:24 +08:00
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
2023-12-23 11:31:14 +08:00
targetSdkVersion 33
2023-12-22 21:23:24 +08:00
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
2023-12-22 22:29:24 +08:00
implementation 'com.amap.api:3dmap:9.8.3'
2023-12-22 21:23:24 +08:00
}
flutter {
source '../..'
}