resValue gradle error: Unsupported type “String” in “generated.xml”

I solved adding the resources also in the defaultConfig block. For you it would be something like: android { defaultConfig { resValue “string”, “RES_FOO”, “RES FOO RELEASE” } buildTypes { debug{ buildConfigField “String”, “FOO”, “\”FOO DEBUG\”” resValue “string”, “RES_FOO”, “RES FOO DEBUG” } release { buildConfigField “String”, “FOO”, “\”FOO RELEASE\”” resValue “string”, “RES_FOO”, “RES FOO … Read more

How can I add flavors in a module with Android Studio?

In the library module’s build.gradle, you need a couple extra lines to tell it to export the flavors and which build variant to use by default if not specified when being included from another module: android { defaultPublishConfig “productionRelease” publishNonDefault true productFlavors { alpha { } production { } } } That publishNonDefault bit is … Read more

com.android.tools.r8.errors.CompilationError: Program type already present: androidx.annotation.AnimRes

After struggling and struggling and looking for help here and there, I discovered that ./gradlew app:dependencies command was providing important output to solve the error. First of all, the error is Program type already present: androidx.annotation.AnimRes Program type already present means there is a naming conflict, and in this case the androidx.annotation library, which is … Read more

Android Studio 3.0 Beta 1: Failed to resolve: com.android.support:multidex:1.0.2

Apparently my issue is I should post this: maven { url ‘https://maven.google.com’ } in allprojects and not in buildscript (the subtle different has blinded me where the issue is), which then looks like this: allprojects { repositories { maven { url ‘https://maven.google.com’ } } } Thanks to M D for the pointers!

Android Studio update 0.5.3 – platform ‘android-19’ not found

I had the same problem. Deleting ~/.AndroidStudioPreview (on Debian GNU/Linux ‘sid’) fixed the problem. This directory was from an older version of AS (0.3.x). I don’t know what the equivalent of the GNU/Linux ~/.AndroidStudioPreview is on Windows/Mac OS X/… (for Windows it’s under C:\Users\<user>\.AndroidStudioPreview\).

Android Studio update -Error:Could not run build action using Gradle distribution

I had same issue. I have tried many things but nothing worked Until I try following: Close Android Studio Delete any directory matching gradle-[version]-all within C:\Users\<username>\.gradle\wrapper\dists\. If you encounter a “File in use” error (or similar), terminate any running Java executables. Open Android Studio as Administrator. Try to sync project files. If the above does … Read more

Gradle warning: variant.getOutputFile() and variant.setOutputFile() are deprecated

Building on the answer from Larry Schiefer you can change the script to something like this: android { applicationVariants.all { variant -> variant.outputs.each { output -> def outputFile = output.outputFile if (outputFile != null && outputFile.name.endsWith(‘.apk’)) { def fileName = outputFile.name.replace(‘.apk’, “-${versionName}.apk”) output.outputFile = new File(outputFile.parent, fileName) } } } }

Spring Boot 2 – Change Jar Name

archiveFileName is the new hotness. Everything else is deprecated. bootJar { archiveFileName = “${archiveBaseName.get()}.${archiveExtension.get()}” } or the Kotlin DSL equivalent: tasks.getByName<org.springframework.boot.gradle.tasks.bundling.BootJar>(“bootJar”) { this.archiveFileName.set(“${archiveBaseName.get()}.${archiveExtension.get()}”) } See: https://docs.gradle.org/current/dsl/org.gradle.api.tasks.bundling.Jar.html#org.gradle.api.tasks.bundling.Jar:archiveName https://docs.gradle.org/current/userguide/lazy_configuration.html