I updated to Android Studio 1.0 today from 0.8.14. Most of the update was seamless, the IDE fixed a few things itself. I was using an older version of the gradle build tools, 0.12 and had to change this to 1.0.0. I also upped the buildToolsVersion defined in my inner build.gradle to 21.1.1
One project I'm working on is exhibiting very strange behaviour since I updated. I can push it to a device and it will install and open, but after I kill the app any subsequent attempts to open it don't work. A plain white screen is displayed instead. The app doesn't hit my launch activity, it doesn't instantiate the application. I can't get any information through debugging, nothing is reported from the device. This happens with both debug and release builds, and across the three flavours I've defined. I've tested on multiple phones running Lollipop and Kitkat and on Genymotion VMs.
I've included my build.gradle files below as I feel this must be something to do with the build steps taken to make the apk, but I don't know where to begin fixing this. Any help would be greatly appreciated.
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.0.0'
}
}
allprojects {
repositories {
mavenCentral()
}
}
inner build.gradle
apply plugin: 'com.android.application'
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:support-v4:21.0.2'
compile "com.android.support:appcompat-v7:21.0.2"
compile 'com.google.android.gms:play-services:6.5.87'
compile 'io.keen:keen-client-api-android:2.0.1@aar'
compile 'com.google.code.gson:gson:2.3'
compile(name: 'my-lovely-aar', ext: 'aar')
}
repositories {
flatDir {
dirs 'libs'
}
mavenCentral()
}
android {
compileSdkVersion 21
buildToolsVersion "21.1.1"
productFlavors {
beta {
applicationId 'com.project.beta'
}
prod {
applicationId 'com.project.prod'
}
dev {
applicationId 'com.project.dev'
}
}
defaultConfig {
minSdkVersion 15
targetSdkVersion 21
versionCode 8
versionName "1.1.1"
}
signingConfigs {
release {
// details for release builds
}
}
buildTypes {
release {
signingConfig signingConfigs.release
}
}
lintOptions {
abortOnError false
}
}
I found my problem.
compile 'com.google.android.gms:play-services:6.5.87'
is the guy that broke it. I still don't know the why, but having that dependency stops my app from opening. Including earlier version of the play services lib, like 6.1.11, works perfectly. I don't have 6.1.88/83/74 to test with but I suspect they'd all be fine too.