gpt4 book ai didi

android - 应用程序 build.gradle.kts 文件 Unresolved 引用错误

转载 作者:行者123 更新时间:2023-11-29 19:06:09 45 4
gpt4 key购买 nike

我的应用程序文件夹中有一个 build.gradle.kts 文件。

import org.gradle.internal.impldep.com.amazonaws.PredefinedClientConfigurations.defaultConfig



buildscript {
repositories {
google()
jcenter()
}

dependencies {
configurations {
classpath ("com.github.shyiko:ktlint:0.11.1")
}

classpath ("com.android.tools.build:gradle:3.1.0-alpha01")
classpath ("org.jetbrains.kotlin:kotlin-gradle-plugin:${"kotlin_version"}")


}
}

plugins {
id ("org.jmailen.kotlinter") version "1.5.0"
id ("io.gitlab.arturbosch.detekt") version "1.0.0.RC5-3"

}

apply { from ("com.android.application") }
apply { from ( "kotlin-android" ) }
apply { from ( "kotlin-android-extensions" )}


android {
compileSdkVersion ("28")
buildToolsVersion ("27.0.0")

androidExtensions {
experimental = true
}
}

ext {
ankoVersion = "0.10.2"

moshiVersion = "1.5.0"
okioVersion = "1.13.0"
okhttpVersion = "3.8.1"
okhttpUrlconnectionVersion = "${okhttpVersion}"
okhttpAndroidSupportVersion = "${okhttpVersion}"
okhttpLoggingInterceptorVersion = "${okhttpVersion}"
retrofitVersion = '2.3.0'
retrofitMoshiVersion = "${retrofitVersion}"

robolectricVersion = '3.5.1'
robolectricAndroidAllVersion = '8.1.0-robolectric-r4402310'

kluentVersion = '1.30'
}





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

implementation ("com.android.support.constraint:constraint-layout") version "1.1.0-beta3"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jre8" version ($kotlin_version)
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
implementation "org.jetbrains.anko:anko-common:$ankoVersion"
implementation "com.squareup.moshi:moshi:$moshiVersion"
implementation "com.squareup.moshi:moshi-kotlin:$moshiVersion"

implementation "com.squareup.okio:okio:$okioVersion"
implementation "com.squareup.okhttp3:okhttp:$okhttpVersion"
implementation "com.squareup.okhttp3:okhttp-urlconnection:$okhttpUrlconnectionVersion"
implementation "com.squareup.okhttp3:okhttp-android-support:$okhttpAndroidSupportVersion"
implementation "com.squareup.okhttp3:logging-interceptor:$okhttpLoggingInterceptorVersion"
implementation("com.squareup.retrofit2:retrofit:$retrofitVersion") {
exclude module: "okhttp"
}
implementation "com.squareup.retrofit2:converter-moshi:$retrofitMoshiVersion"
testImplementation "org.robolectric:robolectric:$robolectricVersion"
testImplementation "org.robolectric:android-all:$robolectricAndroidAllVersion"
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.3-alpha', {
exclude group: "com.android.support", module: "support-annotations"
})
testImplementation 'junit:junit:4.12'
testImplementation "org.amshove.kluent:kluent:$kluentVersion"
}

detekt {
profile("main") {
input = "$projectDir/src/main/kotlin"

}
}

这是我完整的 build.gradle 文件。从顶部到 android 的第一部分是,在我看来很好。 Android Studio 也没有显示任何错误。

但是,从关键字 Android { 开始,每一行都被标记为错误。我用这个page检查android应该如何实现。但这同样对我不起作用。我想我误解了 Docu 或混淆了一些东西。

最佳答案

gradle compileSdkVersion 中是 int 值,应该是这样的

compileSdkVersion (28)

而且我认为您混淆了 Project:gradleModule:gradle

关于android - 应用程序 build.gradle.kts 文件 Unresolved 引用错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47157875/

45 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com