Android Studio: Client not ready yet
Asked Answered
K

7

18

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. 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??

Kazoo answered 30/12, 2015 at 8:46 Comment(4)
You don't have log at all?Artina
What about your phone mode?Holbrooke
Please check the picture.Launch Options is Default Activity i.sstatic.net/HKTO1.png i.sstatic.net/pkhRT.pngInterlining
Thanks so much @Interlining :)Strongbox
C
17

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 -n "com.example/com.example.my.MyActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER

Error:

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)
Counterspy answered 8/2, 2016 at 15:18 Comment(1)
Shit! Now I understand why editing the configuration to start another activity did never work!! Thanks!Stormproof
H
3

[This answer is obsolete for latest versions of Android Studio]

This worked for me :

Tools > Android > Enable ADB Integration

You need to tick Enable ADB Integration

Hyperaemia answered 22/3, 2018 at 3:58 Comment(1)
The Tools > Android menu doesn't exist in Android studio 3.1.2Cordeiro
M
1

If this is a transient issue then in most cases I have found restarting Android Studio fixed the issue.

In one case a Windows restart seemed to fix the problem. A reboot of the device did not.

It was a transient issue which happened just occasionally for a few days but eventually started happening every time and therefore stopped all work.

I was working with two different Android Studio projects open at the same time, both running (different) apps on the same device (but not at the same time).

I may have opened the Device File Explorer on both projects.

Muscle answered 28/6, 2018 at 6:28 Comment(0)
R
0

If the error does NOT come from AndroidManifest (like my situation), you can try this:

  • Tool -> Android -> TURN OFF [Enable ADB Integration]
  • Run -> Run "appname"
  • When you app shows the message "Waiting for debug", select Run -> Attach Debugger to Android process -> Choose the package name of your app under Deive's name.
  • Observe Logcat and trace out where your app crashes.
Rivers answered 3/2, 2018 at 2:28 Comment(0)
C
0

add those lines into your manifest file

        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>

inside your activity tag

Coxa answered 30/10, 2018 at 13:52 Comment(0)
H
0

Check Run/Debug Configurations.

Go to Run/Debug Configurations > Launch Options > Launch and select Default Activity.

I accidentally switched it to Nothing and the application stopped running after installation.

select Default Activity

Huckleberry answered 5/5, 2019 at 8:33 Comment(0)
W
0

Using Android Studio 3.4.1 you might get:

 No apk changes detected since the last installation, skipping installation of /apk/debug/app-debug.apk
$ adb shell am force-stop
$ adb shell am start -n ".StartingScreenActivity" 
-a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Client not ready yet...

The Tools > Android menu doesn't exist in Android studio 3.1.2 +

In the case on -> Run - 'run' app - a device in the bracket show (NULL)

In my case as shown in a picture -> Android 8.0.0, API26 Android (NULL)

Open: Tools -> Conection Asistent and pres Next Tools -> Conection Asistent

You might need to Restart ADB server in Connection Assistant and you should be good to go.

Whatley answered 20/6, 2019 at 16:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.