android 海豚IDE:此版本(1.2.0-alpha 05)的合成编译器需要Kotlin版本1.6.10,但您使用的似乎是Kotlin版本1.6.21

flseospp  于 2022-12-25  发布在  Android
关注(0)|答案(1)|浏览(249)

错误继续显示“请修复您的配置(或suppressKotlinVersionCompatibilityCheck,但不要说我没有警告过您!)”。
如何“修复”配置对我来说并不明显,我添加了建议的标志,但它没有解决,自己失败了。
IDE是海豚Android Studio海豚|二○二一年三月一日
该项目设置Kotlin版本:

buildscript {
    ext.kotlin_version = '1.6.10'

我以前在这里设置项目使用Kotlin1.7.10,但徒劳地希望它能解决这个问题,但它没有。
我尝试在androidx.compose.compiler:compiler上添加一个显式依赖项,但似乎被默默忽略了。
我没有看到Kotlin1.6.21和Compose Compiler 1.2.0-alpha 05的设置位置,因为构建文件中没有设置这两个编译器。
我熟悉Android,但不熟悉Compose。我使用的是当前稳定的IDE和直接取自Compose文档的依赖关系语句,但项目无法构建。
我怀疑在海豚中使用Compose需要依赖版本的某种神奇组合,但我一直无法找到它。
我试过在v1. 0编写,但不得不再次退出,因为有这么多的问题,似乎它仍然是具有挑战性的工作,但也许一些善良的灵魂会指出我的错误,然后我会很高兴地向我们的朋友在谷歌道歉。:-)

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'androidx.navigation.safeargs'
apply plugin: 'com.google.firebase.crashlytics'

android {

    namespace "com.blah"
    
    compileSdk 33

    defaultConfig {
        applicationId "com.blah"
        minSdk 21
        targetSdk 33
        versionCode 123
        versionName "1.2.3"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }

    flavorDimensions "environment"
    productFlavors {
        staging {
            dimension "environment"
            applicationIdSuffix ".staging"
        }
        production {
            dimension "environment"
        }
    }

    applicationVariants.all { variant ->
        variant.outputs.all { output ->
            outputFileName = "MyApp-${variant.versionName}-${variant.name}.apk"
        }
    }

    sourceSets {
        main {
            jniLibs.srcDirs = ['libs']
        }
    }

    buildFeatures {
        dataBinding true
        compose true
    }

    lint {
        disable 'RtlHardcoded'
    }

}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])

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

    // Android X Jetpack
    implementation "androidx.appcompat:appcompat:1.5.1"
    implementation "androidx.lifecycle:lifecycle-extensions:2.2.0"
    implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1"
    implementation 'androidx.core:core-ktx:1.9.0'
    implementation "androidx.constraintlayout:constraintlayout:2.1.4"
    implementation "androidx.recyclerview:recyclerview:1.2.1"
    implementation "androidx.fragment:fragment-ktx:1.5.2"
    implementation "androidx.collection:collection-ktx:1.2.0"
    implementation "androidx.window:window:1.0.0"

    // Jetpack Compose
    implementation("androidx.compose.ui:ui:1.2.1")
    implementation("androidx.compose.ui:ui-tooling:1.2.1")
    // Foundation (Border, Background, Box, Image, Scroll, shapes, animations, etc.)
    implementation("androidx.compose.foundation:foundation:1.2.1")
    implementation("androidx.compose.material:material:1.2.1")
    implementation("androidx.compose.material:material-icons-core:1.2.1")
    implementation("androidx.compose.material:material-icons-extended:1.2.1")
    // Integration with observables
    implementation("androidx.compose.runtime:runtime-livedata:1.2.1")
    implementation("androidx.compose.runtime:runtime-rxjava2:1.2.1")

    // Google
    implementation "com.google.android.material:material:1.6.1"
    implementation 'androidx.coordinatorlayout:coordinatorlayout:1.2.0'

    // Navigation Component
    implementation "androidx.navigation:navigation-fragment-ktx:2.5.2"
    implementation "androidx.navigation:navigation-ui-ktx:2.5.2"

    // Firebase & Crashlytics
    implementation "com.google.firebase:firebase-core:21.1.1"
    implementation "com.google.firebase:firebase-analytics:21.1.1"
    implementation "com.google.firebase:firebase-crashlytics:18.2.13"
    implementation "com.google.firebase:firebase-messaging:21.0.1"

    // Urban Airship push messaging
    implementation "com.urbanairship.android:urbanairship-fcm:13.3.5"

    // Twilio (video calling)
    implementation "com.twilio:video-android-ktx:7.1.1"
    implementation "com.twilio:audioswitch:1.1.4"

    // ExoPlayer
    implementation "com.google.android.exoplayer:exoplayer-core:2.18.1"
    implementation "com.google.android.exoplayer:exoplayer-ui:2.18.1"

    // Third-party
    implementation "com.jakewharton.timber:timber:5.0.1"
    implementation "com.jakewharton.threetenabp:threetenabp:1.4.0"
    implementation "com.squareup.retrofit2:retrofit:2.9.0"
    implementation "com.squareup.retrofit2:converter-moshi:2.9.0"
    implementation "com.squareup.picasso:picasso:2.71828"
    implementation "net.yslibrary.keyboardvisibilityevent:keyboardvisibilityevent:2.3.0"
    // https://github.com/square/okhttp/blob/master/CHANGELOG.md
    implementation "com.squareup.okhttp3:okhttp:4.9.3"
    implementation "com.squareup.okhttp3:logging-interceptor:4.9.3"

    // Open Source Licence List
    implementation "com.github.franmontiel:AttributionPresenter:1.0.1"

    // Shake to Send Feedback
    implementation "com.linkedin.shaky:shaky:3.0.4"
    implementation "com.jraska:falcon:2.2.0"

    // Page Indicator View
    implementation 'com.github.romandanylyk:PageIndicatorView:v.1.0.3'

    // Testing
    implementation "androidx.legacy:legacy-support-v4:1.0.0"
    testImplementation "junit:junit:4.13.2"
    testImplementation "androidx.test:core:1.4.0"
    testImplementation "org.mockito:mockito-core:4.6.0"
    androidTestImplementation "androidx.test:runner:1.4.0"
    androidTestImplementation "androidx.test.espresso:espresso-core:3.4.0"
    androidTestImplementation("androidx.compose.ui:ui-test-junit4:1.2.1")

    apply plugin: 'com.google.gms.google-services'
}

模块构建文件:

apply plugin: "com.github.ben-manes.versions"

buildscript {

    ext.kotlin_version = '1.6.10'

    repositories {
        google()
        mavenCentral()
        gradlePluginPortal()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:7.3.0'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath "androidx.navigation:navigation-safe-args-gradle-plugin:2.5.2"
        classpath "com.google.firebase:firebase-crashlytics-gradle:2.9.2"
        classpath "com.google.gms:google-services:4.3.14"
        classpath "com.github.ben-manes:gradle-versions-plugin:0.42.0"
    }
}

allprojects {
    repositories {
        google()
        maven { url "https://jitpack.io" }
        mavenCentral()

        jcenter() {
            content {
                includeModule("com.google.android", "flexbox")
            }
        }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}
x4shl7ld

x4shl7ld1#

android块中的app/build.gradle文件中添加:

android {

   //..

   composeOptions {         
       kotlinCompilerExtensionVersion "1.3.1"     
   }
}

根据compatibility map使用Kotlin1.7.10

相关问题