Android Studio 设置强制项目依赖指定版本

Android Studio设置强制项目依赖指定版本

在项目的主 module 的 build.gradle 的 dependencies 节点里添加 configurations.all {} , {} 中的前缀是 resolutionStrategy.force ,后面是指定各module强制依赖的包,例如:

dependencies {
	...
	configurations.all {
		resolutionStrategy.force 'com.google.code.gson:gson:2.9.0' 
	}
}

猜你喜欢

转载自blog.csdn.net/niuzhucedenglu/article/details/124519112