Android Gradle项目同步失败。基本功能无法正常工作
我更新了我的android studio,我的gradle将不同步 它给了我这些错误。我还使用firebase作为授权和数据库。我尝试过删除gradle文件并重建,但没有成功。如有任何建议,将不胜感激Android Gradle项目同步失败。基本功能无法正常工作,android,Android,我更新了我的android studio,我的gradle将不同步 它给了我这些错误。我还使用firebase作为授权和数据库。我尝试过删除gradle文件并重建,但没有成功。如有任何建议,将不胜感激 Failed to resolve .com.android.support:support-v4:25.2.0 Failed to resolve com.android.support.test.espresso:espresso-core:2.2.2 Failed to resolve co
Failed to resolve .com.android.support:support-v4:25.2.0
Failed to resolve com.android.support.test.espresso:espresso-core:2.2.2
Failed to resolve com.android.support:appcompat-v4:25.3.1
Failed to resolve com.android.support:mediarouter-V7:25.2.0
here is the build gradle for the project
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.google.gms:google-services:3.0.0'
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
here is my app gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion '25.0.3'
defaultConfig {
applicationId "com.example.dude.sportspicks518"
minSdkVersion 19
targetSdkVersion 24
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
}
compile 'com.android.support:appcompat-v4:25.3.1'
compile 'com.google.firebase:firebase-auth:10.0.1'
compile 'com.google.firebase:firebase-database:10.0.1'
testCompile 'junit:junit:4.12'
compile 'com.google.android.gms:play-services:10.2.6'
}
apply plugin: 'com.google.gms.google-services'
几种尝试方法
compile "com.android.support:support-v4:25.3.1"
如果编译api不是25,请使用编译api将版本更改为最新版本
如果您使用的是不兼容的版本,Android Studio应该给您一个黄色警告。只需将其悬停并使用给出的建议即可
p/s:请不要使用
com.google.android.gms:play services
。。它很重的指数法计数gradle一般指的是准确的误差,你能检查并公布吗