简体   繁体   English

为什么gradle说它无法解析“com.android.support:support-annotations:23.1.1”?

[英]Why does gradle say that it cannot resolve "com.android.support:support-annotations:23.1.1"?

I am building an app called Shaking.我正在构建一个名为 Shaking 的应用程序。 Today I added some button libraries to the project, namely:今天我在项目中添加了一些按钮库,即:

Bootstrap Buttons: https://android-arsenal.com/details/1/65 Bootstrap 按钮: https : //android-arsenal.com/details/1/65

Flat Buttons: https://android-arsenal.com/details/1/68扁平按钮: https : //android-arsenal.com/details/1/68

I added the following in the dependencies block of build.gradle file:我在build.gradle文件的dependencies块中添加了以下内容:

compile 'com.beardedhen:androidbootstrap:2.0.1' //This is the bootstrap library
compile 'info.hoang8f:fbutton:1.0.5' //This is the flat buttons library

just like the webpages above have said.就像上面的网页所说的那样。

Then an error pops up that says:然后弹出一个错误说:

Error:Failed to resolve: com.android.support:support-annotations:23.1.1错误:无法解决:com.android.support:support-annotations:23.1.1

After some time, I figured out that the bootstrap buttons library is causing the problem because if I comment the line out, no errors!一段时间后,我发现引导按钮库导致了问题,因为如果我注释掉该行,就没有错误!

I tried closing Android Studio and opening it again and cleaning the project, rebuilding... It all did not work.我尝试关闭 Android Studio 并再次打开它并清理项目,重建......这一切都不起作用。

Then I found this question然后我发现了这个问题
I thought the problems that I am having is quite similar to that so I followed the steps suggested by the second answer.我认为我遇到的问题与此非常相似,因此我按照第二个答案建议的步骤进行操作。 This time, another error occurred:这一次,又出现了一个错误:

Error:failed to find target android-23 : C:\\Users\\User\\AppData\\Local\\Android\\sdk错误:找不到目标 android-23 : C:\\Users\\User\\AppData\\Local\\Android\\sdk

I think I do not have SDK 23 installed.我想我没有安装 SDK 23。

I really want to know why this happens and how can I fix it!我真的很想知道为什么会发生这种情况以及我该如何解决!

Below is build.gradle of com.beardedhen:androidbootstrap:2.0.1:下面是 com.beardedhen:androidbootstrap:2.0.1 的 build.gradle:

apply plugin: 'com.android.library'
apply from: 'push.gradle'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.1"

    defaultConfig {
        minSdkVersion 11
        targetSdkVersion 23
        versionCode = Integer.parseInt(VERSION_CODE)
        versionName = VERSION_NAME
    }
}

dependencies {
    compile 'com.android.support:support-annotations:23.1.1'
}

You can see that compile 'com.android.support:support-annotations:23.1.1'.你可以看到编译'com.android.support:support-annotations:23.1.1'。

Make sure that you have install android support library 23.1.1:确保您已安装 android 支持库 23.1.1:

在此处输入图片说明

In build.grade module app add this:在 build.grade 模块应用程序中添加:

implementation group: 'com.beardedhen', name: 'androidbootstrap', version: '2.3.2'实现组:'com.beardedhen',名称:'androidbootstrap',版本:'2.3.2'

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法解析 com.android.support:support-annotations 26.0.1 - Failed to resolve com.android.support:support-annotations 26.0.1 与依赖'com.android.support:support-annotations'冲突。 app(23.3.0)和测试app(23.1.1)的已解决版本有所不同 - Conflict with dependency 'com.android.support:support-annotations'. Resolved versions for app (23.3.0) and test app (23.1.1) differ 找不到com.android.support:support-annotations:26.1.0 - Could not find com.android.support:support-annotations:26.1.0 警告:与依赖项“com.android.support:support-annotations”冲突 - Warning:Conflict with dependency 'com.android.support:support-annotations' 与依赖项'com.android.support:support-annotations'冲突 - Conflict with dependency 'com.android.support:support-annotations' 错误:无法解决:com.android.support:support-annotations:26.0.2 - Error:Failed to resolve: com.android.support:support-annotations:26.0.2 与项目中的依赖项“ com.android.support:support-annotations”冲突 - Conflict with dependency 'com.android.support:support-annotations' in project 无法同步Gradle,找不到com.android.support:support-annotations:23.3.0 - Failed to Sync Gradle, could not find com.android.support:support-annotations:23.3.0 找不到满足版本约束的“com.android.support:support-annotations”版本 - Cannot find a version of 'com.android.support:support-annotations' that satisfies the version constraints 无法解析':react-native-twilio-video-webrtc:_debugPublishCopy'的所有依赖项。 > com.android.support:support-annotations - Could not resolve all dependencies for ':react-native-twilio-video-webrtc:_debugPublishCopy'. > com.android.support:support-annotations
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM