繁体   English   中英

android build.gradle模块应用错误:无法解决:注释

[英]android build.gradle module app error : Failed to resolve: annotation

gradle提出了一条错误消息:

无法解决:注解

更新

应用程序gradle模块:

 apply plugin: 'com.android.application'

 apply plugin: 'kotlin-android'

apply plugin: 'kotlin-android-extensions'

 android {
     compileSdkVersion 28
     buildToolsVersion "28.0.1"
     defaultConfig {
         applicationId "com.isatelco.dietuser"
         minSdkVersion 16
         targetSdkVersion 28
         versionCode 1
         versionName "1.0"
         testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
     }
     buildTypes {
         release {
             minifyEnabled false
             proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'),
 'proguard-rules.pro'
         }
    } }

 dependencies{
     implementation fileTree(dir: 'libs', include: ['*.jar'])
     implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'androidx.appcompat:appcompat:1.0.0-alpha1'
     testImplementation 'junit:junit:4.12'
     androidTestImplementation 'androidx.test:runner:1.1.0-alpha3'
     androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0-alpha3' }

和我的项目模块:

buildscript {
    ext.kotlin_version = '1.2.50'
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.3.0-alpha03'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

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

应用模块是错误指向的地方

您应该检查您的构建工具和sdk工具是否最新,以检查它们并在必要时进行更新,只需执行此操作即可。

在此处输入图片说明

在此处输入图片说明

重建gradle并告诉我是否有帮助

暂无
暂无

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM