当Syns Project with Gradle Files是,系统提示失败,具体提示如下:
Failed to resolve: SwipeDelMenuLayout
Affected Modules:模块1,模块2,...
当Debug项目时系统提示,不能找到项目文件,具体提示如下:
Could not resolve all files for configuration 项目.
> Could not find SwipeDelMenuLayout.aar (com.github.mcxtzhang:SwipeDelMenuLayout:V1.3.0).
Searched in the following locations:
https://jitpack.io/com/github/mcxtzhang/SwipeDelMenuLayout/V1.3.0/SwipeDelMenuLayout-V1.3.0.aar
Possible solution:
- Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html
根据提示信息发现查询连接无法下载该文件:https://jitpack.io/com/github/mcxtzhang/SwipeDelMenuLayout/V1.3.0/SwipeDelMenuLayout-V1.3.0.aar
提示构建失败,具体如下:
切换到版本V1.2.5https://jitpack.io/com/github/mcxtzhang/SwipeDelMenuLayout/V1.2.5/SwipeDelMenuLayout-V1.2.5.aar时自动下载,说明V1.2.5版本异常,无法自动同步下载。
对于该问题解决方式有两种:
1.修改Android studio的Gradle的同步方式为离线,拷贝一份已下载的V1.3.0(该版本可能存在问题不建议使用)到C:/用户/用户名/.Gradle/caches/modules-2/files-2.1文件夹下面,重新构建项目即可;
2.修改项目中引用的SwipeDelMenuLayout版本为V1.2.5即可,在Gradle文件中修改引用文件,
implementation 'com.github.mcxtzhang:SwipeDelMenuLayout:V1.2.5';