Gradle(w) and Proxy Authentication

Posted by in Software

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 an environment variable. if you set GRADLE_OPTS, it’ll get passed to gradlew as JVM arguments. My GRADLE_OPTS looks like this now:

You should need to set up the https variants because downloads are made…read more

Android – More Speed up Building with Gradle

Posted by in Software

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 can use the “configure on demand” feature even though AS complains a bit about it How do you make it work? Here are the steps: Using Gradle 2.4 I’ve enabled gradle 2.4 for my project…read more

Fix CodeIris plugin in Android Studio

Posted by in Software

TL;DR: For the combination of AS 1.2beta and CodeIris 1.13 beta, go to your .AndroidStudioPreview12/config/plugins/CodeIris-Idea/lib and remove your groovy-all jar file. I wanted to get an UML representation of my classes and one plugin I found was CodeIris. Unfortunately, when I tired to install it, I could not get my project to reload. Bummer. Here are the steps I did to fix it: Close AS Go to .AndroidStudio/system/log and clean it up. Is nicer Open AS Open the log file in your .AndroidStudio/system/log directory Go towards the end and identify…read more

Attempted to Finish an Input Event …

Posted by in Software

… but input event receiver has already been disposed. This is the error I got while trying to do something off a menu in Android. Silly really. The message is not too revealing so I ended up scouring the net for an answer and scratching my head afterwards… With a service My problem was trying to launch a service; I figured it out with a single step: Disable the filter in Android Studio (logcat). Then, just before this message, I got another one:

which gave me the real reason:…read more

Android Studio: Change the Cache Location

Posted by in IT

Note: This is an updated article to reflect the stable release of AS. If you are looking for the old one, please see here. Android Studio (AS) creates a local directory .AndroidStudio to cache its own data. In most environments, this is acceptable. However, the size of the directory can easily exceed 300Mb and, if you have a space constraint on your home drive (or a roaming profile in windows), this may be better off in some other place. The location of this directory is placed in an file…read more

Android Studio: Change the Cache Location (AndroidStudioBeta)

Posted by in IT

Android Studio (AS) creates a directory .AndroidStudioBeta (which will likely be .AndroidStudio once it’s launched officially). This happens for each user and looks like a cache directory, where local bits are stored. Unfortunately, the size of mine (after only a couple of projects) is of about 350Mb (1200+ files, almost 200 dirs) and this gets taxed since my home dire gets synced at login/logout with a networked drive. Following the steps described in the “universal” solution, I ended up with: Locate the place where you’ve installed you AS (e.g. C:\Program Files\Android Studio)…read more

Android – Speed up Building with Android Studio and Gradle

Posted by in Software

I’ve noticed that building a small application with gradle is slow (in my case because I’m only starting with Android development and I compile stuff way too often). One of the things I found online was a way to speed up building by using the gradle daemon instead. From daemon’s documentation: […] We came up with several use cases where the daemon is very useful. For some workflows, the user invokes Gradle many times to execute a small number of relatively quick tasks. For example: When using test driven development,…read more

Gradle and Proxy Authentication in Android Studio

Posted by in Software

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. It didn’t work out of the box, of course. Worse, it generated an exception (internal error). I found two solutions to make it work: Via configuration file JVM variables Configuration file When you create a…read more