gpt4 book ai didi

android - Gradle 构建错误找不到支持库

转载 作者:太空宇宙 更新时间:2023-11-03 10:59:29 25 4
gpt4 key购买 nike

我使用的是支持库版本 27.0.0我收到这个奇怪的构建错误。我使用的支持库是 27.0.0 但它仍然会抛出 27.0.99 的错误

我试过清理项目,使 Android studio 中的缓存无效,重新启动我的 android studio 它没有帮助。

如果我将我的 buildtoolversion 和支持库更新到 27.0.2,它仍然会为 27.0.99 抛出错误

Error:Could not find com.android.support:customtabs:27.0.99.
Searched in the following locations:
file:/Applications/Android Studio.app/Contents/gradle/m2repository/com/android/support/customtabs/27.0.99/customtabs-27.0.99.pom
file:/Applications/Android Studio.app/Contents/gradle/m2repository/com/android/support/customtabs/27.0.99/customtabs-27.0.99.jar
https://jcenter.bintray.com/com/android/support/customtabs/27.0.99/customtabs-27.0.99.pom
https://jcenter.bintray.com/com/android/support/customtabs/27.0.99/customtabs-27.0.99.jar
https://repo1.maven.org/maven2/com/android/support/customtabs/27.0.99/customtabs-27.0.99.pom
https://repo1.maven.org/maven2/com/android/support/customtabs/27.0.99/customtabs-27.0.99.jar
https://maven.fabric.io/public/com/android/support/customtabs/27.0.99/customtabs-27.0.99.pom
https://maven.fabric.io/public/com/android/support/customtabs/27.0.99/customtabs-27.0.99.jar
https://jitpack.io/com/android/support/customtabs/27.0.99/customtabs-27.0.99.pom
https://jitpack.io/com/android/support/customtabs/27.0.99/customtabs-27.0.99.jar
https://maven.google.com/com/android/support/customtabs/27.0.99/customtabs-27.0.99.pom
https://maven.google.com/com/android/support/customtabs/27.0.99/customtabs-27.0.99.jar
Required by:
project :app

Please install the Android Support Repository from the Android SDK Manager.
<a href="openAndroidSdkManager">Open Android SDK Manager</a>

我已经为来自谷歌的支持库添加了 maven

allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}

这是我的默认gradle配置

compileSdkVersion 27
buildToolsVersion "27.0.0"
defaultConfig {
vectorDrawables.useSupportLibrary = true
applicationId "com.pro.test"
minSdkVersion 19
targetSdkVersion 27
versionCode 18
versionName "1.17"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
signingConfig signingConfigs.config
multiDexEnabled true
}

我使用的支持库是

compile 'com.android.support:appcompat-v7:27.0.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:design:27.0.0'
compile 'com.android.support:support-v4:27.0.0'
compile 'com.android.support:customtabs:27.0.0'
compile 'com.android.support:cardview-v7:27.0.0'

最佳答案

您是否在您的应用中使用 OneSignal SDK?

如果是,你应该改用这个 include :

compile 'com.onesignal:OneSignal:3.5.8'

并且您应该将您的 buildToolsVersiontargetSdkVersioncompileSdkVersion 降级到 26.0.2 而不是 27。

它似乎不是 100% 兼容 v27 :)

来源:

https://github.com/OneSignal/OneSignal-Android-SDK/issues/352 https://github.com/OneSignal/OneSignal-Android-SDK/issues/303

关于android - Gradle 构建错误找不到支持库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47831041/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com