android 获取build,android-在升级到gradle 3时获取应用程序build....

公良鸿光
2023-12-01

我正在更新一个项目,其中所有项目都有许多不同的特性和风格.我能够解决项目中的所有库,但在更新应用程序build.gradle时遇到问题.下面是错误和gradle的.我显然误解了文档,无法找到正确的解决方案.如何在应用程序build.gradle级别解决此同步问题?

错误

Unable to resolve dependency for ':app@magicDebug/compileClasspath': Could not resolve project :vnfmdata.

Could not resolve project :vnfmdata.

Required by:

project :app

> Project :app declares a dependency from configuration 'implementation' to configuration 'regularDebug' which is not declared in the descriptor for project :vnfmdata.

应用程式build.gradle

android {

...

flavorDimensions flavor.default

productFlavors {

...

magic {

...

flavorDimensions flavor.default

// missingDimensionStrategy flavor.regular, flavor.regular

// matchingFallbacks = [flavor.regular]

dependencies {

...

implementation project(':vnfmdata')

// implementation project(path: ':vnfmdata', configuration: 'regularDebug') // pre gradle 3.0

...

}

}

}

}

___ gradle的同步以下两个库___

vnfmdata build.gradle

android {

...

flavorDimensions flavor.no_meridian, flavor.regular

productFlavors {

regular {

dimension flavor.regular

// Forces regular's flavor to point on LocationService meridian's flavor

// because their flavors' name are different

matchingFallbacks = [flavor.meridian]

}

no_meridian {

dimension flavor.no_meridian

// Will automatically point on LocationService no_meridian's flavor

// because they both have the same name

}

}

buildTypes {

release {}

}

...

}

dependencies {

...

implementation project(':vnlocationservice')

...

}

vnlocationservice build.gradle

android {

...

/** Flavors **/

flavorDimensions flavor.meridian, flavor.no_meridian

productFlavors {

no_meridian {

dimension flavor.no_meridian

}

meridian {

dimension flavor.meridian

dependencies {

implementation project(':third:Sas-Android')

implementation deps.support.compat_v26

implementation deps.play.ads

implementation deps.play.location

implementation deps.localytics

implementation 'com.arubanetworks.meridian:meridian:+@aar'

}

}

}

buildTypes {

release {}

}

...

}

dependencies {

...

}

 类似资料: