我在Android Studio 3.0 Canary 9中遇到了几个错误。这些错误是“无法解决:”android包,下面列出了一些。 我刚安装了SDK的所有额外软件包,但我仍然遇到了一个gradle构建错误:
Error:(82, 13) Failed to resolve: com.android.support:multidex:1.0.2
Error:(85, 13) Failed to resolve: com.android.support:support-v13:26.0.0
Error:(89, 13) Failed to resolve: com.android.support:recyclerview-v7:26.0.0
Error:(97, 24) Failed to resolve: com.android.support.test:runner:1.0.0
以及一些与测试和支持库相关的软件包。
这是我的构建脚本:
buildscript {
repositories {
jcenter()
mavenCentral()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0-alpha9'
classpath 'com.google.gms:google-services:3.1.0'
classpath 'com.google.firebase:firebase-plugins:1.1.1'
}
}
我真的不确定为什么这不能构建。我刚刚更新了所有软件包,所有支持库在26.0.0中都是相同的 - > compileSdkVersion 26
非常感谢您的任何建议!
[编辑] - 这是我的gradle构建日志
Error:Could not resolve all files for configuration ':app:debugCompileClasspath'.
> Could not find com.android.support:multidex:1.0.2.
Searched in the following locations:
file:/Users/bcalabro/Library/Android/sdk/extras/m2repository/com/android/support/multidex/1.0.2/multidex-1.0.2.pom
file:/Users/bcalabro/Library/Android/sdk/extras/m2repository/com/android/support/multidex/1.0.2/multidex-1.0.2.jar
file:/Users/bcalabro/Library/Android/sdk/extras/google/m2repository/com/android/support/multidex/1.0.2/multidex-1.0.2.pom
file:/Users/bcalabro/Library/Android/sdk/extras/google/m2repository/com/android/support/multidex/1.0.2/multidex-1.0.2.jar
file:/Users/bcalabro/Library/Android/sdk/extras/android/m2repository/com/android/support/multidex/1.0.2/multidex-1.0.2.pom
file:/Users/bcalabro/Library/Android/sdk/extras/android/m2repository/com/android/support/multidex/1.0.2/multidex-1.0.2.jar
file:/Applications/Android Studio 3.0 Preview.app/Contents/gradle/m2repository/com/android/support/multidex/1.0.2/multidex-1.0.2.pom
file:/Applications/Android Studio 3.0 Preview.app/Contents/gradle/m2repository/com/android/support/multidex/1.0.2/multidex-1.0.2.jar
https://jcenter.bintray.com/com/android/support/multidex/1.0.2/multidex-1.0.2.pom
https://jcenter.bintray.com/com/android/support/multidex/1.0.2/multidex-1.0.2.jar
Required by:
project :app
> Could not find com.android.support:support-v13:26.0.0.
Searched in the following locations:
file:/Users/bcalabro/Library/Android/sdk/extras/m2repository/com/android/support/support-v13/26.0.0/support-v13-26.0.0.pom
file:/Users/bcalabro/Library/Android/sdk/extras/m2repository/com/android/support/support-v13/26.0.0/support-v13-26.0.0.jar
file:/Users/bcalabro/Library/Android/sdk/extras/google/m2repository/com/android/support/support-v13/26.0.0/support-v13-26.0.0.pom
file:/Users/bcalabro/Library/Android/sdk/extras/google/m2repository/com/android/support/support-v13/26.0.0/support-v13-26.0.0.jar
file:/Users/bcalabro/Library/Android/sdk/extras/android/m2repository/com/android/support/support-v13/26.0.0/support-v13-26.0.0.pom
file:/Users/bcalabro/Library/Android/sdk/extras/android/m2repository/com/android/support/support-v13/26.0.0/support-v13-26.0.0.jar
file:/Applications/Android Studio 3.0 Preview.app/Contents/gradle/m2repository/com/android/support/support-v13/26.0.0/support-v13-26.0.0.pom
file:/Applications/Android Studio 3.0 Preview.app/Contents/gradle/m2repository/com/android/support/support-v13/26.0.0/support-v13-26.0.0.jar
https://jcenter.bintray.com/com/android/support/support-v13/26.0.0/support-v13-26.0.0.pom
https://jcenter.bintray.com/com/android/support/support-v13/26.0.0/support-v13-26.0.0.jar
Required by:
project :app
> Could not find com.android.support:mediarouter-v7:26.0.0.
Searched in the following locations:
file:/Users/bcalabro/Library/Android/sdk/extras/m2repository/com/android/support/mediarouter-v7/26.0.0/mediarouter-v7-26.0.0.pom
file:/Users/bcalabro/Library/Android/sdk/extras/m2repository/com/android/support/mediarouter-v7/26.0.0/mediarouter-v7-26.0.0.jar
file:/Users/bcalabro/Library/Android/sdk/extras/google/m2repository/com/android/support/mediarouter-v7/26.0.0/mediarouter-v7-26.0.0.pom
file:/Users/bcalabro/Library/Android/sdk/extras/google/m2repository/com/android/support/mediarouter-v7/26.0.0/mediarouter-v7-26.0.0.jar
file:/Users/bcalabro/Library/Android/sdk/extras/android/m2repository/com/android/support/mediarouter-v7/26.0.0/mediarouter-v7-26.0.0.pom
file:/Users/bcalabro/Library/Android/sdk/extras/android/m2repository/com/android/support/mediarouter-v7/26.0.0/mediarouter-v7-26.0.0.jar
file:/Applications/Android Studio 3.0 Preview.app/Contents/gradle/m2repository/com/android/support/mediarouter-v7/26.0.0/mediarouter-v7-26.0.0.pom
file:/Applications/Android Studio 3.0 Preview.app/Contents/gradle/m2repository/com/android/support/mediarouter-v7/26.0.0/mediarouter-v7-26.0.0.jar
https://jcenter.bintray.com/com/android/support/mediarouter-v7/26.0.0/mediarouter-v7-26.0.0.pom
https://jcenter.bintray.com/com/android/support/mediarouter-v7/26.0.0/mediarouter-v7-26.0.0.jar
Required by:
project :app
> Could not find com.android.support:design:26.0.0.
Searched in the following locations:
file:/Users/bcalabro/Library/Android/sdk/extras/m2repository/com/android/support/design/26.0.0/design-26.0.0.pom
file:/Users/bcalabro/Library/Android/sdk/extras/m2repository/com/android/support/design/26.0.0/design-26.0.0.jar
file:/Users/bcalabro/Library/Android/sdk/extras/google/m2repository/com/android/support/design/26.0.0/design-26.0.0.pom
file:/Users/bcalabro/Library/Android/sdk/extras/google/m2repository/com/android/support/design/26.0.0/design-26.0.0.jar
file:/Users/bcalabro/Library/Android/sdk/extras/android/m2repository/com/android/support/design/26.0.0/design-26.0.0.pom
file:/Users/bcalabro/Library/Android/sdk/extras/android/m2repository/com/android/support/design/26.0.0/design-26.0.0.jar
file:/Applications/Android Studio 3.0 Preview.app/Contents/gradle/m2repository/com/android/support/design/26.0.0/design-26.0.0.pom
file:/Applications/Android Studio 3.0 Preview.app/Contents/gradle/m2repository/com/android/support/design/26.0.0/design-26.0.0.jar
https://jcenter.bintray.com/com/android/support/design/26.0.0/design-26.0.0.pom
https://jcenter.bintray.com/com/android/support/design/26.0.0/design-26.0.0.jar
Required by:
project :app
> Could not find com.android.support:support-v4:26.0.0.
Searched in the following locations:
file:/Users/bcalabro/Library/Android/sdk/extras/m2repository/com/android/support/support-v4/26.0.0/support-v4-26.0.0.pom
file:/Users/bcalabro/Library/Android/sdk/extras/m2repository/com/android/support/support-v4/26.0.0/support-v4-26.0.0.jar
file:/Users/bcalabro/Library/Android/sdk/extras/google/m2repository/com/android/support/support-v4/26.0.0/support-v4-26.0.0.pom
file:/Users/bcalabro/Library/Android/sdk/extras/google/m2repository/com/android/support/support-v4/26.0.0/support-v4-26.0.0.jar
file:/Users/bcalabro/Library/Android/sdk/extras/android/m2repository/com/android/support/support-v4/26.0.0/support-v4-26.0.0.pom
file:/Users/bcalabro/Library/Android/sdk/extras/android/m2repository/com/android/support/support-v4/26.0.0/support-v4-26.0.0.jar
file:/Applications/Android Studio 3.0 Preview.app/Contents/gradle/m2repository/com/android/support/support-v4/26.0.0/support-v4-26.0.0.pom
file:/Applications/Android Studio 3.0 Preview.app/Contents/gradle/m2repository/com/android/support/support-v4/26.0.0/support-v4-26.0.0.jar
https://jcenter.bintray.com/com/android/support/support-v4/26.0.0/support-v4-26.0.0.pom
https://jcenter.bintray.com/com/android/support/support-v4/26.0.0/support-v4-26.0.0.jar
Required by:
project :app
> Could not find com.android.support:cardview-v7:26.0.0.
Searched in the following locations:
file:/Users/bcalabro/Library/Android/sdk/extras/m2repository/com/android/support/cardview-v7/26.0.0/cardview-v7-26.0.0.pom
file:/Users/bcalabro/Library/Android/sdk/extras/m2repository/com/android/support/cardview-v7/26.0.0/cardview-v7-26.0.0.jar
file:/Users/bcalabro/Library/Android/sdk/extras/google/m2repository/com/android/support/cardview-v7/26.0.0/cardview-v7-26.0.0.pom
file:/Users/bcalabro/Library/Android/sdk/extras/google/m2repository/com/android/support/cardview-v7/26.0.0/cardview-v7-26.0.0.jar
file:/Users/bcalabro/Library/Android/sdk/extras/android/m2repository/com/android/support/cardview-v7/26.0.0/cardview-v7-26.0.0.pom
file:/Users/bcalabro/Library/Android/sdk/extras/android/m2repository/com/android/support/cardview-v7/26.0.0/cardview-v7-26.0.0.jar
file:/Applications/Android Studio 3.0 Preview.app/Contents/gradle/m2repository/com/android/support/cardview-v7/26.0.0/cardview-v7-26.0.0.pom
file:/Applications/Android Studio 3.0 Preview.app/Contents/gradle/m2repository/com/android/support/cardview-v7/26.0.0/cardview-v7-26.0.0.jar
https://jcenter.bintray.com/com/android/support/cardview-v7/26.0.0/cardview-v7-26.0.0.pom
https://jcenter.bintray.com/com/android/support/cardview-v7/26.0.0/cardview-v7-26.0.0.jar
Required by:
project :app
> Could not find com.android.support:recyclerview-v7:26.0.0.
Searched in the following locations:
file:/Users/bcalabro/Library/Android/sdk/extras/m2repository/com/android/support/recyclerview-v7/26.0.0/recyclerview-v7-26.0.0.pom
file:/Users/bcalabro/Library/Android/sdk/extras/m2repository/com/android/support/recyclerview-v7/26.0.0/recyclerview-v7-26.0.0.jar
file:/Users/bcalabro/Library/Android/sdk/extras/google/m2repository/com/android/support/recyclerview-v7/26.0.0/recyclerview-v7-26.0.0.pom
file:/Users/bcalabro/Library/Android/sdk/extras/google/m2repository/com/android/support/recyclerview-v7/26.0.0/recyclerview-v7-26.0.0.jar
file:/Users/bcalabro/Library/Android/sdk/extras/android/m2repository/com/android/support/recyclerview-v7/26.0.0/recyclerview-v7-26.0.0.pom
file:/Users/bcalabro/Library/Android/sdk/extras/android/m2repository/com/android/support/recyclerview-v7/26.0.0/recyclerview-v7-26.0.0.jar
file:/Applications/Android Studio 3.0 Preview.app/Contents/gradle/m2repository/com/android/support/recyclerview-v7/26.0.0/recyclerview-v7-26.0.0.pom
file:/Applications/Android Studio 3.0 Preview.app/Contents/gradle/m2repository/com/android/support/recyclerview-v7/26.0.0/recyclerview-v7-26.0.0.jar
https://jcenter.bintray.com/com/android/support/recyclerview-v7/26.0.0/recyclerview-v7-26.0.0.pom
https://jcenter.bintray.com/com/android/support/recyclerview-v7/26.0.0/recyclerview-v7-26.0.0.jar
Required by:
project :app
> Could not find com.android.support:appcompat-v7:26.0.0.
Searched in the following locations:
file:/Users/bcalabro/Library/Android/sdk/extras/m2repository/com/android/support/appcompat-v7/26.0.0/appcompat-v7-26.0.0.pom
file:/Users/bcalabro/Library/Android/sdk/extras/m2repository/com/android/support/appcompat-v7/26.0.0/appcompat-v7-26.0.0.jar
file:/Users/bcalabro/Library/Android/sdk/extras/google/m2repository/com/android/support/appcompat-v7/26.0.0/appcompat-v7-26.0.0.pom
file:/Users/bcalabro/Library/Android/sdk/extras/google/m2repository/com/android/support/appcompat-v7/26.0.0/appcompat-v7-26.0.0.jar
file:/Users/bcalabro/Library/Android/sdk/extras/android/m2repository/com/android/support/appcompat-v7/26.0.0/appcompat-v7-26.0.0.pom
file:/Users/bcalabro/Library/Android/sdk/extras/android/m2repository/com/android/support/appcompat-v7/26.0.0/appcompat-v7-26.0.0.jar
file:/Applications/Android Studio 3.0 Preview.app/Contents/gradle/m2repository/com/android/support/appcompat-v7/26.0.0/appcompat-v7-26.0.0.pom
file:/Applications/Android Studio 3.0 Preview.app/Contents/gradle/m2repository/com/android/support/appcompat-v7/26.0.0/appcompat-v7-26.0.0.jar
https://jcenter.bintray.com/com/android/support/appcompat-v7/26.0.0/appcompat-v7-26.0.0.pom
https://jcenter.bintray.com/com/android/support/appcompat-v7/26.0.0/appcompat-v7-26.0.0.jar
Required by:
project :app
> Could not find com.android.support:support-v4:26.0.0.
Searched in the following locations:
file:/Users/bcalabro/Library/Android/sdk/extras/m2repository/com/android/support/support-v4/26.0.0/support-v4-26.0.0.pom
file:/Users/bcalabro/Library/Android/sdk/extras/m2repository/com/android/support/support-v4/26.0.0/support-v4-26.0.0.jar
file:/Users/bcalabro/Library/Android/sdk/extras/google/m2repository/com/android/support/support-v4/26.0.0/support-v4-26.0.0.pom
file:/Users/bcalabro/Library/Android/sdk/extras/google/m2repository/com/android/support/support-v4/26.0.0/support-v4-26.0.0.jar
file:/Users/bcalabro/Library/Android/sdk/extras/android/m2repository/com/android/support/support-v4/26.0.0/support-v4-26.0.0.pom
file:/Users/bcalabro/Library/Android/sdk/extras/android/m2repository/com/android/support/support-v4/26.0.0/support-v4-26.0.0.jar
file:/Applications/Android Studio 3.0 Preview.app/Contents/gradle/m2repository/com/android/support/support-v4/26.0.0/support-v4-26.0.0.pom
file:/Applications/Android Studio 3.0 Preview.app/Contents/gradle/m2repository/com/android/support/support-v4/26.0.0/support-v4-26.0.0.jar
https://jcenter.bintray.com/com/android/support/support-v4/26.0.0/support-v4-26.0.0.pom
https://jcenter.bintray.com/com/android/support/support-v4/26.0.0/support-v4-26.0.0.jar
Required by:
project :app > com.facebook.android:facebook-android-sdk:4.25.0
> Could not find com.android.support:appcompat-v7:26.0.0.
Searched in the following locations:
file:/Users/bcalabro/Library/Android/sdk/extras/m2repository/com/android/support/appcompat-v7/26.0.0/appcompat-v7-26.0.0.pom
file:/Users/bcalabro/Library/Android/sdk/extras/m2repository/com/android/support/appcompat-v7/26.0.0/appcompat-v7-26.0.0.jar
file:/Users/bcalabro/Library/Android/sdk/extras/google/m2repository/com/android/support/appcompat-v7/26.0.0/appcompat-v7-26.0.0.pom
file:/Users/bcalabro/Library/Android/sdk/extras/google/m2repository/com/android/support/appcompat-v7/26.0.0/appcompat-v7-26.0.0.jar
file:/Users/bcalabro/Library/Android/sdk/extras/android/m2repository/com/android/support/appcompat-v7/26.0.0/appcompat-v7-26.0.0.pom
file:/Users/bcalabro/Library/Android/sdk/extras/android/m2repository/com/android/support/appcompat-v7/26.0.0/appcompat-v7-26.0.0.jar
file:/Applications/Android Studio 3.0 Preview.app/Contents/gradle/m2repository/com/android/support/appcompat-v7/26.0.0/appcompat-v7-26.0.0.pom
file:/Applications/Android Studio 3.0 Preview.app/Contents/gradle/m2repository/com/android/support/appcompat-v7/26.0.0/appcompat-v7-26.0.0.jar
https://jcenter.bintray.com/com/android/support/appcompat-v7/26.0.0/appcompat-v7-26.0.0.pom
https://jcenter.bintray.com/com/android/support/appcompat-v7/26.0.0/appcompat-v7-26.0.0.jar
Required by:
project :app > com.facebook.android:facebook-android-sdk:4.25.0
> Could not find com.android.support:cardview-v7:26.0.0.
Searched in the following locations:
file:/Users/bcalabro/Library/Android/sdk/extras/m2repository/com/android/support/cardview-v7/26.0.0/cardview-v7-26.0.0.pom
file:/Users/bcalabro/Library/Android/sdk/extras/m2repository/com/android/support/cardview-v7/26.0.0/cardview-v7-26.0.0.jar
file:/Users/bcalabro/Library/Android/sdk/extras/google/m2repository/com/android/support/cardview-v7/26.0.0/cardview-v7-26.0.0.pom
file:/Users/bcalabro/Library/Android/sdk/extras/google/m2repository/com/android/support/cardview-v7/26.0.0/cardview-v7-26.0.0.jar
file:/Users/bcalabro/Library/Android/sdk/extras/android/m2repository/com/android/support/cardview-v7/26.0.0/cardview-v7-26.0.0.pom
file:/Users/bcalabro/Library/Android/sdk/extras/android/m2repository/com/android/support/cardview-v7/26.0.0/cardview-v7-26.0.0.jar
file:/Applications/Android Studio 3.0 Preview.app/Contents/gradle/m2repository/com/android/support/cardview-v7/26.0.0/cardview-v7-26.0.0.pom
file:/Applications/Android Studio 3.0 Preview.app/Contents/gradle/m2repository/com/android/support/cardview-v7/26.0.0/cardview-v7-26.0.0.jar
https://jcenter.bintray.com/com/android/support/cardview-v7/26.0.0/cardview-v7-26.0.0.pom
https://jcenter.bintray.com/com/android/support/cardview-v7/26.0.0/cardview-v7-26.0.0.jar
Required by:
project :app > com.facebook.android:facebook-android-sdk:4.25.0
> Could not find com.android.support:support-v4:26.0.0.
Searched in the following locations:
file:/Users/bcalabro/Library/Android/sdk/extras/m2repository/com/android/support/support-v4/26.0.0/support-v4-26.0.0.pom
file:/Users/bcalabro/Library/Android/sdk/extras/m2repository/com/android/support/support-v4/26.0.0/support-v4-26.0.0.jar
file:/Users/bcalabro/Library/Android/sdk/extras/google/m2repository/com/android/support/support-v4/26.0.0/support-v4-26.0.0.pom
file:/Users/bcalabro/Library/Android/sdk/extras/google/m2repository/com/android/support/support-v4/26.0.0/support-v4-26.0.0.jar
file:/Users/bcalabro/Library/Android/sdk/extras/android/m2repository/com/android/support/support-v4/26.0.0/support-v4-26.0.0.pom
file:/Users/bcalabro/Library/Android/sdk/extras/android/m2repository/com/android/support/support-v4/26.0.0/support-v4-26.0.0.jar
file:/Applications/Android Studio 3.0 Preview.app/Contents/gradle/m2repository/com/android/support/support-v4/26.0.0/support-v4-26.0.0.pom
file:/Applications/Android Studio 3.0 Preview.app/Contents/gradle/m2repository/com/android/support/support-v4/26.0.0/support-v4-26.0.0.jar
https://jcenter.bintray.com/com/android/support/support-v4/26.0.0/support-v4-26.0.0.pom
https://jcenter.bintray.com/com/android/support/support-v4/26.0.0/support-v4-26.0.0.jar
Required by:
project :app > com.google.android.gms:play-services-analytics:11.0.4 > com.google.android.gms:play-services-basement:11.0.4
答案 0 :(得分:16)
写作:
repositories {
google()
}
在我的情况下没有用,所以我用过:
repositories {
maven {
url 'https://maven.google.com'
}
}
它有效!
结帐migration guide了解详情!