java - 错误:包 android.support.annotation。不存在
问题描述
我将运行程序,但是出现如下所示的错误
[![在此处输入图像描述][3]][3]
我尝试:实现 'androidx.annotation:annotation:1.0.2'
实施“com.android.support:support-annotations:28.0.0”
但是不行,请给我一个解决方案,谢谢
[3]: https://i.stack.imgur.com/6nQA5.jpg ![在此输入图片描述]( https://i.stack.imgur.com/Z6NvH.jpg )
解决方案
Android 支持库可从 Google 的 Maven 存储库获得。根据文档,要将这些库之一添加到您的构建中,请在您的顶级build.gradle文件中包含 Google 的 Maven 存储库:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
// add related repo
}
dependencies {
// add classpath files here
}
}
allprojects {
repositories {
// add it here ...
google()
}
}
推荐阅读
- python - 如何按一个df的日期时间合并2个数据框只有日期,另一个每小时索引一次
- python - 给定值列表的 Pandas 自定义舍入
- sql - SQL Server:多行到一列并连接
- dictionary - Golang 对相同扩展名的文件进行分组
- python - 获取元素出现在 Python 中每个子列表中的位置
- python - 我的模板中没有看到 Django 个人资料更新表单
- xaml - 带垂直居中子级的 3 行网格
- python - 如何将 2D 边界框像素坐标(x、y、w、h)转换为相对坐标(Yolo 格式)?
- android-studio - 如何手动将 JxBrowser 安装到 intellij/android studio 中进行颤振开发?
- lambda - MS Teams 如何从团队频道获取 MS Teams connectorID 和 webHook ID?