How to update Gradle dependencies to their latest version

This is all I’ve been able to come up with. I will happily accept another answer if there is a less manual method of doing this. In Android studio I replace every dependency version with a plus example: compile ‘namespace:package1:+’ Sync or build the project which will cause all the dependencies to be resolved to … Read more

Automatic versioning of Android build using git describe with Gradle

Put the following in your build.gradle file for the project. There’s no need to modify the manifest directly: Google provided the necessary hooks into their configuration. def getVersionCode = { -> try { def code = new ByteArrayOutputStream() exec { commandLine ‘git’, ‘tag’, ‘–list’ standardOutput = code } return code.toString().split(“\n”).size() } catch (ignored) { return … Read more

Android Build: Dex Jumbo Mode in Gradle

You can modify your build.gradle file to include: android { dexOptions { jumboMode = true } } Please note that this option is only supported by the now deprecated DX compiler. The D8 compiler does not support this option. From AGP 7.0 (released with Android Studio 2020.3.1 – Arctic Fox) DX support is removed completely.

How to change the Android app package name when assembling with Gradle?

As a simpler alternative to using product flavours as in Ethan’s answer, you can also customise build types. How to choose between the approaches: If you need different package names to be able to have both debug and release apks installed on a device, then use the build type approach below, as Gradle plugin docs … Read more

Where does local.properties go for android project?

The local.properties file goes in the project’s root level, in the same folder as the gradlew, gradlew.bat, settings.gradle and other files. This file should not be included in source control. After (incorrectly) including this in source control, then deleting the file locally, Android Studio re-created the file for me automatically. Here is the example content … Read more

How to build the Android sample projects using Ant? build.xml does not exist

You need to execute this command: android update project –target <your build target> –path <path to LunarLander example> which will create the needed build.xml within the example directory, then the ant debug command should work. Take a look here. *You can use android list targets to choose what build target to use for your project.

How to configure gradle to work “offline” (using cached dependencies)

Gradle does a good job of avoiding re-downloading artifacts, but you can pass –offline to Gradle to prevent from accessing the network during builds. e.g. gradle –offline build If it needs something from the network that it doesn’t have, instead of attempting to fetch it, your build will fail.

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