赞
踩
最近想给女朋友写一个记录大姨妈的软件,查资料发现自带的calendarview有很大的局限性,所以用了一个github上的一个项目。
implementation("com.haibin:calendarview:3.7.1")
在implementation后,总会报错
Caused by: org.gradle.internal.resolve.ModuleVersionNotFoundException: Could not find com.haibin:calendarview:3.7.1.
后来查阅了大量的资料后,发现换源可以解决这个问题。并且从 Android Studio Dolphin 2021.3.1 之后,国内源的切换配置就从 build.gradle 文件改到了 settings.gradle 文件,maven也改了格式。
maven { url 'https://' }
改为
maven(url = "https://")
settings.gradle.kts
pluginManagement { repositories { gradlePluginPortal() google() mavenCentral() } } dependencyResolutionManagement { repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) repositories { google() mavenCentral() } } rootProject.name = "project" include(":app")
改为
pluginManagement { repositories { maven(url = "https://plugins.gradle.org/m2/") maven(url = "https://maven.aliyun.com/nexus/content/repositories/google") maven(url = "https://maven.aliyun.com/nexus/content/groups/public") maven(url = "https://maven.aliyun.com/nexus/content/repositories/jcenter") gradlePluginPortal() google() mavenCentral() } } dependencyResolutionManagement { repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) repositories { maven(url = "https://plugins.gradle.org/m2/") maven(url = "https://maven.aliyun.com/nexus/content/repositories/google") maven(url = "https://maven.aliyun.com/nexus/content/groups/public") maven(url = "https://maven.aliyun.com/nexus/content/repositories/jcenter") google() mavenCentral() } } rootProject.name = "project" include(":app")
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。