应用正确运行一次,随后运行打开空白屏幕 [英] App runs correctly once, subsequent runs open blank white screen

查看:65
本文介绍了应用正确运行一次,随后运行打开空白屏幕的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我今天从0.8.14更新到了Android Studio 1.0.大多数更新都是无缝的,IDE本身修复了一些问题.我使用的是Gradle构建工具的旧版本0.12,不得不将其更改为1.0.0.我还将内部build.gradle中定义的buildToolsVersion升级到21.1.1

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

自更新以来,我正在从事的一个项目表现出非常奇怪的行为.我可以将其推送到设备上,然后它将安装并打开,但是在我终止该应用程序后,以后再尝试打开它都将不起作用.而是显示纯白色屏幕.该应用程序没有达到我的启动活动,也没有实例化该应用程序.我无法通过调试获得任何信息,该设备未报告任何信息.这在调试版本和发行版本以及我定义的三种风格中都会发生.我已经在运行Lollipop和Kitkat的多部电话以及Genymotion VM上进行了测试.

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.

我在下面包括了build.gradle文件,因为我认为这与制作apk的构建步骤有关,但是我不知道从哪里开始修复此问题.任何帮助将不胜感激.

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()
    }
}

内部build.gradle

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
    }
}

推荐答案

我发现了我的问题.

compile 'com.google.android.gms:play-services:6.5.87'是破坏它的人.我仍然不知道为什么,但是具有这种依赖性使我的应用程序无法打开.包括6.1.11之类的早期版本的play服务库,效果很好.我没有6.1.88/83/74可以测试,但我怀疑它们也都可以.

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.

这篇关于应用正确运行一次,随后运行打开空白屏幕的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆