static String safePackageName(String prop) { prop.replace("-lts", "") } static String safePackageVersion(String prop, String version, String ltsVersion) { prop.contains("-lts") ? ltsVersion + ".LTS" : version } String safeExtGet(String prop, String fallback) { rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback } group 'com.arthenica.flutter.ffmpeg' version '0.2.10' buildscript { repositories { google() jcenter() } dependencies { classpath 'com.android.tools.build:gradle:3.5.3' } } rootProject.allprojects { repositories { google() jcenter() } } apply plugin: 'com.android.library' android { compileSdkVersion 29 defaultConfig { minSdkVersion safeExtGet('flutterFFmpegPackage', 'https').contains("-lts") ? 16 : 24 } lintOptions { disable 'InvalidPackage' } } dependencies { implementation 'com.arthenica:mobile-ffmpeg-' + safePackageName(safeExtGet('flutterFFmpegPackage', 'https')) + ':' + safePackageVersion(safeExtGet('flutterFFmpegPackage', 'https'), '4.3.1', '4.3.1') }