【发布时间】:2021-10-24 05:46:43
【问题描述】:
我正在尝试在 Android 中添加 Neumorphism 和 DayNightSwitch 依赖项,但每次构建都失败。
我试了很多次都没搞清楚是什么问题。
gradle插件是7.2,Gradle版本是7.0.1
新拟态依赖
dependencies {
implementation 'com.github.fornewid:neumorphism:{latest_version}'
}
DayNightSwitch 依赖
dependencies {
implementation 'com.github.Mahfa:DayNightSwitch:1.4'
}
8: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:mergeDebugNativeLibs'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Could not find com.github.fornewid:neumorphism:0.3.0.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/github/fornewid/neumorphism/0.3.0/neumorphism-0.3.0.pom
- https://repo.maven.apache.org/maven2/com/github/fornewid/neumorphism/0.3.0/neumorphism-0.3.0.pom
Required by:
project :app
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
【问题讨论】:
-
尝试在您的根项目
build.gradle中添加maven { url "https://jitpack.io" },该库不在google maven 存储库或apache maven 存储库中,因此gradle 无法缓存它。 -
请注意,the documentation for that library 中介绍了将 Jitpack 添加到您的存储库。
-
@YaMiN 我在 build.gradle 中添加了
maven { url "https://jitpack.io" }。 -
@Coder_pak 你把它添加到第一个了吗?
-
@Coder_pak 在我的情况下,我添加为依赖项指定一个版本,例如这个实现 'com.github.fornewid:neumorphism:0.3.0' 并且它有效
标签: android android-studio gradle dependencies dependency-management