petsHero-AI/android/app/build.gradle

105 lines
3.2 KiB
Groovy
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

plugins {
id "com.android.application"
id "kotlin-android"
id "dev.flutter.flutter-gradle-plugin"
}
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
configurations.all {
resolutionStrategy {
force 'com.android.billingclient:billing:7.1.1'
}
}
android {
namespace "com.petsheroai.app"
compileSdk 36
buildFeatures { buildConfig = true }
ndkVersion flutter.ndkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = '17'
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
defaultConfig {
applicationId "com.petsheroai.app"
minSdkVersion flutter.minSdkVersion
targetSdk 36
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
// Flutter 引擎仅提供 arm + x86_64 的 libflutter.so不再提供 32 位 x86勿加 x86否则 32 位模拟器会缺 .so
// Intel/AMD 模拟器请用 **x86_64** 系统镜像(非 x86
ndk {
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86_64'
}
// Facebook SDK 调试:正式包调试时设为 true上线前改回 false
buildConfigField "boolean", "FACEBOOK_DEBUG_LOGS", (localProperties.getProperty("facebook.debug") ?: "true")
}
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile file(keystoreProperties['storeFile'])
storePassword keystoreProperties['storePassword']
}
}
buildTypes {
debug {
// 允许 HTTP 连接本地代理(手机无法直连域名时)
manifestPlaceholders = [usesCleartextTraffic: "true"]
}
release {
signingConfig signingConfigs.release
manifestPlaceholders = [usesCleartextTraffic: "false"]
}
}
}
dependencies {
implementation 'com.facebook.android:facebook-core:18.0.0'
implementation 'com.google.android.gms:play-services-ads-identifier:18.1.0'
implementation 'com.android.installreferrer:installreferrer:2.2'
implementation 'com.adjust.sdk:adjust-android-meta-referrer:5.5.1'
implementation 'androidx.appcompat:appcompat:1.7.0'
// Play Billing Library 6.0.1+ (use 7.1.1 for in_app_purchase plugin compatibility)
implementation 'com.android.billingclient:billing:7.1.1'
}
flutter {
source '../..'
}