Java 为什么android studio在添加依赖项时出错?
我正在构建一个人脸检测Android应用程序。当我在Java 为什么android studio在添加依赖项时出错?,java,android,android-studio,gradle,Java,Android,Android Studio,Gradle,我正在构建一个人脸检测Android应用程序。当我在app/build.gradle中添加依赖项时,它会给我一个错误。这是我的gradle文件: apply plugin: 'com.android.application' android { compileSdkVersion 28 buildToolsVersion "28.0.3" defaultConfig { applicationId "com.example.android.emojify
app/build.gradle
中添加依赖项时,它会给我一个错误。这是我的gradle文件:
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
buildToolsVersion "28.0.3"
defaultConfig {
applicationId "com.example.android.emojify"
minSdkVersion 15
targetSdkVersion 28
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(dir: 'libs', include: ['*.jar'])
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support ', module: 'support-annotations'
})
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.google.android.gms:play-services-vision:10.2.0'
testImplementation 'junit:junit:4.12'
}
错误报告在以下行中:
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:appcompat-v7:28.0.0'
向我们显示您的错误截图或设置错误格式以便于阅读,只需单击“代码”按钮并粘贴即可。 编辑:谢谢:)
我认为您应该在gradle.build中进行任何更改后使用refresh gradle,可能是因为您的构建工具sdk是28.0.3,并且您希望使用sdk 28.0.0中的工具,只需将compile sdk更改为28.0.0,然后单击actionbar上的sync gradle即可。您的构建工具版本高于您的设计和appcompat-v7。
尝试改变
implementation 'com.android.support:design:28.0.3' //or greater than 28.0.3
implementation 'com.android.support:appcompat-v7:28.0.3' //or greater than 28.0.3
连接到internet,然后构建您的项目。问题将得到解决。什么类型的错误?使用实现“com.android.support:design:28.0.0-rc01”向我们显示错误日志,并将另一个更改为实现“com.android.support:appcompat-v7:27.0.1”