gradle 如何在AAR元数据值中解决此错误

svgewumm  于 2023-08-06  发布在  其他
关注(0)|答案(1)|浏览(82)

我正在构建一个应用程序,但它thowrs以下错误:
检查AAR元数据值时发现的一个或多个问题:

The minCompileSdk (33) specified in a
dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
is greater than this module's compileSdkVersion (android-31).
Dependency: androidx.hilt:hilt-navigation-compose:1.1.0-alpha01.
AAR metadata file: C:\Users\av200\.gradle\caches\transforms-3\7541103aedb95b92a3671601e2e98c52\transformed\jetified-hilt-navigation-compose-1.1.0-alpha01\META-INF\com\android\build\gradle\aar-metadata.properties.

The minCompileSdk (33) specified in a
dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
is greater than this module's compileSdkVersion (android-31).
Dependency: androidx.hilt:hilt-navigation:1.1.0-alpha01.
AAR metadata file: C:\Users\av200\.gradle\caches\transforms-3\369ce8a323819b95fa7145ab958aeaf9\transformed\jetified-hilt-navigation-1.1.0-alpha01\META-INF\com\android\build\gradle\aar-metadata.properties.

The minCompileSdk (34) specified in a
dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
is greater than this module's compileSdkVersion (android-31).
Dependency: androidx.navigation:navigation-common:2.7.0-beta02.
AAR metadata file: C:\Users\av200\.gradle\caches\transforms-3\2ef40a275cae582be346fd30c4f388a8\transformed\navigation-common-2.7.0-beta02\META-INF\com\android\build\gradle\aar-metadata.properties.

The minCompileSdk (34) specified in a
dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
is greater than this module's compileSdkVersion (android-31).
Dependency: androidx.navigation:navigation-runtime:2.7.0-beta02.
AAR metadata file: C:\Users\av200\.gradle\caches\transforms-3\53ed9c958e9f5f502334e711a6c28446\transformed\navigation-runtime-2.7.0-beta02\META-INF\com\android\build\gradle\aar-metadata.properties.

The minCompileSdk (34) specified in a
dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
is greater than this module's compileSdkVersion (android-31).
Dependency: androidx.navigation:navigation-common-ktx:2.7.0-beta02.
AAR metadata file: C:\Users\av200\.gradle\caches\transforms-3\69e45a5f2cf7e0114056652fccc33417\transformed\navigation-common-ktx-2.7.0-beta02\META-INF\com\android\build\gradle\aar-metadata.properties.

The minCompileSdk (34) specified in a
dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
is greater than this module's compileSdkVersion (android-31).
Dependency: androidx.navigation:navigation-runtime-ktx:2.7.0-beta02.
AAR metadata file: C:\Users\av200\.gradle\caches\transforms-3\f50ff47c9b1fd55824843786127890e9\transformed\navigation-runtime-ktx-2.7.0-beta02\META-INF\com\android\build\gradle\aar-metadata.properties.

The minCompileSdk (34) specified in a
dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
is greater than this module's compileSdkVersion (android-31).
Dependency: androidx.navigation:navigation-compose:2.7.0-beta02.
AAR metadata file: C:\Users\av200\.gradle\caches\transforms-3\710434e1be3e4bd341784ca09abfc95c\transformed\jetified-navigation-compose-2.7.0-beta02\META-INF\com\android\build\gradle\aar-metadata.properties.

The minCompileSdk (33) specified in a
dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
is greater than this module's compileSdkVersion (android-31).
Dependency: androidx.appcompat:appcompat-resources:1.6.1.
AAR metadata file: C:\Users\av200\.gradle\caches\transforms-3\c96395af779f921a84d6732579be5be0\transformed\jetified-appcompat-resources-1.6.1\META-INF\com\android\build\gradle\aar-metadata.properties.

The minCompileSdk (33) specified in a
dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
is greater than this module's compileSdkVersion (android-31).
Dependency: androidx.appcompat:appcompat:1.6.1.
AAR metadata file: C:\Users\av200\.gradle\caches\transforms-3\1f36a8f1d68e7c0dfdda16c85acada2f\transformed\appcompat-1.6.1\META-INF\com\android\build\gradle\aar-metadata.properties.

The minCompileSdk (33) specified in a
dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
is greater than this module's compileSdkVersion (android-31).
Dependency: androidx.compose.foundation:foundation-android:1.5.0-beta03.
AAR metadata file: C:\Users\av200\.gradle\caches\transforms-3\6abef73a99da300977fa6cca450eec64\transformed\jetified-foundation-release\META-INF\com\android\build\gradle\aar-metadata.properties.

The minCompileSdk (33) specified in a
dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
is greater than this module's compileSdkVersion (android-31).
Dependency: androidx.compose.foundation:foundation-layout-android:1.5.0-beta03.
AAR metadata file: C:\Users\av200\.gradle\caches\transforms-3\904907c21714c31d53d9a0d0930b4108\transformed\jetified-foundation-layout-release\META-INF\com\android\build\gradle\aar-metadata.properties.

The minCompileSdk (33) specified in a
dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
is greater than this module's compileSdkVersion (android-31).
Dependency: androidx.compose.animation:animation-core-android:1.5.0-beta03.
AAR metadata file: C:\Users\av200\.gradle\caches\transforms-3\725d22991282a7c57db3f8711595c5d5\transformed\jetified-animation-core-release\META-INF\com\android\build\gradle\aar-metadata.properties.

The minCompileSdk (33) specified in a
dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
is greater than this module's compileSdkVersion (android-31).
Dependency: androidx.compose.animation:animation-android:1.5.0-beta03.
AAR metadata file: C:\Users\av200\.gradle\caches\transforms-3\94d7f50e9c80139f9a9900484fa1f354\transformed\jetified-animation-release\META-INF\com\android\build\gradle\aar-metadata.properties.

The minCompileSdk (33) specified in a
dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
is greater than this module's compileSdkVersion (android-31).
Dependency: androidx.compose.ui:ui-tooling-data-android:1.5.0-beta03.
AAR metadata file: C:\Users\av200\.gradle\caches\transforms-3\1c2ab25688f74354817c7db23f1ec93f\transformed\jetified-ui-tooling-data-release\META-INF\com\android\build\gradle\aar-metadata.properties.

The minCompileSdk (33) specified in a
dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
is greater than this module's compileSdkVersion (android-31).
Dependency: androidx.compose.ui:ui-unit-android:1.5.0-beta03.
AAR metadata file: C:\Users\av200\.gradle\caches\transforms-3\230f749be606ce5f30e580e51691c305\transformed\jetified-ui-unit-release\META-INF\com\android\build\gradle\aar-metadata.properties.

The minCompileSdk (33) specified in a
dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
is greater than this module's compileSdkVersion (android-31).
Dependency: androidx.compose.ui:ui-tooling-preview-android:1.5.0-beta03.
AAR metadata file: C:\Users\av200\.gradle\caches\transforms-3\777a89fa8accbbabead994f19c40ef2d\transformed\jetified-ui-tooling-preview-release\META-INF\com\android\build\gradle\aar-metadata.properties.

The minCompileSdk (33) specified in a
dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
is greater than this module's compileSdkVersion (android-31).
Dependency: androidx.compose.ui:ui-text-android:1.5.0-beta03.
AAR metadata file: C:\Users\av200\.gradle\caches\transforms-3\6cdf900ae7912e978f9e7aaf22ead4b1\transformed\jetified-ui-text-release\META-INF\com\android\build\gradle\aar-metadata.properties.

The minCompileSdk (33) specified in a
dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
is greater than this module's compileSdkVersion (android-31).
Dependency: androidx.compose.ui:ui-graphics-android:1.5.0-beta03.
AAR metadata file: C:\Users\av200\.gradle\caches\transforms-3\b6afdaae619ec94474367b304da61d1e\transformed\jetified-ui-graphics-release\META-INF\com\android\build\gradle\aar-metadata.properties.

The minCompileSdk (33) specified in a
dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
is greater than this module's compileSdkVersion (android-31).
Dependency: androidx.compose.ui:ui-util-android:1.5.0-beta03.
AAR metadata file: C:\Users\av200\.gradle\caches\transforms-3\28a65d6bea7e5818a41205c11f4fb6ab\transformed\jetified-ui-util-release\META-INF\com\android\build\gradle\aar-metadata.properties.

The minCompileSdk (33) specified in a
dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
is greater than this module's compileSdkVersion (android-31).
Dependency: androidx.compose.ui:ui-geometry-android:1.5.0-beta03.
AAR metadata file: C:\Users\av200\.gradle\caches\transforms-3\208e384179ca11ddf3a48eb3e2d19497\transformed\jetified-ui-geometry-release\META-INF\com\android\build\gradle\aar-metadata.properties.

The minCompileSdk (33) specified in a
dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
is greater than this module's compileSdkVersion (android-31).
Dependency: androidx.compose.ui:ui-tooling-android:1.5.0-beta03.
AAR metadata file: C:\Users\av200\.gradle\caches\transforms-3\0aa798322ec7282d107107258b92acd7\transformed\jetified-ui-tooling-release\META-INF\com\android\build\gradle\aar-metadata.properties.

The minCompileSdk (33) specified in a
dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
is greater than this module's compileSdkVersion (android-31).
Dependency: androidx.compose.ui:ui-android:1.5.0-beta03.
AAR metadata file: C:\Users\av200\.gradle\caches\transforms-3\a2cd99ff21fceb11ef6d06e9f240d05c\transformed\jetified-ui-release\META-INF\com\android\build\gradle\aar-metadata.properties.

The minCompileSdk (33) specified in a
dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
is greater than this module's compileSdkVersion (android-31).
Dependency: androidx.activity:activity-ktx:1.7.2.
AAR metadata file: C:\Users\av200\.gradle\caches\transforms-3\1fe321e8860c03c3ec14e9a17225b894\transformed\jetified-activity-ktx-1.7.2\META-INF\com\android\build\gradle\aar-metadata.properties.

The minCompileSdk (33) specified in a
dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
is greater than this module's compileSdkVersion (android-31).
Dependency: androidx.activity:activity:1.7.2.
AAR metadata file: C:\Users\av200\.gradle\caches\transforms-3\4c930e340c3329f2db593c521cd01dc8\transformed\jetified-activity-1.7.2\META-INF\com\android\build\gradle\aar-metadata.properties.

The minCompileSdk (33) specified in a
dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
is greater than this module's compileSdkVersion (android-31).
Dependency: androidx.activity:activity-compose:1.7.2.
AAR metadata file: C:\Users\av200\.gradle\caches\transforms-3\a994f60b49e137108d060d364369cc50\transformed\jetified-activity-compose-1.7.2\META-INF\com\android\build\gradle\aar-metadata.properties.

The minCompileSdk (33) specified in a
dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
is greater than this module's compileSdkVersion (android-31).
Dependency: androidx.savedstate:savedstate-ktx:1.2.1.
AAR metadata file: C:\Users\av200\.gradle\caches\transforms-3\0ae939851d037e48c6e6e9323b0624ae\transformed\jetified-savedstate-ktx-1.2.1\META-INF\com\android\build\gradle\aar-metadata.properties.

The minCompileSdk (33) specified in a
dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
is greater than this module's compileSdkVersion (android-31).
Dependency: androidx.savedstate:savedstate:1.2.1.
AAR metadata file: C:\Users\av200\.gradle\caches\transforms-3\9559fc961e98df3c28123ea9e7b679f9\transformed\jetified-savedstate-1.2.1\META-INF\com\android\build\gradle\aar-metadata.properties.

The minCompileSdk (33) specified in a
dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
is greater than this module's compileSdkVersion (android-31).
Dependency: androidx.emoji2:emoji2-views-helper:1.4.0-beta04.
AAR metadata file: C:\Users\av200\.gradle\caches\transforms-3\390d99cb941af84cb264ac4eb1bd77ea\transformed\jetified-emoji2-views-helper-1.4.0-beta04\META-INF\com\android\build\gradle\aar-metadata.properties.

The minCompileSdk (33) specified in a
dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
is greater than this module's compileSdkVersion (android-31).
Dependency: androidx.emoji2:emoji2:1.4.0-beta04.
AAR metadata file: C:\Users\av200\.gradle\caches\transforms-3\70416f1f829ed1954cc94c2621a9f450\transformed\jetified-emoji2-1.4.0-beta04\META-INF\com\android\build\gradle\aar-metadata.properties.

The minCompileSdk (33) specified in a
dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
is greater than this module's compileSdkVersion (android-31).
Dependency: androidx.lifecycle:lifecycle-process:2.6.1.
AAR metadata file: C:\Users\av200\.gradle\caches\transforms-3\2bc8a38b086b6b1268eeba66701b20b3\transformed\jetified-lifecycle-process-2.6.1\META-INF\com\android\build\gradle\aar-metadata.properties.

The minCompileSdk (33) specified in a
dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
is greater than this module's compileSdkVersion (android-31).
Dependency: androidx.lifecycle:lifecycle-livedata:2.6.1.
AAR metadata file: C:\Users\av200\.gradle\caches\transforms-3\cb48a0d2ab1e9b0305a0789a351f9b7a\transformed\lifecycle-livedata-2.6.1\META-INF\com\android\build\gradle\aar-metadata.properties.

The minCompileSdk (33) specified in a
dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
is greater than this module's compileSdkVersion (android-31).
Dependency: androidx.lifecycle:lifecycle-livedata-core:2.6.1.
AAR metadata file: C:\Users\av200\.gradle\caches\transforms-3\2f1faa4cb8b0b272e4a92dc79a9f57a8\transformed\lifecycle-livedata-core-2.6.1\META-INF\com\android\build\gradle\aar-metadata.properties.

The minCompileSdk (33) specified in a
dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
is greater than this module's compileSdkVersion (android-31).
Dependency: androidx.lifecycle:lifecycle-viewmodel-savedstate:2.6.1.
AAR metadata file: C:\Users\av200\.gradle\caches\transforms-3\c34378dbc476166bbcf21066ebc24f07\transformed\jetified-lifecycle-viewmodel-savedstate-2.6.1\META-INF\com\android\build\gradle\aar-metadata.properties.

The minCompileSdk (33) specified in a
dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
is greater than this module's compileSdkVersion (android-31).
Dependency: androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.1.
AAR metadata file: C:\Users\av200\.gradle\caches\transforms-3\bb8bfc0860eea1b0cdeb9397468b3472\transformed\jetified-lifecycle-viewmodel-ktx-2.6.1\META-INF\com\android\build\gradle\aar-metadata.properties.

The minCompileSdk (33) specified in a
dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
is greater than this module's compileSdkVersion (android-31).
Dependency: androidx.lifecycle:lifecycle-viewmodel:2.6.1.
AAR metadata file: C:\Users\av200\.gradle\caches\transforms-3\ba937d7e57ddd186ec1ed81ead4efffa\transformed\lifecycle-viewmodel-2.6.1\META-INF\com\android\build\gradle\aar-metadata.properties.

The minCompileSdk (32) specified in a
dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
is greater than this module's compileSdkVersion (android-31).
Dependency: androidx.customview:customview-poolingcontainer:1.0.0.
AAR metadata file: C:\Users\av200\.gradle\caches\transforms-3\93f8844f9023385c1440b00947e4ef81\transformed\jetified-customview-poolingcontainer-1.0.0\META-INF\com\android\build\gradle\aar-metadata.properties.

The minCompileSdk (33) specified in a
dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
is greater than this module's compileSdkVersion (android-31).
Dependency: androidx.core:core:1.11.0-beta02.
AAR metadata file: C:\Users\av200\.gradle\caches\transforms-3\75f03c3f5845f8e03ff3c47b9812b82a\transformed\core-1.11.0-beta02\META-INF\com\android\build\gradle\aar-metadata.properties.

The minCompileSdk (33) specified in a
dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
is greater than this module's compileSdkVersion (android-31).
Dependency: androidx.lifecycle:lifecycle-runtime:2.6.1.
AAR metadata file: C:\Users\av200\.gradle\caches\transforms-3\46f521c1abe48237283b688076e097cf\transformed\lifecycle-runtime-2.6.1\META-INF\com\android\build\gradle\aar-metadata.properties.

The minCompileSdk (33) specified in a
dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
is greater than this module's compileSdkVersion (android-31).
Dependency: androidx.lifecycle:lifecycle-viewmodel-compose:2.6.1.
AAR metadata file: C:\Users\av200\.gradle\caches\transforms-3\9580e703344d3b003f5d50ef0b1c0f25\transformed\jetified-lifecycle-viewmodel-compose-2.6.1\META-INF\com\android\build\gradle\aar-metadata.properties.

The minCompileSdk (33) specified in a
dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
is greater than this module's compileSdkVersion (android-31).
Dependency: androidx.lifecycle:lifecycle-runtime-ktx:2.6.1.
AAR metadata file: C:\Users\av200\.gradle\caches\transforms-3\5c420aacb178b34a6c183c44d0ac1e37\transformed\jetified-lifecycle-runtime-ktx-2.6.1\META-INF\com\android\build\gradle\aar-metadata.properties.

The minCompileSdk (33) specified in a
dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
is greater than this module's compileSdkVersion (android-31).
Dependency: androidx.room:room-ktx:2.5.2.
AAR metadata file: C:\Users\av200\.gradle\caches\transforms-3\78155d01fbc69fee9a957bab0064d0f8\transformed\jetified-room-ktx-2.5.2\META-INF\com\android\build\gradle\aar-metadata.properties.

The minCompileSdk (33) specified in a
dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
is greater than this module's compileSdkVersion (android-31).
Dependency: androidx.compose.runtime:runtime-saveable-android:1.5.0-beta03.
AAR metadata file: C:\Users\av200\.gradle\caches\transforms-3\b29d87e8c605bfcfeacf0b1556ee9298\transformed\jetified-runtime-saveable-release\META-INF\com\android\build\gradle\aar-metadata.properties.

The minCompileSdk (33) specified in a
dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
is greater than this module's compileSdkVersion (android-31).
Dependency: androidx.compose.runtime:runtime-android:1.5.0-beta03.
AAR metadata file: C:\Users\av200\.gradle\caches\transforms-3\6704bfb5ae41c5a292abb5cf76ceff94\transformed\jetified-runtime-release\META-INF\com\android\build\gradle\aar-metadata.properties.

The minCompileSdk (33) specified in a
dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
is greater than this module's compileSdkVersion (android-31).
Dependency: androidx.room:room-runtime:2.5.2.
AAR metadata file: C:\Users\av200\.gradle\caches\transforms-3\a7ee6c31b6f9092d3fbe875ff71c74d4\transformed\room-runtime-2.5.2\META-INF\com\android\build\gradle\aar-metadata.properties.

The minCompileSdk (33) specified in a
dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
is greater than this module's compileSdkVersion (android-31).
Dependency: androidx.sqlite:sqlite-framework:2.3.1.
AAR metadata file: C:\Users\av200\.gradle\caches\transforms-3\07fac618ec52dc76e937368226e87c51\transformed\sqlite-framework-2.3.1\META-INF\com\android\build\gradle\aar-metadata.properties.

The minCompileSdk (33) specified in a
dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
is greater than this module's compileSdkVersion (android-31).
Dependency: androidx.sqlite:sqlite:2.3.1.
AAR metadata file: C:\Users\av200\.gradle\caches\transforms-3\b4d9103c3305ce7e85d2d67ad9b6ef39\transformed\sqlite-2.3.1\META-INF\com\android\build\gradle\aar-metadata.properties.

The minCompileSdk (33) specified in a
dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
is greater than this module's compileSdkVersion (android-31).
Dependency: androidx.annotation:annotation-experimental:1.3.0.
AAR metadata file: C:\Users\av200\.gradle\caches\transforms-3\cfb77c39dda5cea9ec40ecb950972ce4\transformed\jetified-annotation-experimental-1.3.0\META-INF\com\android\build\gradle\aar-metadata.properties.

The minCompileSdk (33) specified in a
dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
is greater than this module's compileSdkVersion (android-31).
Dependency: androidx.arch.core:core-runtime:2.2.0.
AAR metadata file: C:\Users\av200\.gradle\caches\transforms-3\1e72c4d2df440d513a1a968318f33d91\transformed\core-runtime-2.2.0\META-INF\com\android\build\gradle\aar-metadata.properties.

The minCompileSdk (33) specified in a
dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
is greater than this module's compileSdkVersion (android-31).
Dependency: androidx.profileinstaller:profileinstaller:1.3.0.
AAR metadata file: C:\Users\av200\.gradle\caches\transforms-3\e2278eb343c2f86d5a5a03d40219480e\transformed\jetified-profileinstaller-1.3.0\META-INF\com\android\build\gradle\aar-metadata.properties.

字符串

这是我的Gradle构建文件

plugins {
    id 'com.android.application'
    id 'kotlin-android'
    id 'kotlin-kapt'
    id 'dagger.hilt.android.plugin'
}

android {
    compileSdk 31

    defaultConfig {
        configurations.all {
            resolutionStrategy { force 'androidx.core:core-ktx:1.6.0' }
        }
        applicationId "com.plcoding.cleanarchitecturenoteapp"
        minSdk 21
        targetSdk 31
        versionCode 1
        versionName "1.0"

        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'
        useIR = true
    }
    buildFeatures {
        compose true
    }
    composeOptions {
        kotlinCompilerExtensionVersion compose_version
        kotlinCompilerVersion '1.5.21'
    }
    packagingOptions {
        resources {
            excludes += '/META-INF/{AL2.0,LGPL2.1}'
        }
    }
}

dependencies {

    implementation 'androidx.core:core-ktx:1.10.1.0'
    implementation 'androidx.appcompat:appcompat:1.6.1'
    implementation 'com.google.android.material:material:1.6.0'
    implementation "androidx.compose.ui:ui:$compose_version"
    //noinspection GradleDependency
    implementation "androidx.compose.material:material:$compose_version"
    implementation "androidx.compose.ui:ui-tooling-preview:$compose_version"
    implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.6.1'
    implementation 'androidx.activity:activity-compose:1.7.2'
    testImplementation 'junit:junit:'
    androidTestImplementation 'androidx.test.ext:junit:1.1.5'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
    androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_version"
    debugImplementation "androidx.compose.ui:ui-tooling:$compose_version"

    // Compose dependencies
    implementation "androidx.lifecycle:lifecycle-viewmodel-compose:2.6.1"
    implementation "androidx.navigation:navigation-compose:2.7.0-beta02"
    //noinspection GradleDependency
    implementation "androidx.compose.material:material-icons-extended:$compose_version"
    implementation "androidx.hilt:hilt-navigation-compose:1.1.0-alpha01"

    // Coroutines
    implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4'
    implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4'

    //Dagger - Hilt
    implementation "com.google.dagger:hilt-android:2.44"
    kapt "com.google.dagger:hilt-android-compiler:2.37"
    implementation "androidx.hilt:hilt-lifecycle-viewmodel:1.0.0-alpha03"
    kapt "androidx.hilt:hilt-compiler:1.0.0"

    // Room
    implementation "androidx.room:room-runtime:2.5.2"
    kapt "androidx.room:room-compiler:2.5.2"

    // Kotlin Extensions and Coroutines support for Room
    implementation "androidx.room:room-ktx:2.5.2"
}


我在github上尝试了几个解决方案,但都不起作用

b1zrtrql

b1zrtrql1#

只需将您的compileSdk版本更新为33即可。
您在minCompileSdk34中使用的唯一库是navigation compose。因此,您需要将其降级到最新的稳定版本2.6.0,而不是新的测试版。

implementation "androidx.navigation:navigation-compose:2.6.0"

字符串

相关问题