fix silly crash when reconnecting for a long time
Gradle fixes for Android Studio 1.0