Java Android Studio未能解析:com.Android.support:appcompat-v7.28.0.0
我收到了这个错误,未能解决:com.android.support:appcompat-v7.28.0.0我一直在这里查看,并尝试将其更改为该行的其他变体,但到目前为止运气不佳,为什么我一直收到这个错误Java Android Studio未能解析:com.Android.support:appcompat-v7.28.0.0,java,android,gradle,Java,Android,Gradle,我收到了这个错误,未能解决:com.android.support:appcompat-v7.28.0.0我一直在这里查看,并尝试将其更改为该行的其他变体,但到目前为止运气不佳,为什么我一直收到这个错误 apply plugin: 'com.android.application' android { compileSdkVersion 28 defaultConfig { applicationId "com.example.myapp" minSdkVersion 15
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.myapp"
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'])
implementation 'com.android.support:appcompat-v7.28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.google.firebase:firebase-auth:11.6.0'
implementation 'com.google.firebase:firebase-core:16.0.3'
implementation 'com.google.firebase:firebase-database:16.0.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
apply plugin: 'com.google.gms.google-services'
问题在于添加到
build.gradle
的appcompat-v7
依赖项
将implementation'com.android.support:appcompat-v7.28.0.0'
更改为implementation'com.android.support:appcompat-v7:28.0.0'
<> >注意<代码> <代码> >代码> AppCOMPAT-V7和<代码> 23.0.0分隔工件名和版本。< /P> < P>如果不考虑键入:
implementation 'com.android.support:appcompat-v7.28.0.0'
将其更改为:
implementation 'com.android.support:appcompat-v7:28.0.0'
然后,您可能应该为Firebase依赖项使用最新版本,以避免这些请修复版本错误:
implementation 'com.google.firebase:firebase-auth:16.0.4'
implementation 'com.google.firebase:firebase-core:16.0.4'
implementation 'com.google.firebase:firebase-database:16.0.3'
然后重建项目。另外,记得使用最新的gradle来避免找不到这种依赖关系等
在项目的build.gradle
内部(在项目根目录中):
请尝试编译DKversion 28至27谢谢我现在得到的回复。请通过更新google服务插件的版本(有关最新版本的信息,请访问)或将com.google.android.gms的版本更新为16.0.4.Yes来修复版本冲突。我已经添加了谷歌服务的最新版本。检查我的最新答案。非常感谢你的帮助。非常感谢
dependencies {
classpath 'com.android.tools.build:gradle:3.2.0'
// replace it with the 3.2.0 version
...
classpath 'com.google.gms:google-services:4.1.0' // update this too
}