Android Studio:客户端尚未准备好 [英] Android Studio: Client not ready yet

查看:1063
本文介绍了Android Studio:客户端尚未准备好的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在启动应用程序时,我收到一条消息客户端尚未准备好。此外,我的设备正在显示等待调试器附加,其次是不幸的是,Android应用程序已停止工作。我已经尝试了所有可能的解决方案在讨论论坛,但没有解决方案在这里应用。我还尝试运行一个简单的HELLO WORLD应用程序,以了解我的应用程序代码是否有一些问题,但同样的消息被显示。我尝试了以下事情:

While launching an app, I am getting a message " Client not ready yet". Also, my device is showing" Waiting for debugger to attach ", followed by "Unfortunately, android app has stopped working". I have tried every possible solution available on discussion forums, but no solution is applying here.I also tried running a simple HELLO WORLD app to know whether there is some issue with my app code, but the same message is been shown. I tried the following things:


  1. 重新安装deice驱动程序

  2. 重新安装android studio

  3. 安装LLDB

  4. 使用不同的设备,不同的电缆和端口

  5. 添加 android.os.Debug。 waitForDebugger(); 到清单文件

  6. 仅将设置更改为MTP

  7. 删除所有断点

  1. Reinstalling the deice drivers
  2. Reinstalling the android studio
  3. Installing LLDB
  4. Using different device, different cable and port
  5. adding android.os.Debug.waitForDebugger(); to the manifest file
  6. Changing setting to MTP only
  7. Removing all breakpoints

但没有任何工作。可能是这个问题的根本原因?

But nothing worked. What could be the root cause of this problem??

推荐答案

该活动必须导出才能从adb访问。如果Activity具有 intent-filter ,则默认情况下导出。否则添加导出的标志:

The activity has to be exported to be accessible from adb. If the Activity has an intent-filter it is exported by default. Otherwise add the exported flag:

<activity
    android:name=".my.MyActivity"
    android:exported="true"/>

这是当活动未导出时运行的错误,您运行

This is the error you get when the activity is not exported and you run

adb shell am start -ncom.example / com.example.my.MyActivity-a android.intent.action.MAIN -c android.intent.category .LUNCHER

错误:

Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.example/.my.MyActiviy } from null (pid=26721, uid=2000) not exported from uid 10304
    at android.os.Parcel.readException(Parcel.java:1620)
    at android.os.Parcel.readException(Parcel.java:1573)
    at android.app.ActivityManagerProxy.startActivityAsUser(ActivityManagerNative.java:2694)
    at com.android.commands.am.Am.runStart(Am.java:875)
    at com.android.commands.am.Am.onRun(Am.java:359)
    at com.android.internal.os.BaseCommand.run(BaseCommand.java:47)
    at com.android.commands.am.Am.main(Am.java:100)
    at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
    at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:251)

这篇关于Android Studio:客户端尚未准备好的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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