How to access variant.outputFileName in Kotlin

A little simplified version of @david.mihola answer: android { /** * Notes Impl: Use DomainObjectCollection#all */ applicationVariants.all { val variant = this variant.outputs .map { it as com.android.build.gradle.internal.api.BaseVariantOutputImpl } .forEach { output -> val outputFileName = “YourAppName – ${variant.baseName} – ${variant.versionName} ${variant.versionCode}.apk” println(“OutputFileName: $outputFileName”) output.outputFileName = outputFileName } } }

gradlew is not found (No such file or directory)

gradlew script is so-called Gradle wrapper, a self-contained script which allows people to run Gradle tasks without gradle installed. However it doesn’t have to exist to execute Gradle tasks, it’s absolutely optional. You can generate Wrapper in your project by executing the task gradle wrapper Afterward, you can use ./gradlew script instead of gradle from … Read more

What is the difference between registering and creating in Gradle Kotlin DSL

See using the container API: tasks.named(“check”) tasks.register(“myTask1”) tasks.named<JavaCompile>(“compileJava”) tasks.register<Copy>(“myCopy1”) The above sample relies on the configuration avoidance APIs. If you need or want to eagerly configure or register container elements, simply replace named() with getByName() and register() with create(). Difference between creating and registering (or create and register in Gradle versions prior to 5.0) is … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)