/ Android

'Installation Blocked' using Android Studio 2.2

Hello, fellow Android devs!

It's been quite a while since I last posted anything on my blog, but I wanted to share how to fix a bug that has been happening to me since I installed Android Studio 2.2 RC.

If you installed the release candidate as I did, you may have come upon this error while using a real device to test apps:

Install blocked

I struggled with this error for a couple of days before I finally couldn't take it anymore and looked for a solution online.

According to this open issue in AOSP bug tracker, it seems to be a bug with the latest version of the Gradle plugin - 2.2.0-rc1.

So, to fix this you just have to go to your project's build.gradle and replace:

buildscript {
    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.0-rcX'
        ...
    }
}

To:

buildscript {
    dependencies {
        classpath 'com.android.tools.build:gradle:2.1.3' // or any previous version
        ...
    }
}

That's all! This is just a temporary fix until that bug is fixed, but I hope it will be useful to those of us who were getting sick of approving the install of our own apps every single time we wanted to test anything.

And thank you, Davis, for reporting that bug on Google Code!