plugins { id 'com.android.application' } android { namespace 'com.example.removemarineanimals' compileSdk 34 defaultConfig { applicationId "com.example.removemarineanimals" minSdk 24 targetSdk 34 versionCode 1 versionName "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } // ✅ 这里统一配置 binding 功能 buildFeatures { viewBinding true dataBinding true buildConfig true } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } } dependencies { // AndroidX 基础 implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'com.google.android.material:material:1.9.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' // 测试 testImplementation 'junit:junit:4.13.2' androidTestImplementation 'androidx.test.ext:junit:1.1.5' androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' // 第三方依赖 implementation 'com.github.mik3y:usb-serial-for-android:3.7.0' implementation 'com.google.protobuf:protobuf-java:4.27.2' implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.20") implementation 'com.github.nodemedia:nodemediaclient-android:2.9.20' implementation 'io.github.xmaihh:serialport:2.1.1' // implementation 'com.arthenica:ffmpeg-kit-full:6.0-2' // ✅ Room 数据库 def room_version = "2.6.1" implementation "androidx.room:room-runtime:$room_version" annotationProcessor "androidx.room:room-compiler:$room_version" // 如果以后用 Kotlin + kapt, 改成 kapt // kapt "androidx.room:room-compiler:$room_version" implementation "androidx.room:room-ktx:$room_version" // 可选,支持协程/LiveData }