I'm using compose bill of materials to manage my compose versions in the project. I updated the bom version to 2023:08:00 and now I'm getting this error:

An issue was found when checking AAR metadata:

1. Dependency 'androidx.emoji2:emoji2:1.4.0' requires libraries and applications that
   depend on it to compile against version 34 or later of the
   Android APIs.

   :app is currently compiled against android-33.

   Also, the maximum recommended compile SDK version for Android Gradle
   plugin 8.1.0 is 33.

   Recommended action: Update this project's version of the Android Gradle
   plugin to one that supports 34, then update this project to use
   compileSdk of at least 34.

   Note that updating a library or application's compileSdk (which
   allows newer APIs to be used) can be done separately from updating
   targetSdk (which opts the app in to new runtime behavior) and
   minSdk (which determines which devices the app can be installed
   on).

我如何更新我的编写版本,而不更改编译和目标Sdk为34?

Project level gradle:

buildscript {
    ext {
        gradle_version = '8.1.0'
        kotlin_version = '1.9.0'
        ksp_version = '1.9.0-1.0.13'
        compose_bom_version = '2023.08.00'
        compose_compiler_version = '1.5.1'
        accompanist_version = '0.31.6-rc'
        hilt_version = '2.44.1'
        hilt_navigation_compose_version = '1.0.0'
        room_version = '2.5.2'
    }
}
plugins {
    id 'com.android.application' version "${gradle_version}" apply false
    id 'org.jetbrains.kotlin.android' version "${kotlin_version}" apply false
    id 'com.google.dagger.hilt.android' version "${hilt_version}" apply false
    id 'com.google.devtools.ksp' version "${ksp_version}" apply false
}

App level gradle:

plugins {
    id 'com.android.application'
    id 'org.jetbrains.kotlin.android'
    id 'com.google.dagger.hilt.android'
    id 'com.google.devtools.ksp'
    id 'kotlin-kapt'
    id 'kotlin-parcelize'
}

android {
    namespace ''
    compileSdk 33

    defaultConfig {
        applicationId ""
        minSdk 29
        targetSdk 33
        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_17
        targetCompatibility JavaVersion.VERSION_17
    }
    kotlinOptions {
        jvmTarget = '17'
    }
    buildFeatures {
        compose true
    }
    composeOptions {
        kotlinCompilerExtensionVersion compose_compiler_version
    }
    packaging {
        resources {
            excludes += '/META-INF/{AL2.0,LGPL2.1}'
        }
    }
}

dependencies {
    
    implementation 'androidx.core:core-ktx:1.10.1'
    implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.6.1'
    implementation 'androidx.activity:activity-compose:1.7.2'
    implementation "androidx.constraintlayout:constraintlayout-compose:1.0.1"
    implementation "androidx.navigation:navigation-compose:2.6.0"

    // Hilt
    implementation "com.google.dagger:hilt-android:$hilt_version"
    kapt "com.google.dagger:hilt-android-compiler:$hilt_version"
    implementation "androidx.hilt:hilt-navigation-compose:$hilt_navigation_compose_version"

    // Room
    implementation "androidx.room:room-runtime:$room_version"
    ksp "androidx.room:room-compiler:$room_version"

    // Jetpack Compose
    implementation platform("androidx.compose:compose-bom:$compose_bom_version")
    implementation "androidx.compose.ui:ui"
    implementation 'androidx.compose.ui:ui-graphics'
    implementation "androidx.compose.ui:ui-tooling-preview"
    implementation 'androidx.compose.material3:material3'
    implementation 'androidx.compose.material3:material3-window-size-class'
    debugImplementation "androidx.compose.ui:ui-tooling"
    debugImplementation "androidx.compose.ui:ui-test-manifest"

    // Accompanist
    implementation "com.google.accompanist:accompanist-navigation-animation:$accompanist_version"
    implementation "com.google.accompanist:accompanist-systemuicontroller:$accompanist_version"

    // Splash
    implementation "androidx.core:core-splashscreen:1.0.1"

    // Test
    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.5'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
    androidTestImplementation platform("androidx.compose:compose-bom:$compose_bom_version")
    androidTestImplementation "androidx.compose.ui:ui-test-junit4"
}

我试图将Jetpack Compose Bills of Material版本更新到最新版本,而不必针对Android 14.

推荐答案

同样的情况,我所做的只是将编译Sdk和构建工具版本更改为34(和34.0.0).这不需要您更改Target Sdk版本.

Android相关问答推荐

ArrayList.remove()(Kotlin中的removeAt())导致奇怪的IndexOutOfBoundsResponse异常

长流与长流的比较<>

Jetpack编写使用自定义主题覆盖库中主题部分

为什么Ionic-checkbox不总是刷新Android上的视图?

如何删除Jetpack Compose中的Textfield底线

为什么当我在装有Firebase的安卓系统中登录苹果时,收到的邮箱为空?

我怎样才能画一条线在喷气背包组成和有一个自定义的角落?

需要 java 17 而不是 java 11:Android CI-CD GitHub Actions

闪屏 API 无法在 Android 12 上运行(API 31、32)

我如何比较多个时间范围并在 Android Compose 中并排显示它们

根据另一个数组的值对数组进行排序

在模块 jetified-kotlin-stdlib-1.8.10 中发现重复的类 kotlin.random.jdk8,带有启动基准

如何添加到先前预填充的 Room 数据库?

React-native 3D对象渲染

可组合的可见性不随状态变化而变化

为什么我不能直接记住 mutableStateOf 可组合函数?

如何在 react native 应用程序中显示复选框?当它在 android 模拟器中可见时

如何处理 com.google.gson.JsonSyntaxException: java.lang.NumberFormatException: For input string: "T1V 4Y8" Kotlin

compose FontFamily 错误:必须初始化变量

Android TTS 在屏幕关闭一段时间后停止朗读