plugins { id 'com.android.application' // 启用 FCM 时取消下一行注释,并把 Firebase 控制台下载的 google-services.json 放到 app/ 目录 // id 'com.google.gms.google-services' } android { namespace 'com.saars.chatplatform' compileSdk 34 defaultConfig { applicationId "com.saars.chatplatform" minSdk 30 targetSdk 34 versionCode 1 versionName "1.0" // 服务器:101.43.95.130:8052;模拟器访问本机可改为 "http://10.0.2.2:8052/" buildConfigField "String", "API_BASE_URL", "\"http://101.43.95.130:8052/\"" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } compileOptions { sourceCompatibility JavaVersion.VERSION_17 targetCompatibility JavaVersion.VERSION_17 } buildFeatures { viewBinding true buildConfig true } } dependencies { implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'com.google.android.material:material:1.11.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' implementation 'androidx.lifecycle:lifecycle-viewmodel:2.7.0' implementation 'androidx.lifecycle:lifecycle-livedata:2.7.0' implementation 'androidx.recyclerview:recyclerview:1.3.2' implementation 'com.squareup.retrofit2:retrofit:2.9.0' implementation 'com.squareup.retrofit2:converter-gson:2.9.0' implementation 'com.squareup.okhttp3:okhttp:4.12.0' implementation 'com.squareup.okhttp3:logging-interceptor:4.12.0' implementation 'io.socket:socket.io-client:2.1.0' implementation 'androidx.room:room-runtime:2.6.1' annotationProcessor 'androidx.room:room-compiler:2.6.1' implementation 'androidx.coordinatorlayout:coordinatorlayout:1.2.0' implementation platform('com.google.firebase:firebase-bom:32.7.0') implementation 'com.google.firebase:firebase-messaging' }