首页 > 解决方案 > android编译器错误,文件中没有错误

问题描述

编译器错误

android {
compileSdkVersion 27
defaultConfig {
    applicationId "com.example.oneca.myapplication"
    minSdkVersion 22
    targetSdkVersion 27
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}}dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
implementation files('libs/mysql-connector-java-8.0.11.jar')}

这是 build.gradle 中的数据。java文件中没有语法错误。怎么了。

标签: android

解决方案


更新您的minSdkVersion

minSdkVersion 24

因为你的 lib实现文件('libs/mysql-connector-java-8.0.11.jar')}

不支持低于 SdkVersion 24。


推荐阅读