Set Different Gradle Configurations

TL;DR: create a global gradle.properties file (in <HOME>/.gradle or GRADLE_USER_HOME if defined). Place there the system specific configuration. The other day I had the unpleasant surprise that Android Studio replicated my proxy settings into gradle.properties and got committed to Git. Including a password (which has since became obsolete). Since my other environment doesn’t use a […]

Fix Gradle Error: UNEXPECTED TOP-LEVEL EXCEPTION

Today I got the lovely UNEXPECTED TOP-LEVEL EXCEPTION from the dexer in android. Looking on the net yielded several causes and resolutions. Note: I’m using Gradle 2.10, Android Studio 2.0.0-beta2 Caching Apparently, sometimes Gradle is shooting itself in the foot with the caching. The first thing you can do is to clean your project. Remove […]

Move Gradle Home

I’m having some space constraints and I need to move as much as possible to a non-backed-up place. Gradle home (the .gradle directory) has 2.23GB on my computer. A lot, so it must go. The procedure is simple. Just create an environment variable named GRADLE_USER_HOME:

Now all your gradle stuff (e.g .caches) will be […]

Gradle(w) and Proxy Authentication

The recent updates in Android Studio eliminate the possibility of passing JVM arguments to gradle. That’s quite unfortunate because I quite liked my solution and now I was getting a (not) nice Connection refused message… So I had to find a different solution. Environment Variable As always, everything related to Java can be configured via […]

Android – More Speed up Building with Gradle

In my previous post I described one thing you can easily do to improve the build speed, namely enabling the gradle daemon. In the meantime, things improved quite a bit: Gradle 2.4 (at the moment of writing) has better speed You can run things in parallel now like other build tools (e.g. make ) You […]

Split a Gradle Build File

TL;DR: If you can, use ext {} with constants (hash). You can do call pointer things too! In the past days I’ve been trying to add some functionality to my Gradle build file so the version would be determined from the git tag. I’ve found this excellent entry showing how to get the actual string. My […]

Android java.lang.VerifyError and Boilerplate code

TL;DR: Change the java version compatibility in your gradle file (see below) or remove Hugo references from your e.g. “debug” code in Velcro. The other day I discovered a bunch of template-based application generators for android. While they are very interesting and apply some of the best practices, they come with a footnote: Use it […]

Gradle and Proxy Authentication in Android Studio

Update: This is obsolete as Android Studio is going to eliminate JVM arguments for gradle. See this post for a more future-proof approach. The other day I did an exercise to install Android Studio (“AS” henceforth) (0.8.4 at the moment of writing) and create a project with gradle in an environment with an authenticated proxy. […]

Scroll to top