【问题标题】:Blank App Interface, Unresponsive since switch to Android Studio空白应用界面,切换到 Android Studio 后无响应
【发布时间】:2015-02-12 22:44:44
【问题描述】:

使用 Eclipse 构建时,我的应用运行良好。昨晚,我将我的应用程序切换到了 Android Studio 并真正让它编译和运行。我注意到那天晚上晚些时候重新进入应用程序时,整个应用程序都变成了空白,除了如下所示的状态栏。也许有人可以为此推荐一种补救措施?我没有更改任何核心代码。

这是问题的截图:

这是我的项目的 gradle:

buildscript {
repositories {
    mavenCentral()
}
dependencies {
    classpath 'com.android.tools.build:gradle:1.0.0'
}
}
apply plugin: 'android'

dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
compile 'com.android.support:appcompat-v7:21.0.3'
compile project(':AndroidBootstrap')
compile 'com.google.android.gms:play-services:6.5.87'
compile project(':android-support-v4-preferencefragment-master')
}

android {
compileSdkVersion 21
buildToolsVersion "21.1.1"

sourceSets {
    main {
        manifest.srcFile 'AndroidManifest.xml'
        java.srcDirs = ['src']
        resources.srcDirs = ['src']
        aidl.srcDirs = ['src']
        renderscript.srcDirs = ['src']
        res.srcDirs = ['res']
        assets.srcDirs = ['assets']
    }



    // Move the tests to tests/java, tests/res, etc...
    instrumentTest.setRoot('tests')

    // Move the build types to build-types/<type>
    // For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
    // This moves them out of them default location under src/<type>/... which would
    // conflict with src/ being used by the main source set.
    // Adding new build types or product flavors should be accompanied
    // by a similar customization.
    debug.setRoot('build-types/debug')
    release.setRoot('build-types/release')
}
}

这是一个可能有帮助的 logcat:

12-14 12:28:28.613    8680-8743/com.shamu11.madlibsportablepro D/OpenGLRenderer﹕ Render dirty    regions requested: true
12-14 12:28:28.622    8680-8680/com.shamu11.madlibsportablepro D/Atlas﹕ Validating map...
12-14 12:28:28.710    8680-8743/com.shamu11.madlibsportablepro I/Adreno-EGL﹕  <qeglDrvAPI_eglInitialize:410>: QUALCOMM Build: 10/02/14, c40da3f, Ifda814c646
12-14 12:28:28.711    8680-8743/com.shamu11.madlibsportablepro I/OpenGLRenderer﹕ Initialized EGL,  version 1.4
12-14 12:28:28.725    8680-8743/com.shamu11.madlibsportablepro D/OpenGLRenderer﹕ Enabling debug mode 0
12-14 12:29:29.647    8680-8743/com.shamu11.madlibsportablepro I/Adreno-EGL﹕ <qeglDrvAPI_eglInitialize:410>: QUALCOMM Build: 10/02/14, c40da3f, Ifda814c646
12-14 12:29:29.647    8680-8743/com.shamu11.madlibsportablepro I/OpenGLRenderer﹕ Initialized EGL, version 1.4

【问题讨论】:

  • 如果不知道您的应用做了什么,就不可能猜出问题所在。
  • 应用程序是一个简单的 madlibs 应用程序,要知道的关键是这是我第一次进入应用程序时得到的视图,当应用程序的数据擦除将正确地重新填充我的布局时 @Egor跨度>
  • 可能与您的AndroidManifest.xml 的位置有关。您需要调试代码并添加 Logs 以​​了解正在运行和未运行的内容
  • 好吧,logcat 几乎没有什么帮助,因为它认为应用程序运行正常。我尝试在 eclipse 中运行,并在将应用程序滑开并重新输入时没有遇到这个问题。 @Blundell

标签: android eclipse android-layout gradle android-studio


【解决方案1】:

升级播放服务后出现同样的应用程序无响应问题。 注意到应用程序在创建 google 分析对象时挂起

将播放服务降级到 6.1 解决了问题(正如 shamu11 建议的那样)

【讨论】:

    【解决方案2】:

    所以 Reddit 上的某个人认为这是最新的 Google Play 服务的问题。事实证明他是对的!我降级到 Google play services 6.1 来解决这个问题。希望 Google 注意到这个问题并进行相应的更新。

    【讨论】:

    • 你可以自己用 logcat 语句解决这个问题,软件工程不是魔法
    猜你喜欢
    • 1970-01-01
    • 2021-12-24
    • 2015-02-28
    • 2020-09-13
    • 1970-01-01
    • 1970-01-01
    • 2021-05-08
    • 2021-09-09
    • 1970-01-01
    相关资源
    最近更新 更多