编译项目时出现 25.0.0 错误
Posted
技术标签:
【中文标题】编译项目时出现 25.0.0 错误【英文标题】:Error of 25.0.0 while compiling the project 【发布时间】:2017-03-14 07:16:35 【问题描述】:我有一个项目到目前为止运行良好。今天突然遇到这些问题:
Error:A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugCompile'.
> Could not find com.android.support:appcompat-v7:25.0.0.
Searched in the following locations:
file:/D:/Android Studio/Android Studio/gradle/m2repository/com/android/support/appcompat-v7/25.0.0/appcompat-v7-25.0.0.pom
file:/D:/Android Studio/Android Studio/gradle/m2repository/com/android/support/appcompat-v7/25.0.0/appcompat-v7-25.0.0.jar
https://jcenter.bintray.com/com/android/support/appcompat-v7/25.0.0/appcompat-v7-25.0.0.pom
https://jcenter.bintray.com/com/android/support/appcompat-v7/25.0.0/appcompat-v7-25.0.0.jar
https://repo1.maven.org/maven2/com/android/support/appcompat-v7/25.0.0/appcompat-v7-25.0.0.pom
https://repo1.maven.org/maven2/com/android/support/appcompat-v7/25.0.0/appcompat-v7-25.0.0.jar
file:/D:/NewEclips/android-sdk-windows/extras/android/m2repository/com/android/support/appcompat-v7/25.0.0/appcompat-v7-25.0.0.pom
file:/D:/NewEclips/android-sdk-windows/extras/android/m2repository/com/android/support/appcompat-v7/25.0.0/appcompat-v7-25.0.0.jar
file:/D:/NewEclips/android-sdk-windows/extras/google/m2repository/com/android/support/appcompat-v7/25.0.0/appcompat-v7-25.0.0.pom
file:/D:/NewEclips/android-sdk-windows/extras/google/m2repository/com/android/support/appcompat-v7/25.0.0/appcompat-v7-25.0.0.jar
Required by:
Yokura-Seeker:app:unspecified
Yokura-Seeker:app:unspecified > com.android.support:design:23.4.0
> Could not find com.android.support:cardview-v7:25.0.0.
Searched in the following locations:
file:/D:/Android Studio/Android Studio/gradle/m2repository/com/android/support/cardview-v7/25.0.0/cardview-v7-25.0.0.pom
file:/D:/Android Studio/Android Studio/gradle/m2repository/com/android/support/cardview-v7/25.0.0/cardview-v7-25.0.0.jar
https://jcenter.bintray.com/com/android/support/cardview-v7/25.0.0/cardview-v7-25.0.0.pom
https://jcenter.bintray.com/com/android/support/cardview-v7/25.0.0/cardview-v7-25.0.0.jar
https://repo1.maven.org/maven2/com/android/support/cardview-v7/25.0.0/cardview-v7-25.0.0.pom
https://repo1.maven.org/maven2/com/android/support/cardview-v7/25.0.0/cardview-v7-25.0.0.jar
file:/D:/NewEclips/android-sdk-windows/extras/android/m2repository/com/android/support/cardview-v7/25.0.0/cardview-v7-25.0.0.pom
file:/D:/NewEclips/android-sdk-windows/extras/android/m2repository/com/android/support/cardview-v7/25.0.0/cardview-v7-25.0.0.jar
file:/D:/NewEclips/android-sdk-windows/extras/google/m2repository/com/android/support/cardview-v7/25.0.0/cardview-v7-25.0.0.pom
file:/D:/NewEclips/android-sdk-windows/extras/google/m2repository/com/android/support/cardview-v7/25.0.0/cardview-v7-25.0.0.jar
Required by:
Yokura-Seeker:app:unspecified
> Could not find com.android.support:support-v4:25.0.0.
Searched in the following locations:
file:/D:/Android Studio/Android Studio/gradle/m2repository/com/android/support/support-v4/25.0.0/support-v4-25.0.0.pom
file:/D:/Android Studio/Android Studio/gradle/m2repository/com/android/support/support-v4/25.0.0/support-v4-25.0.0.jar
https://jcenter.bintray.com/com/android/support/support-v4/25.0.0/support-v4-25.0.0.pom
https://jcenter.bintray.com/com/android/support/support-v4/25.0.0/support-v4-25.0.0.jar
https://repo1.maven.org/maven2/com/android/support/support-v4/25.0.0/support-v4-25.0.0.pom
https://repo1.maven.org/maven2/com/android/support/support-v4/25.0.0/support-v4-25.0.0.jar
file:/D:/NewEclips/android-sdk-windows/extras/android/m2repository/com/android/support/support-v4/25.0.0/support-v4-25.0.0.pom
file:/D:/NewEclips/android-sdk-windows/extras/android/m2repository/com/android/support/support-v4/25.0.0/support-v4-25.0.0.jar
file:/D:/NewEclips/android-sdk-windows/extras/google/m2repository/com/android/support/support-v4/25.0.0/support-v4-25.0.0.pom
file:/D:/NewEclips/android-sdk-windows/extras/google/m2repository/com/android/support/support-v4/25.0.0/support-v4-25.0.0.jar
Required by:
Yokura-Seeker:app:unspecified > com.android.support:design:23.4.0
Yokura-Seeker:app:unspecified > com.android.support:recyclerview-v7:23.4.0
> Could not find com.android.support:support-v4:25.0.0.
Searched in the following locations:
file:/D:/Android Studio/Android Studio/gradle/m2repository/com/android/support/support-v4/25.0.0/support-v4-25.0.0.pom
file:/D:/Android Studio/Android Studio/gradle/m2repository/com/android/support/support-v4/25.0.0/support-v4-25.0.0.jar
https://jcenter.bintray.com/com/android/support/support-v4/25.0.0/support-v4-25.0.0.pom
https://jcenter.bintray.com/com/android/support/support-v4/25.0.0/support-v4-25.0.0.jar
https://repo1.maven.org/maven2/com/android/support/support-v4/25.0.0/support-v4-25.0.0.pom
https://repo1.maven.org/maven2/com/android/support/support-v4/25.0.0/support-v4-25.0.0.jar
file:/D:/NewEclips/android-sdk-windows/extras/android/m2repository/com/android/support/support-v4/25.0.0/support-v4-25.0.0.pom
file:/D:/NewEclips/android-sdk-windows/extras/android/m2repository/com/android/support/support-v4/25.0.0/support-v4-25.0.0.jar
file:/D:/NewEclips/android-sdk-windows/extras/google/m2repository/com/android/support/support-v4/25.0.0/support-v4-25.0.0.pom
file:/D:/NewEclips/android-sdk-windows/extras/google/m2repository/com/android/support/support-v4/25.0.0/support-v4-25.0.0.jar
Required by:
Yokura-Seeker:app:unspecified > com.facebook.android:facebook-android-sdk:4.17.0
> Could not find com.android.support:appcompat-v7:25.0.0.
Searched in the following locations:
file:/D:/Android Studio/Android Studio/gradle/m2repository/com/android/support/appcompat-v7/25.0.0/appcompat-v7-25.0.0.pom
file:/D:/Android Studio/Android Studio/gradle/m2repository/com/android/support/appcompat-v7/25.0.0/appcompat-v7-25.0.0.jar
https://jcenter.bintray.com/com/android/support/appcompat-v7/25.0.0/appcompat-v7-25.0.0.pom
https://jcenter.bintray.com/com/android/support/appcompat-v7/25.0.0/appcompat-v7-25.0.0.jar
https://repo1.maven.org/maven2/com/android/support/appcompat-v7/25.0.0/appcompat-v7-25.0.0.pom
https://repo1.maven.org/maven2/com/android/support/appcompat-v7/25.0.0/appcompat-v7-25.0.0.jar
file:/D:/NewEclips/android-sdk-windows/extras/android/m2repository/com/android/support/appcompat-v7/25.0.0/appcompat-v7-25.0.0.pom
file:/D:/NewEclips/android-sdk-windows/extras/android/m2repository/com/android/support/appcompat-v7/25.0.0/appcompat-v7-25.0.0.jar
file:/D:/NewEclips/android-sdk-windows/extras/google/m2repository/com/android/support/appcompat-v7/25.0.0/appcompat-v7-25.0.0.pom
file:/D:/NewEclips/android-sdk-windows/extras/google/m2repository/com/android/support/appcompat-v7/25.0.0/appcompat-v7-25.0.0.jar
Required by:
Yokura-Seeker:app:unspecified > com.facebook.android:facebook-android-sdk:4.17.0
> Could not find com.android.support:cardview-v7:25.0.0.
Searched in the following locations:
file:/D:/Android Studio/Android Studio/gradle/m2repository/com/android/support/cardview-v7/25.0.0/cardview-v7-25.0.0.pom
file:/D:/Android Studio/Android Studio/gradle/m2repository/com/android/support/cardview-v7/25.0.0/cardview-v7-25.0.0.jar
https://jcenter.bintray.com/com/android/support/cardview-v7/25.0.0/cardview-v7-25.0.0.pom
https://jcenter.bintray.com/com/android/support/cardview-v7/25.0.0/cardview-v7-25.0.0.jar
https://repo1.maven.org/maven2/com/android/support/cardview-v7/25.0.0/cardview-v7-25.0.0.pom
https://repo1.maven.org/maven2/com/android/support/cardview-v7/25.0.0/cardview-v7-25.0.0.jar
file:/D:/NewEclips/android-sdk-windows/extras/android/m2repository/com/android/support/cardview-v7/25.0.0/cardview-v7-25.0.0.pom
file:/D:/NewEclips/android-sdk-windows/extras/android/m2repository/com/android/support/cardview-v7/25.0.0/cardview-v7-25.0.0.jar
file:/D:/NewEclips/android-sdk-windows/extras/google/m2repository/com/android/support/cardview-v7/25.0.0/cardview-v7-25.0.0.pom
file:/D:/NewEclips/android-sdk-windows/extras/google/m2repository/com/android/support/cardview-v7/25.0.0/cardview-v7-25.0.0.jar
Required by:
Yokura-Seeker:app:unspecified > com.facebook.android:facebook-android-sdk:4.17.0
> Could not find com.android.support:customtabs:25.0.0.
Searched in the following locations:
file:/D:/Android Studio/Android Studio/gradle/m2repository/com/android/support/customtabs/25.0.0/customtabs-25.0.0.pom
file:/D:/Android Studio/Android Studio/gradle/m2repository/com/android/support/customtabs/25.0.0/customtabs-25.0.0.jar
https://jcenter.bintray.com/com/android/support/customtabs/25.0.0/customtabs-25.0.0.pom
https://jcenter.bintray.com/com/android/support/customtabs/25.0.0/customtabs-25.0.0.jar
https://repo1.maven.org/maven2/com/android/support/customtabs/25.0.0/customtabs-25.0.0.pom
https://repo1.maven.org/maven2/com/android/support/customtabs/25.0.0/customtabs-25.0.0.jar
file:/D:/NewEclips/android-sdk-windows/extras/android/m2repository/com/android/support/customtabs/25.0.0/customtabs-25.0.0.pom
file:/D:/NewEclips/android-sdk-windows/extras/android/m2repository/com/android/support/customtabs/25.0.0/customtabs-25.0.0.jar
file:/D:/NewEclips/android-sdk-windows/extras/google/m2repository/com/android/support/customtabs/25.0.0/customtabs-25.0.0.pom
file:/D:/NewEclips/android-sdk-windows/extras/google/m2repository/com/android/support/customtabs/25.0.0/customtabs-25.0.0.jar
Required by:
Yokura-Seeker:app:unspecified > com.facebook.android:facebook-android-sdk:4.17.0
> Could not find com.android.support:support-v4:25.0.0.
Searched in the following locations:
file:/D:/Android Studio/Android Studio/gradle/m2repository/com/android/support/support-v4/25.0.0/support-v4-25.0.0.pom
file:/D:/Android Studio/Android Studio/gradle/m2repository/com/android/support/support-v4/25.0.0/support-v4-25.0.0.jar
https://jcenter.bintray.com/com/android/support/support-v4/25.0.0/support-v4-25.0.0.pom
https://jcenter.bintray.com/com/android/support/support-v4/25.0.0/support-v4-25.0.0.jar
https://repo1.maven.org/maven2/com/android/support/support-v4/25.0.0/support-v4-25.0.0.pom
https://repo1.maven.org/maven2/com/android/support/support-v4/25.0.0/support-v4-25.0.0.jar
file:/D:/NewEclips/android-sdk-windows/extras/android/m2repository/com/android/support/support-v4/25.0.0/support-v4-25.0.0.pom
file:/D:/NewEclips/android-sdk-windows/extras/android/m2repository/com/android/support/support-v4/25.0.0/support-v4-25.0.0.jar
file:/D:/NewEclips/android-sdk-windows/extras/google/m2repository/com/android/support/support-v4/25.0.0/support-v4-25.0.0.pom
file:/D:/NewEclips/android-sdk-windows/extras/google/m2repository/com/android/support/support-v4/25.0.0/support-v4-25.0.0.jar
Required by:
Yokura-Seeker:app:unspecified > com.google.android.gms:play-services-auth:9.8.0 > com.google.android.gms:play-services-basement:9.8.0
我的sdk中也没有25.0.0,还没有下载,而且我的编译版本是23.0.2那么你是在搜索25.0.0吗?
编辑:
我现在面临的确切问题是我正在使用
compile 'com.facebook.android:facebook-android-sdk:4.+'
在 Facebook 的 gradle 中。
在这个库中它使用的是 25.0.0 那么我该如何避免呢?
【问题讨论】:
检查您的 build.gradle 文件。您可能在某个地方忘记编辑 “今天突然遇到这些问题”:这可能与此处compile 'com.facebook.android:facebook-android-sdk:4.+'
使用通配符版本有关。始终使用固定版本以避免意外。
刚才也有同样的问题。我正在使用 'com.android.support:appcompat-v7:23.4.0' 为什么要我 25?我在过去的日子里没有改变任何东西??????任何 Android Studio 更新?我在 Ubuntu 上运行。我也在使用'com.facebook.android:facebook-android-sdk:[4,5)'
在这里回答,看来 facebook 更新了他的 SDK ***.com/questions/40321265/…
【参考方案1】:
由于您没有指定 facebook SDK 的确切版本:compile 'com.facebook.android:facebook-android-sdk:4.+'
,它使用任何版本(可能是最新版本),可能针对最新的 SDK (25),并且需要最新的支持库版本。
所以你有两种方法来解决它:
-
安装缺少的库,并可能在您的项目中以 SDK 25 为目标
使用某些确切版本的 facebook SDK,它不针对最新的 Android SDK
【讨论】:
你能给我facebook的确切版本吗? @ParthAnjaria, mvnrepository.com/artifact/com.facebook.android/… 从这里选择您需要的版本 @ParthAnjaria,看起来它从 4.17.0 版本开始就针对 API 25。所以之前的版本是4.16.1【参考方案2】:只需更换 facebook compile 版本,因为在最新版本 Support lib 更新到 SDK version 25.compile 'com.facebook.android:facebook-android-sdk:4.16.1'强> 只需到此链接查看 SDK 的更改日志https://developers.facebook.com/docs/android/change-log-4.x
【讨论】:
【参考方案3】:TL;DR 只需安装 API 25 并更新 SDK 管理器中的所有内容。
【讨论】:
我忽略了你的回答并在 3 小时后返回,它解决了该死的问题,我当然没有 API 25 上帝为什么是我以上是关于编译项目时出现 25.0.0 错误的主要内容,如果未能解决你的问题,请参考以下文章
关于在vs2010中编译Qt项目时出现“无法解析的外部命令”的错误
错误“只有在启用了不安全代码的情况下,Xamarin VSO中才会出现”使用/ unsafe进行编译时出现不安全代码“?