【发布时间】: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