2025-05-20 16:39:05 +08:00
|
|
|
|
plugins {
|
|
|
|
|
alias(libs.plugins.android.application)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
android {
|
|
|
|
|
namespace 'com.example.studyapp'
|
|
|
|
|
compileSdk 35
|
|
|
|
|
|
|
|
|
|
defaultConfig {
|
|
|
|
|
applicationId "com.example.studyapp"
|
2025-06-19 22:12:21 +08:00
|
|
|
|
minSdk 24
|
2025-05-20 16:39:05 +08:00
|
|
|
|
targetSdk 35
|
|
|
|
|
versionCode 1
|
|
|
|
|
versionName "1.0"
|
|
|
|
|
|
|
|
|
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
2025-05-29 22:05:49 +08:00
|
|
|
|
|
|
|
|
|
// 指定支持的 ABI 类型(如果需要限制支持的 ABI)
|
|
|
|
|
externalNativeBuild {
|
|
|
|
|
cmake {
|
|
|
|
|
arguments "-DANDROID_ABI=arm64-v8a"
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-06-07 09:52:33 +08:00
|
|
|
|
sourceSets {
|
|
|
|
|
main {
|
|
|
|
|
jniLibs.srcDirs = ['src/main/jniLibs']
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-05-20 16:39:05 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
buildTypes {
|
|
|
|
|
release {
|
|
|
|
|
minifyEnabled false
|
|
|
|
|
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
|
|
|
|
}
|
2025-05-29 22:05:49 +08:00
|
|
|
|
debug {
|
|
|
|
|
// 禁用符号剥离
|
|
|
|
|
ndk {
|
|
|
|
|
debugSymbolLevel 'none'
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-05-20 16:39:05 +08:00
|
|
|
|
}
|
|
|
|
|
compileOptions {
|
|
|
|
|
sourceCompatibility JavaVersion.VERSION_11
|
|
|
|
|
targetCompatibility JavaVersion.VERSION_11
|
|
|
|
|
}
|
2025-05-29 22:05:49 +08:00
|
|
|
|
|
|
|
|
|
// 添加 CMake 支持
|
|
|
|
|
externalNativeBuild {
|
|
|
|
|
cmake {
|
|
|
|
|
// 指定 CMakeLists.txt 的路径
|
|
|
|
|
path file("src/main/cpp/CMakeLists.txt")
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-05-20 16:39:05 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
|
implementation libs.appcompat
|
|
|
|
|
implementation libs.material
|
|
|
|
|
implementation libs.activity
|
|
|
|
|
implementation libs.constraintlayout
|
2025-06-09 16:45:29 +08:00
|
|
|
|
implementation libs.play.services.ads.identifier
|
2025-05-20 16:39:05 +08:00
|
|
|
|
testImplementation libs.junit
|
|
|
|
|
androidTestImplementation libs.ext.junit
|
|
|
|
|
androidTestImplementation libs.espresso.core
|
2025-05-29 22:05:49 +08:00
|
|
|
|
|
2025-06-07 09:52:33 +08:00
|
|
|
|
implementation 'androidx.work:work-runtime:2.9.0'
|
2025-05-22 18:13:34 +08:00
|
|
|
|
// Retrofit 核心库
|
|
|
|
|
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
|
|
|
|
|
|
|
|
|
|
// 如果需要用 Gson 作为 JSON 序列化/反序列化工具,还需添加以下依赖
|
|
|
|
|
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
|
|
|
|
|
|
|
|
|
|
// 如果需要 RxJava 支持(可选)
|
|
|
|
|
implementation 'com.squareup.retrofit2:adapter-rxjava3:2.9.0'
|
2025-06-18 14:31:11 +08:00
|
|
|
|
|
2025-06-25 10:56:53 +08:00
|
|
|
|
implementation 'org.nanohttpd:nanohttpd:2.3.1'
|
|
|
|
|
|
2025-06-18 14:31:11 +08:00
|
|
|
|
// 添加 Mockito 核心依赖
|
|
|
|
|
testImplementation 'org.mockito:mockito-core:5.4.0'
|
|
|
|
|
|
|
|
|
|
// 如果需要在 Android Instrumented Tests 中使用 Mockito
|
|
|
|
|
androidTestImplementation 'org.mockito:mockito-android:5.4.0'
|
|
|
|
|
|
2025-06-19 22:12:21 +08:00
|
|
|
|
testImplementation 'junit:junit:4.13.2'
|
|
|
|
|
testImplementation 'org.mockito:mockito-inline:4.8.0'
|
|
|
|
|
|
2025-06-07 09:52:33 +08:00
|
|
|
|
}
|