java - 无法解决:com.android.support:appcompat-v7:jar
问题描述
我是 Android Studio 平台的新手。我收到此错误“无法解决:com.android.support:appcompat-v7:jar”
目前我的 Android Studio 版本是 3.5.0。我在 build.gradle 存储库上添加了 google()
这是我的 build.gradle(项目)
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
classpath 'com.google.gms:google-services:3.2.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
这是我的 build.gradle(模块应用程序)
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 28
buildToolsVersion '28.0.3'
defaultConfig {
applicationId "com.kartik.barcode"
minSdkVersion 17
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
testImplementation 'junit:junit:4.12'
implementation 'com.android.support:appcompat-v7:jar:28.0.0-alpha1'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:support-media-compat:28.0.0'
implementation 'com.android.support:animated-vector-drawable:28.0.0'
implementation 'com.android.support:customtabs:28.0.0'
//implementation 'com.android.support:design:jar:28.0.0-alpha1'
implementation 'com.journeyapps:zxing-android-embedded:3.0.2@aar'
implementation 'com.google.zxing:core:3.2.0'
// implementation 'com.android.support:design:jar:28.0.0-alpha1'//for The edittext animation
implementation 'com.google.firebase:firebase-database:9.0.0'//for firebase
implementation 'com.google.firebase:firebase-auth:9.0.0'
implementation 'com.google.firebase:firebase-storage:9.0.0'
implementation 'com.google.android.gms:play-services-auth:9.0.0'
implementation 'com.google.firebase:firebase-appindexing:19.0.0'
implementation 'com.squareup.picasso:picasso:2.5.2'
}
我仍然收到此错误:错误:无法解决:com.android.support:appcompat-v7:jar 在项目结构对话框中显示受影响的模块:app
解决方案
你应该使用PROPER
版本。此依赖项中没有jar。
使用稳定
implementation 'com.android.support:appcompat-v7:28.0.0' //28.0.0-alpha1
供参考
请通过更新 google-services 插件的版本或将 com.google.android.gms 的版本更新为 11.4.2 来修复版本冲突
您应该升级到以下版本
implementation 'com.google.android.gms:play-services-auth:17.0.0'
如果您使用升级的类路径,这将是一个好方法
classpath 'com.google.gms:google-services:4.2.0'
推荐阅读
- javascript - 向 Semantic UI React 下拉列表的每一行添加一个按钮/图标
- r - 如何填充/着色ggplot2中重叠的两条线的区域?
- reactjs - 返回函数在 NextJS Web 应用程序中仅调用一次
- python - Python多处理:每k次迭代写入文件
- modelica - 是否可以将全局值发送到 OpenModelica 中的另一个模型?
- c# - 文件内容搜索c#
- android - gradlew.bat 上的 React Native 构建错误
- sql - 根据传入的时间值(从列表中)获取下一次的值
- postgresql - Proc SQL 到 Postgres UFT8 数据库:不可打印字符显示为普通问号,无法删除
- php - 如果目标时间小于 PHP 中的当前时间,如何打印消息