@@ -2251,7 +2251,7 @@ function coerce(version) {
22512251 if ( match == null )
22522252 return null ;
22532253
2254- return parse ( ( match [ 1 ] || '0' ) + '.' + ( match [ 2 ] || '0' ) + '.' + ( match [ 3 ] || '0' ) ) ;
2254+ return parse ( ( match [ 1 ] || '0' ) + '.' + ( match [ 2 ] || '0' ) + '.' + ( match [ 3 ] || '0' ) ) ;
22552255}
22562256
22572257
@@ -5271,17 +5271,24 @@ module.exports = function($logger, $projectData) {
52715271 appBuildGradleContent += \`
52725272task copyMetadata {
52735273 doFirst {
5274- android.applicationVariants.all { variant ->
5275- def provider = variant.getMergeAssetsProvider()
5276- if (variant.buildType.name == project.selectedBuildType) {
5277- def task = provider.get();
5278- for (File file : task.getOutputs().getFiles()) {
5279- if (!file.getPath().contains("/incremental/")) {
5280- project.ext.mergedAssetsOutputPath = file.getPath()
5274+ // before tns-android 5.2.0 its gradle version didn't have this method implemented, so pri
5275+ android.applicationVariants.all { variant ->
5276+ if (variant.buildType.name == project.selectedBuildType) {
5277+ def task
5278+ if (variant.metaClass.respondsTo(variant, "getMergeAssetsProvider")) {
5279+ def provider = variant.getMergeAssetsProvider()
5280+ task = provider.get();
5281+ } else {
5282+ // fallback for older android gradle plugin versions
5283+ task = variant.getMergeAssets()
5284+ }
5285+ for (File file : task.getOutputs().getFiles()) {
5286+ if (!file.getPath().contains("/incremental/")) {
5287+ project.ext.mergedAssetsOutputPath = file.getPath()
5288+ }
5289+ }
52815290 }
5282- }
52835291 }
5284- }
52855292 }
52865293 doLast {
52875294 copy {
0 commit comments