【问题标题】:Android app launches to white screen on deviceAndroid 应用程序在设备上启动到白屏
【发布时间】:2017-03-28 07:59:01
【问题描述】:

我是 Android 开发新手,我一直在研究类似的主题,但还没有帮助。 我创建了一个应用程序,它在我添加扫描二维码的功能之前正在运行。它可以在模拟器上运行,但是当我在三星设备上运行它时,它会启动到白屏,这就是我的日志所说的:

Launching app
No apk changes detected since last installation, skipping installation of .....
$ adb shell am force-stop com.KtvrBusSerice.KtvrBusService.KtvrBusService
$ adb shell am start -n "com.KtvrBusSerice.KtvrBusService.KtvrBusService/com.KtvrBusSerice.KtvrBusService.KtvrBusService.LoginActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Client not ready yet..Waiting for process to come online
Waiting for process to come online
Waiting for process to come online
Waiting for process to come online
Waiting for process to come online
Waiting for process to come online
Waiting for process to come online
Waiting for process to come online
Waiting for process to come online
Waiting for process to come online
Waiting for process to come online
Waiting for process to come online
Connected to process 22097 on device samsung-sm_g930f-0123456789ABCDEF
D/jdwp: sendBufferedRequest : len=0x79
Application terminated.

【问题讨论】:

  • 您使用的是哪个 android studio 版本?
  • 试试Run>Attach debugger to android process
  • Aditya Vyas-Lakkan 2.2.3 版
  • @Egek92 我试过了,但是确定按钮是灰色的

标签: java android


【解决方案1】:

这是由于冷启动问题。参考https://developer.android.com/topic/performance/launch-time.html
如果您在启动时执行大量初始化,可能会发生这种情况。

【讨论】:

    【解决方案2】:

    将此添加到您的

    中的 AndroidManifest.xml
    <application>
        android:allowBackup="true"
        android:hardwareAccelerated="false"
        android:largeHeap="true"
    </application>
    

    【讨论】:

    • 我将该代码添加到我的清单中,但我现在在我的日志中得到了这个“03:02:43 PM 执行任务:[:app:assembleDebug] 03:03:31 PM Gradle 构建完成在 47 秒 288 毫秒 03:06:44 PM 会话“应用程序”:错误启动活动“
    • 肯定还有其他错误。可以贴一下吗?
    • 尝试卸载应用,然后重新安装应用
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-07-22
    • 1970-01-01
    • 2015-10-28
    • 2016-07-02
    • 2018-09-24
    • 2017-06-30
    相关资源
    最近更新 更多