无法解决gradle构建中的依赖项

时间:2023-01-26 20:33:05

Recently I have updated the Android Studio and also the SDK. While rebuilding my app project i m getting following error...

最近我更新了Android Studio和SDK。在重建我的应用程序项目时,我遇到以下错误...

  • What went wrong: A problem occurred configuring project ':app'.

    出了什么问题:配置项目':app'时出现问题。

    Could not resolve all dependencies for configuration ':app:_debugCompile'. Could not find com.android.support:appcompat-v7:23.0.0. Searched in the following locations: https://jcenter.bintray.com/com/android/support/appcompat-v7/23.0.0/appcompat-v7-23.0.0.pom https://jcenter.bintray.com/com/android/support/appcompat-v7/23.0.0/appcompat-v7-23.0.0.jar file:/C:/android new SDK/extras/android/m2repository/com/android/support/appcompat-v7/23.0.0/appcompat-v7-23.0.0.pom file:/C:/android new SDK/extras/android/m2repository/com/android/support/appcompat-v7/23.0.0/appcompat-v7-23.0.0.jar file:/C:/android new SDK/extras/google/m2repository/com/android/support/appcompat-v7/23.0.0/appcompat-v7-23.0.0.pom file:/C:/android new SDK/extras/google/m2repository/com/android/support/appcompat-v7/23.0.0/appcompat-v7-23.0.0.jar Required by: AppOne:app:unspecified

    无法解析配置':app:_debugCompile'的所有依赖项。找不到com.android.support:appcompat-v7:23.0.0。在以下位置搜索:https://jcenter.bintray.com/com/android/support/appcompat-v7/23.0.0/appcompat-v7-23.0.0.pom https://jcenter.bintray.com/com /android/support/appcompat-v7/23.0.0/appcompat-v7-23.0.0.jar文件:/ C:/ android new SDK / extras / android / m2repository / com / android / support / appcompat-v7 / 23.0。 0 / appcompat-v7-23.0.0.pom文件:/ C:/ android new SDK / extras / android / m2repository / com / android / support / appcompat -v7 / 23.0.0 / appcompat-v7-23.0.0.jar file:/ C:/ android new SDK / extras / google / m2repository / com / android / support / appcompat -v7 / 23.0.0 / appcompat -v7-23.0.0.pom file:/ C:/ android new SDK / extras /google/m2repository/com/android/support/appcompat-v7/23.0.0/appcompat-v7-23.0.0.jar必需:AppOne:app:unspecified

  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

    尝试:使用--stacktrace选项运行以获取堆栈跟踪。使用--info或--debug选项运行以获取更多日志输出。

BUILD FAILED

Total time: 4.913 secs ...............................................................

总时间:4.913秒............................................. ..................

My Gradle file config is as follows ..

我的Gradle文件配置如下..

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.0"

    defaultConfig {
        applicationId "com.example.myapplication"
        minSdkVersion 9
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}
dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:23.0.0'
}

2 个解决方案

#1


0  

Take android sdk manager and update

拿android sdk经理并更新

  • Android support Library
  • Android支持库

  • Android support Repository
  • Android支持存储库

It will fix the problem.

它将解决问题。

#2


0  

You need to install/Update the Android support Library and Android support Repository first and then rebuild the project.

您需要先安装/更新Android支持库和Android支持存储库,然后重建项目。

#1


0  

Take android sdk manager and update

拿android sdk经理并更新

  • Android support Library
  • Android支持库

  • Android support Repository
  • Android支持存储库

It will fix the problem.

它将解决问题。

#2


0  

You need to install/Update the Android support Library and Android support Repository first and then rebuild the project.

您需要先安装/更新Android支持库和Android支持存储库,然后重建项目。