找不到 com.android.support:support-annotations:26.1.0

2023-12-22

我有一个项目compileSdkVersion and targetSdkVersion是25。当我尝试将版本升级到26时,出现以下错误:

Could not find com.android.support:support-annotations:26.1.0.
Required by:
    project :app
    project :app > com.android.support:support-compat:26.1.0

Please install the Android Support Repository from the Android SDK Manager.
Open Android SDK Manager

我打开 Android SDK Manager,但找不到要安装的 Android 支持存储库。

我该如何解决这个问题?

这是我的应用程序和项目 gradle 文件:

apply plugin: 'com.android.application'
apply plugin: 'com.neenbedankt.android-apt'
apply plugin: 'io.fabric'

android {
    compileSdkVersion 26
    buildToolsVersion '26.0.3'

    defaultConfig {
        //my default config
    }

    signingConfigs {
        config {
            //config
        }
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            signingConfig signingConfigs.config
        }
        debug {
            versionNameSuffix ".debug"
        }
    }

    lintOptions {
        /*disable 'InvalidPackage'*/
        abortOnError false
    }

    repositories {
        jcenter()
        mavenCentral()
        maven { url 'https://maven.fabric.io/public' }
        maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
        maven { url "http://dl.bintray.com/populov/maven" }
        maven { url 'https://oss.sonatype.org/content/repositories/ksoap2-android-releases' }
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_7
        targetCompatibility JavaVersion.VERSION_1_7
    }
}

def support = '26.1.0'
def rounded_image_view = "2.3.0"

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile "com.android.support:support-annotations:$support"
    compile "com.android.support:appcompat-v7:$support"
    compile "com.android.support:support-v4:$support"
    compile "com.android.support:design:$support"
    compile "com.android.support:cardview-v7:$support"
    compile "com.android.support:recyclerview-v7:$support"
    compile "com.android.support:support-vector-drawable:$support"
    compile "com.android.support:support-compat:$support"
    compile "com.android.support:support-core-ui:$support"
    compile 'com.jakewharton:butterknife:7.0.1'
    compile 'com.wrapp.floatlabelededittext:library:0.0.6'
    /*compile 'javax.inject:javax.inject:1'*/

    //needed to resolve compilation errors, thanks to tutplus.org for finding the dependency
    compile 'com.michaelpardo:activeandroid:3.1.0-SNAPSHOT'
    compile 'com.balysv.materialmenu:material-menu:1.5.2'
    compile 'com.flyco.dialog:FlycoDialog_Lib:1.1.6@aar'
    compile 'com.flyco.animation:FlycoAnimation_Lib:1.0.0@aar'
    compile 'com.nhaarman.listviewanimations:lib-core:3.1.0@aar'
    compile 'com.nhaarman.listviewanimations:lib-manipulation:3.1.0@aar'
    compile 'com.nhaarman.listviewanimations:lib-core-slh:3.1.0@aar'
    compile 'com.norbsoft.typefacehelper:library:0.9.0'
    compile 'com.quinny898.library.persistentsearch:library:1.1.0-SNAPSHOT'
    compile 'com.rengwuxian.materialedittext:library:2.1.4'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.squareup.okhttp:okhttp:2.4.0'
    compile 'jp.wasabeef:picasso-transformations:2.1.0'
    compile 'com.tuenti.smsradar:library:1.0.4'
    compile 'com.viewpagerindicator:library:2.4.1@aar'
    compile 'com.xgc1986.android:parallaxpagertransformer:1.0.3'
    compile 'com.github.medyo:fancybuttons:1.5@aar'
    compile 'com.google.code.ksoap2-android:ksoap2-android:2.6.5'
    compile 'com.google.dagger:dagger:2.0.1'
    compile('com.github.afollestad.material-dialogs:core:0.8.5.3@aar') { transitive = true }
    compile 'com.google.android.gms:play-services-gcm:11.0.4'
    compile 'me.relex:circleindicator:1.2.2@aar'
    compile 'com.github.rubensousa:gravitysnaphelper:1.1'
    compile 'com.miguelcatalan:materialsearchview:1.4.0'
    compile 'com.makeramen:roundedimageview:2.3.0'
    compile 'com.journeyapps:zxing-android-embedded:3.5.0'
    compile('com.crashlytics.sdk.android:crashlytics:2.6.8@aar') {
        transitive = true;
    }
    compile 'com.github.bumptech.glide:glide:3.7.0'
    compile 'org.jsoup:jsoup:1.8.3'
    apt "com.google.dagger:dagger-compiler:2.0.1"
    provided 'org.glassfish:javax.annotation:10.0-b28'
    androidTestCompile(
            'org.mockito:mockito-core:1.9.5',
            'org.hamcrest:hamcrest-core:1.1',
            'org.hamcrest:hamcrest-integration:1.1',
            'org.hamcrest:hamcrest-library:1.1'
    )

    compile 'com.romandanylyk:pageindicatorview:0.2.0@aar'
    compile 'ca.barrenechea.header-decor:header-decor:0.2.8'
    compile "com.makeramen:roundedimageview:$rounded_image_view"
    compile 'cz.msebera.android:httpclient:4.4.1.2'
    compile 'de.hdodenhof:circleimageview:2.2.0'


}

apply plugin: 'com.google.gms.google-services'

And:

buildscript {
    repositories {
        jcenter()
        mavenCentral()
        maven { url 'https://maven.fabric.io/public' }
        maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.3'
        classpath 'com.google.gms:google-services:3.0.0'
        classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4'
        classpath 'io.fabric.tools:gradle:1.22.1'
    }
}

allprojects {
    repositories {
        maven { url "http://dl.bintray.com/populov/maven" }
        maven { url "https://jitpack.io" }
        mavenCentral()
        jcenter()
    }

    gradle.projectsEvaluated {
        tasks.withType(JavaCompile) {
            options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
        }
    }
}

我回答我自己的问题:

Adding maven { url 'https://maven.google.com' } to:

allprojects {
    repositories {
        ...
        maven { url 'https://maven.google.com' }//this line is added
        mavenCentral()
        jcenter()
    }
}

为我工作,因为我的 gradle 版本是3.x。我认为@shizhen的答案也是正确的,但gradle版本应该改为4.x+.

欲了解更多信息,请参阅google() 和 maven { url 'https://maven.google.com' } 之间的区别 https://stackoverflow.com/questions/46467561/difference-between-google-and-maven-url-https-maven-google-com

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

找不到 com.android.support:support-annotations:26.1.0 的相关文章

随机推荐

  • 检查变量是否已设置然后回显而不重复?

    是否有一种简洁的方法来检查变量是否已设置 然后回显它而不重复相同的变量名称 而不是这个 我正在考虑这个 C 风格伪代码中的一些内容 PHP has sprintf http www php net manual en function sp
  • 如何更改@NotNull注释对应返回的响应JSON

    我有一个简单的代码 当 RequestBody 中不存在 customerId 时 它返回错误 json VO 类 public class OrderVO private int orderId NotNull message Custo
  • 如何向 html 5 视频添加嵌入链接

    如果您在 Discord 中链接 YouTube 视频 它会在 Discord 上显示为可播放的视频 而不仅仅是链接 对于我的视频 如果我从我的网站链接它们 不和谐会将它们显示为链接而不是视频 我听说我需要在其中嵌入链接 但我不知道我在寻找
  • 打印机 println:未创建新行

    我正在尝试使用 Apache POI 类将 Outlook MSG 文件解码为文本文件 一切正常 除了println的方法PrintWriter 它不会创建新行 它只是将每个句子直接一个接一个地连接起来 下面代码片段的结果是 De text
  • 正则表达式将数字与逗号和点匹配

    我想使用匹配整数和浮点数re模块 因此 如果有人键入以下输入类型之一 它应该验证它是否是一个数字 1000 1 000 1 000 1 000 98 1 000 1 0 1 0000 现在我正在使用以下内容 0 9 任何帮助表示赞赏 对于给
  • 将 JSON 反序列化为对象

    我正在将 JSON 字符串反序列化为对象 我无法使用Dictionary
  • 是否可以为基于 Click 的界面中的所有子命令添加全局参数?

    我正在 virtualenv 下使用 Click 并使用entry pointsetuptools 中的指令将根映射到名为调度的函数 我的工具公开了两个子命令serve and config 我在顶级组上使用一个选项来确保用户始终通过 pa
  • 使用 useState hook 时 React 组件渲染两次

    我无法理解为什么我的应用程序反应组件渲染两次 如下面的 gif 所示 我在返回组件之前插入了一个 console log 以查看组件渲染了多少次 每当我删除 useState 挂钩时 我的应用程序就会像我想象的那样只渲染一次 欢迎任何关于为
  • 如何在Svelte中直接挂载HTMLElement?

    我正在使用一些返回 HTML 元素的外部代码 最好嵌入它 而无需通过 JavaScript 管理加载和所有内容 即appendChild removeChild 现在我正在使用 html element outerHTML 但这似乎不太优雅
  • 如何获取我的应用程序的任务列表及其活动堆栈?

    为了更好地理解活动 任务 每个任务的后台堆栈以及不同的启动模式之间的关系 我想编写一个包含大约 7 个活动的应用程序 在 3 个任务中运行 其中活动以不同的启动模式启动 并且我正在运行 我想显示每个活动的堆栈 并在我浏览应用程序并启动或关闭
  • Python 的 Vim 自动完成

    我正在尝试将自动完成功能合并到Vim http en wikipedia org wiki Vim 28text editor 29 我使用了 Vim 的全能补全功能皮迪克申 http www vim org scripts script
  • 从 R 中的向量创建频率计数[重复]

    这个问题在这里已经有答案了 假设有一个向量 其数值可能有重复值 x lt c 1 2 3 4 5 1 2 2 3 我想创建另一个计数向量 如下所示 它的长度与x 对于每个唯一值x 第一次出现为1 第二次出现为2 以此类推 我想要的新向量是
  • 是否可以使用 bash 在 for 循环中访问多个数组

    我正在尝试编写一个 bash 脚本 让我使用curl 下载多个网页 对于每个网页 我希望能够传递卷曲页面和引用链接 我希望能够同时提供多个网页 换句话说 我希望能够循环浏览我提供脚本的网页 并且对于每个页面 将关联的网页和引用链接传递给cu
  • 在 ECR 中标记多平台图像会创建未标记的清单

    我开始使用 docker buildx 来标记多平台映像并将其推送到 ECR 但是 ECR 似乎将标签应用于父清单 并将每个相关清单保留为未加标签 ECR 似乎确实可以防止删除子清单 但它使管理孤立的未标记图像的清理变得复杂 有没有办法以某
  • Django:重复的键值违反了唯一约束

    我有一个笑话模型 class Joke models Model date created models DateTimeField default datetime now blank True date modified models
  • python 中使用 pop()、list[-1] 和 += 时求值的顺序是什么?

    a 1 2 3 a 1 a pop 这导致 1 6 a 1 2 3 a 0 a pop 这导致 4 2 这两个结果的评估顺序是什么 首先是右侧 然后是左侧 并且在任何一侧 评估顺序都是从左到右 a 1 a pop 与a 1 a 1 a po
  • 各种 MSBuild 版本属性(例如 Version、VersionPrefix 和 VersionSuffix)之间有什么区别?

    使用 MSBuild 15 和 Microsoft NET Sdk 构建项目允许用户指定六个版本属性 它们之间有什么区别以及它们的正确使用方法是什么 Version 版本前缀 版本后缀 汇编版本 文件版本 封装版本 需要明确的是 我所说的
  • 在netbeans中向jpanel添加组件

    在过去的几个小时里 我一直在尝试弄清楚如何向窗口添加标签组件 但没有成功 我在 Netbeans 中创建了一个新的桌面应用程序项目 它附带了预先生成的代码 我想为其添加标签 但它就是不显示 我不确定为什么 因为我遵循正常的 panel ad
  • 如何修复此 ArrayAdapter 要求资源 ID 为 TextView

    我是 android 新手 我正在尝试使用 json 开发带有 gridview 和 listview 的应用程序 通过 json 我在 gridview 中显示了一组图像 并根据 gridview 的位置 我在下一页列表视图中显示结果 这
  • 找不到 com.android.support:support-annotations:26.1.0

    我有一个项目compileSdkVersion and targetSdkVersion是25 当我尝试将版本升级到26时 出现以下错误 Could not find com android support support annotati