From 49ba30179fd6920d7c6f1b98b3298105c0b495ae Mon Sep 17 00:00:00 2001 From: tongtongstudio Date: Tue, 2 Jun 2026 20:51:11 +0800 Subject: [PATCH] =?UTF-8?q?build:=20=E6=9B=B4=E6=96=B0=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E8=87=B3studio=20panda?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle | 36 +++++++++++++++++++++--------------- build.gradle | 4 +++- 2 files changed, 24 insertions(+), 16 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 82246a7..187a7bb 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,38 +1,26 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 29 + namespace "com.ttstd.remoteservice" + compileSdkVersion 33 // buildToolsVersion "36.0.0" defaultConfig { applicationId "com.ttstd.remoteservice" minSdkVersion 24 - targetSdkVersion 29 + targetSdkVersion 33 versionCode 1 versionName "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - ndk { //根据需要 自行选择添加的对应cpu类型的.so库。 abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64' // 还可以添加 'armeabi', 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64', 'mips', 'mips64' } - dataBinding { - enabled true - } - - viewBinding { - enabled true - } - javaCompileOptions { annotationProcessorOptions { arguments = [AROUTER_MODULE_NAME: project.getName()] @@ -41,6 +29,16 @@ android { } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + buildFeatures { + dataBinding true + buildConfig true + } + buildTypes { release { minifyEnabled false @@ -53,6 +51,14 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) + // 添加 Kotlin 标准库 + implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" + // 添加这行,使用 BOM 统一 Kotlin 相关库的版本 + implementation(platform("org.jetbrains.kotlin:kotlin-bom:$kotlin_version")) + implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.11.0' + implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.11.0' + implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-rx3:1.11.0' + implementation 'androidx.appcompat:appcompat:1.3.1' implementation 'androidx.constraintlayout:constraintlayout:2.0.4' // For control over item selection of both touch and mouse driven selection diff --git a/build.gradle b/build.gradle index d878a0d..db29f68 100644 --- a/build.gradle +++ b/build.gradle @@ -1,7 +1,8 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { - + ext.kotlin_version = '2.3.21' + repositories { google() // mavenCentral() @@ -15,6 +16,7 @@ buildscript { dependencies { classpath 'com.android.tools.build:gradle:8.13.2' + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files