After updating to Gradle plugin 3.0.0 beta 4 our build failed with the following message:
buildTypeMatching has been removed. Use buildTypes.<name>.fallbacks
Our libraries have release and debug buildTypes, but our app has two additional buildTypes: 'releaseWithLogs' and 'debugMinified'.
Snippet of our app Gradle file:
android {
// ...
buildTypeMatching 'releaseWithLogs', 'release'
buildTypeMatching 'debugMinified', 'debug'
buildTypes {
debug {
// ...
}
debugMinified {
// ...
}
release {
// ...
}
releaseWithLogs {
// ...
}
}
}
After some investigation, the following announcement has been found: Android Studio 3.0 Beta 4 is now available. There, it mentions:
So, our previous app build.gradle gets converted to:
Notice that, instead of saying that
buildTypereleaseWithLogswill also match withrelease(buildTypeMatching 'releaseWithLogs', 'release'), we specify the match inside thebuildTypeitself. Same fordebugMinifiedmatchingdebug. Also notice that there's no need to include this inreleaseanddebugbuildTypes, as they already match.