Flutter App stuck at “Running Gradle task ‘assembleDebug’… “

Here is solution in my case. Open your flutter Project directory. Change directory to android directory in your flutter project directory cd android clean gradle ./gradlew clean Build gradle ./gradlew build or you can combine both commands with just ./gradlew clean build Now run your flutter project. If you use vscode, press F5. First time … Read more

variantOutput.getPackageApplication() is obsolete

variantOutput.getPackageApplication() is being caused by a changed variant API. changing output.outputFile.parent to variant.getPackageApplicationProvider().get().outputs.files[1] is at least a temporary workaround. source: @Selvin. variant.getExternalNativeBuildTasks() is being caused by the io.fabric plugin. the next version of the io.fabric plugin will use variant.getExternalNativeBuildProviders(). source: 116408637; the confirmation for a promised fix (1.28.1). These are caused by com.google.gms.google-services: registerResGeneratingTask is … Read more

How can the gradle plugin repository be changed?

Gradle 3.5 and (presumably) later Gradle 3.5 has a new (incubating) feature, allowing finer control of the plugin dependency resolution, using the pluginManagement DSL: Plugin resolution rules allow you to modify plugin requests made in plugins {} blocks, e.g. changing the requested version or explicitly specifying the implementation artifact coordinates. To add resolution rules, use … Read more

How to set up Kotlin’s byte code version in Gradle project to Java 8?

As Mark pointed out on Debop’s answer, you have to configure both compileKotlin and compileTestKotlin. You can do it without duplication this way: tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all { kotlinOptions { jvmTarget = “1.8” } } For a pure Kotlin project, I don’t think the options sourceCompatibility and targetCompatibility do anything, so you may be able to remove them. … Read more

Extract common methods from Gradle build script

Building on Peter’s answer, this is how I export my methods: Content of helpers/common-methods.gradle: // Define methods as usual def commonMethod1(param) { return true } def commonMethod2(param) { return true } // Export methods by turning them into closures ext { commonMethod1 = this.&commonMethod1 otherNameForMethod2 = this.&commonMethod2 } And this is how I use those … Read more

In Gradle, how do I declare common dependencies in a single place?

You can declare common dependencies in a parent script: ext.libraries = [ // Groovy map literal spring_core: “org.springframework:spring-core:3.1”, junit: “junit:junit:4.10” ] From a child script, you can then use the dependency declarations like so: dependencies { compile libraries.spring_core testCompile libraries.junit } To share dependency declarations with advanced configuration options, you can use DependencyHandler.create: libraries = … Read more