我已经编了好几个月的学校公理程序,现在我已经完成了。我以前经常把我的应用程序直接编译到我的手机上(Android 12),但我至少需要它是API 28。我试图将Build目标版本从31更改为28,但依赖项版本出现了错误。有任何安全和快速的方式知道我到底需要哪个版本的每个依赖?我现在正在使用它们。
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
//Hilt
id 'kotlin-kapt'
id 'dagger.hilt.android.plugin'
}
android {
compileSdk 32
defaultConfig {
applicationId "com.kdapp.estudiapp"
minSdk 24
targetSdk 31
versionCode 1
versionName "1.1"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
useSupportLibrary true
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
buildFeatures {
compose true
}
composeOptions {
kotlinCompilerExtensionVersion compose_version
}
packagingOptions {
resources {
excludes += '/META-INF/{AL2.0,LGPL2.1}'
}
}
}
apply plugin: 'com.google.gms.google-services'
dependencies {
implementation 'androidx.core:core-ktx:1.7.0'
implementation "androidx.compose.ui:ui:$compose_version"
implementation "androidx.compose.material:material:$compose_version"
implementation "androidx.compose.ui:ui-tooling-preview:$compose_version"
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.3.1'
implementation 'androidx.activity:activity-compose:1.3.1'
implementation 'com.google.firebase:firebase-auth-ktx:21.0.6'
implementation 'com.google.firebase:firebase-firestore-ktx:24.2.1'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_version"
debugImplementation "androidx.compose.ui:ui-tooling:$compose_version"
debugImplementation "androidx.compose.ui:ui-test-manifest:$compose_version"
//Firebase
implementation platform('com.google.firebase:firebase-bom:30.2.0')
implementation 'com.google.firebase:firebase-analytics-ktx'
implementation 'com.google.firebase:firebase-auth:21.0.6'
implementation 'com.google.android.gms:play-services-auth:20.2.0'
//Firebase -> Storage
implementation 'com.google.firebase:firebase-storage'
//Navigation
implementation 'androidx.navigation:navigation-compose:2.5.0'
// Coroutines
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.3.5"
// Hilt DI
def hilt_lifecycle_viewmodel = "1.0.0-alpha03"
def hilt_navigation = "1.0.0-alpha03"
implementation "com.google.dagger:hilt-android:$hilt_version"
kapt "com.google.dagger:hilt-android-compiler:$hilt_version"
implementation "androidx.hilt:hilt-lifecycle-viewmodel:$hilt_lifecycle_viewmodel"
implementation "androidx.hilt:hilt-navigation-compose:$hilt_navigation"
//GSON
implementation 'com.google.code.gson:gsoenter code heren:2.9.0'
}发布于 2022-09-06 05:23:18
任何外部依赖都需要在官方的GitHub回购或他们的网站上指定版本检查,如果不是开源的话。现在,作为降低minSdk级别的一种快速方法,只需在Android中按下minSdk,它就会打开项目结构对话框。找到一个显示minSdk的字段,并将其设置为您需要的任何内容。我建议将targetSdk和compileSdk设置为可用的最大值,它们不会影响应用程序在低api设备上的部署。对话框中还有一个建议窗格,它可以帮助您更新认为过期的依赖关系版本studio。设置完所有内容后,单击Apply/Ok。
https://stackoverflow.com/questions/73616931
复制相似问题