Android Studio 突然开始显示无法解析 com.android.support...25.0.0 错误信息,

Android Studio Suddenly started to display unable to resolve com.android.support...25.0.0 error messages and all of my java files are erroneous now?(Android Studio 突然开始显示无法解析 com.android.support...25.0.0 错误信息,我的所有 java 文
本文介绍了Android Studio 突然开始显示无法解析 com.android.support...25.0.0 错误信息,我的所有 java 文件现在都出错了?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我的项目运行良好,但直到有一天,我将项目上传到 github.我不知道这个问题是否与此有关,但是今天当我编译我的 android studio 项目时,它开始向我显示这 4 个可怕的错误.我已经尝试了大部分谷歌结果,但没有任何帮助!

My project was working very fine, but until one day, when I uploaded my project to github. I don't know if this issue is related to that but today when I compiled my android studio project, it started showing me these 4 horrible errors. I have tried most of the google results but no help!

错误:无法解决:com.android.support:cardview-v7:25.0.0
错误:无法解决:com.android.support:customtabs:25.0.0
错误:无法解决:com.android.support:appcompat-v7:25.0.0
错误:无法解决:com.android.support:support-v4:25.0.0

Error:Failed to resolve: com.android.support:cardview-v7:25.0.0
Error:Failed to resolve: com.android.support:customtabs:25.0.0
Error:Failed to resolve: com.android.support:appcompat-v7:25.0.0
Error:Failed to resolve: com.android.support:support-v4:25.0.0

如果有帮助,这是android studio屏幕截图!

这是我的应用级 build.gradle 文件:

This is my app level build.gradle file:

apply plugin: 'com.android.application'

repositories {
    mavenLocal()
    mavenCentral()
    flatDir {
        dirs 'libs'
    }
}

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.3"
    defaultConfig {
        applicationId "com.google.firebase.codelab.friendlychat"
        minSdkVersion 22
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    packagingOptions {
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE-FIREBASE.txt'
        exclude 'META-INF/NOTICE'
    }
    productFlavors {
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:design:23.1.1'
    compile 'com.firebase:firebase-client-android:2.5.0'

    compile 'com.github.bumptech.glide:glide:3.6.1'
    compile 'de.hdodenhof:circleimageview:1.3.0'
    compile 'com.android.support:appcompat-v7:23.1.1'
    // Google
    compile 'com.google.android.gms:play-services-auth:9.4.0'
    // Firebase
    compile 'com.google.firebase:firebase-database:9.4.0'
    compile 'com.google.firebase:firebase-auth:9.4.0'
    compile 'com.google.firebase:firebase-config:9.4.0'
    compile 'com.google.android.gms:play-services-appinvite:9.4.0'
    compile 'com.google.firebase:firebase-messaging:9.4.0'
    compile 'com.google.android.gms:play-services-ads:9.4.0'
    compile 'com.google.firebase:firebase-database:9.2.1'
    compile 'com.google.firebase:firebase-messaging:9.2.1'
    compile 'com.google.firebase:firebase-crash:9.4.0'
    // Firebase UI
    compile 'com.firebaseui:firebase-ui-database:0.4.0'
    // Testing dependencies
    androidTestCompile 'junit:junit:4.12'
    androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.1'
    androidTestCompile 'com.android.support.test:runner:0.4.1'
    androidTestCompile 'com.android.support:support-annotations:23.4.0'


    compile 'com.facebook.android:facebook-android-sdk:[4,5)'
    //facebook
}

apply plugin: 'com.google.gms.google-services'

这是我的项目级build.gradle文件:

buildscript {
    repositories {
        jcenter()
        mavenLocal()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.2'
        classpath 'com.google.gms:google-services:3.0.0'


        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
        mavenLocal()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

为什么我突然开始遇到这些错误.
提前致谢!

Why I am starting to get these errors suddenly.
Thanks in advance!

推荐答案

打开你的 android SDK manager (from C:UsersyouruseraccountAppDataLocalAndroidsdk) 并更新以下到最新版本,

Open your android SDK manager (from C:UsersyouruseraccountAppDataLocalAndroidsdk) and update following to latest versions in,

工具部分部分

  1. Android SDK 工具

  1. Android SDK Tool

Android SDK 平台工具

Android SDK Platform-Tools

Android SDK 构建工具

Android SDK Build tool

Android 7.1.1 (API 25) 部分

  1. SDK 平台

附加部分

  1. Android 支持存储库
  2. Android 支持库

然后相应地更新您的 gradle 文件.

Then update your gradle file accordingly.

这篇关于Android Studio 突然开始显示无法解析 com.android.support...25.0.0 错误信息,我的所有 java 文件现在都出错了?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Android release APK crash with java.lang.AssertionError: impossible in java.lang.Enum(Android 发布 APK 因 java.lang.AssertionError 崩溃:在 java.lang.Enum 中不可能)
Finished with Non Zero Exit Value 3(以非零退出值 3 结束)
On gradle:3.0.0 More than one file was found with OS independent path #39;META-INF/ASL2.0#39;(在 gradle:3.0.0 上找到多个文件,其独立于操作系统的路径为“META-INF/ASL2.0)
Android : app loading library at runtime on Lollipop but not IceCreamSandwich(Android:运行时在 Lollipop 上而不是 IceCreamSandwich 上的应用程序加载库)
buildConfigField depending on flavor + buildType(buildConfigField 取决于风味 + buildType)
How do I suppress warnings when compiling an android library with gradle?(使用 gradle 编译 android 库时如何抑制警告?)