Unable to resolve dependency for xxx, Could not resolve project
for to not could unable xxx project resolve
2023-09-27 14:25:58 时间
我们为了在不同的环境使用不同的配置,所以会在gradle中添加buildtypes来区分环境,并且在下面进行不同的配置
我们为了在不同的环境使用不同的配置 所以会在gradle中添加buildtypes来区分环境 并且在下面进行不同的配置 比如
buildTypes { dev{ signingConfig signingConfigs.DevConfig buildConfigField( String , HOST , \ http://120.0.0.1:8000/\ ) debug { signingConfig signingConfigs.DebugConfig buildConfigField( String , HOST , \ http://xxxx.xxx.com/\ ) release { minifyEnabled false signingConfig signingConfigs.ReleaseConfig buildConfigField( String , HOST , \ http://xxxx.xxx.com/\ ) proguardFiles getDefaultProguardFile( proguard-android.txt ), proguard-rules.pro 复制代码
但是当我们新增一个buildtypes的时候 刷新gradle会发现出错
Error:Unable to resolve dependency for xxxx , Could not resolve project :xxxx
这是因为主项目依赖来一个子项目implementation project( :xxx ) 而这个子项目中没有这个buildtypes。
解决方法有几种
gradle降级子项目中添加该buildtypes 内容可以为空添加matchingFallbacks这里前两种都不完美 第三种是最推荐的方法 修改后如下
buildTypes { dev{ signingConfig signingConfigs.MyConfig buildConfigField( String , PROFILE_HOST , \ http://114.215.83.151:10008/\ ) matchingFallbacks [ debug ] debug { signingConfig signingConfigs.MyConfig buildConfigField( String , PROFILE_HOST , \ http://custom.huichongzi.net/\ ) release { minifyEnabled false signingConfig signingConfigs.MyConfig buildConfigField( String , PROFILE_HOST , \ http://custom.huichongzi.net/\ ) proguardFiles getDefaultProguardFile( proguard-android.txt ), proguard-rules.pro }
相关文章
- VSTS unable to load the service index for source 401
- The encoding that Notepad++ just calls “ANSI”, does anyone know what to call it for Ruby?
- “There's no Qt version assigned to this project for platform ” - visual studio plugin for Qt
- 存在隐患 : 3 racks are required for the erasure coding policies: RS-6-3-1024k. The number of racks is on
- Aspose.Words for C++使用教程:从Scratch创建OOXML图表(下)
- Word格式处理控件Aspose.Words for .NET教程——使用DOM插入字段
- BZOJ2051 : A Problem For Fun
- We were unable to authorize you in GitHub. Sorry for inconvenience, please try again later. IDEA2022
- This may cause things to work incorrectly. Make sure to use the same version for both. If you are us
- PostgreSQL Primer for Busy People
- python2 解决TypeError: 'encoding' is an invalid keyword argument for this function
- Guid is not updated for cluster with specified cluster id; need to wait for hosts in this cluster to come up
- 【HTTP】Speed and Mobility: An Approach for HTTP 2.0 to Make Mobile Apps and the Web Faster
- The GuidRepresentation for the reader is CSharpLegacy, which requires the binary sub type to be Uuid
- Python:for循环语句
- 【报错】failed to run custom build command for `openssl-sys v0.9.75` 解决方案
- SwiftUI 问题解决大全之处理 Xcode 中的“Failed to prepare device for development”错误消息
- 使用navicat连接mysql连接错误:Lost connection to Mysql server at 'waiting for initial communication packet'
- protoc-gen-go: unable to determine Go import path for "xxx.proto"
- Qt error ------ no matching function for call to QObject::connect(QSpinBox*&, <unresolved overloaded function type>, QSlider*&, void (QAbstractSlider::*)(int))
- springboot 启动卡住,控制台 Waiting for changelog lock
- devicemapper: usage of loopback devices is strongly discouraged for production use. Use `--storage-opt dm.thinpooldev` to specify a custom block storage device.
- 移动设备上的媒体查询 CSS media queries for mobile device
- MySQL 5.7 Invalid default value for 'CREATE_TIME'报错的解决方法
- 给Elasticsearch 5.2.2 设置用户权限 how to setting security for elasticsearch on windows
- Cannot find a valid baseurl for repo: HDP-3.1-repo-1
- MatrixVT:Efficient Multi-Camera to BEV Transformation for 3D Perception——论文笔记
- 《TridentNet:Scale-Aware Trident Networks for Object Detection》论文笔记
- Vue列表渲染(v-for的使用)
- ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'mysql'