首页 > 解决方案 > android build.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
}

应用程序模块是错误点.thk

标签: androidgradle

解决方案


您应该检查您的构建工具和 sdk 工具是否是最新的,检查它们并在必要时更新它们,只需这样做

在此处输入图像描述

在此处输入图像描述

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


推荐阅读