简体   繁体   English

App build.gradle.kts文件未解决的参考Erros

[英]App build.gradle.kts File Unresolved Reference Erros

i have a build.gradle.kts file in my Appfolder. 我的Appfolder中有一个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"

    }
}

This is my complete build.gradle file. 这是我完整的build.gradle文件。 The first Part from the top to android is , in my opion fine. 从我的观点来看,从顶部到android的第一部分是。 Android Studio also shows no error. Android Studio也未显示任何错误。

But, starting with the Keyword Android {, every single line is flagged as an error. 但是,从关键字Android {开始,每一行都被标记为错误。 i used this page to check how android should be implemented. 我使用此页面来检查应如何实施android。 But again this isn´t working for me. 但这又对我不起作用。 I guess i missunderstand the Docu or mix something up. 我想我误会了Docu或混淆了一些东西。

in gradle compileSdkVersion is int value and should looks like this gradle compileSdkVersionint值,应该看起来像这样

compileSdkVersion (28)

And i think you are mixed up Project:gradle and Module:gradle 我认为您混淆了Project:gradleModule:gradle

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 未解决的参考:build.gradle.kts 中的 grgit - Unresolved reference: grgit in build.gradle.kts androidTest Groovy 模拟 build.gradle.kts - androidTest Groovy analog in build.gradle.kts android build.gradle.kts 风格的实现 - android build.gradle.kts flavoured implementation 从 build.gradle 迁移到 build.gradle.kts 时出现一些代码片段问题 - Migrating from build.gradle to build.gradle.kts having issue with some code snippets 将 build.gradle 迁移到 build.gradle.Kts:无法解析 Properties 类 - Migrating the build.gradle to build.gradle.Kts : Not able to resolve Properties class gradle kotlin-dsl move android {} into subproject {} in root project build.gradle.kts - gradle kotlin-dsl move android {} into subproject {} in root project build.gradle.kts Android Studio:如何在 Kotlin 多平台共享模块 build.gradle.kts 中访问项目级 compileSdkVersion 和 targetSdkVersion? - Android Studio: How to access project level compileSdkVersion and targetSdkVersion in Kotlin Multiplatform shared module build.gradle.kts? build.gradle.kts 中的意外标记(使用 ';' 分隔同一行上的表达式) - Unexpected tokens (use ';' to separate expressions on the same line) in build.gradle.kts ClassNotFoundException: kotlin.KotlinNothingValueException 使用带有 build.gradle.kts 的 Android Studio 4.2 Canary 8 - ClassNotFoundException: kotlin.KotlinNothingValueException using Android Studio 4.2 Canary 8 with build.gradle.kts 新 Android studio 4.2 预览版在创建 buildSrc 和 build.gradle.kts 时出现此错误 - New Android studio 4.2 Preview having this error when creating buildSrc and build.gradle.kts
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM