简体   繁体   中英

Debugger is no longer active in Android Studio

I am using Android Studio to build and run a simple application. My problem is that i can't run the project on the emulator although there are no errors except these weird ones:

11-15 17:12:25.250 704-772/system_process I/art: Explicit concurrent mark sweep GC freed 73473(4MB) AllocSpace objects, 28(834KB) LOS objects, 33% free, 9MB/14MB, paused 1.578ms total 87.751ms
11-15 17:12:25.250 704-719/system_process I/art: WaitForGcToComplete blocked for 104.615ms for cause Background
11-15 17:12:25.283 2403-2403/? D/AndroidRuntime: Shutting down VM
11-15 17:12:25.292 2403-2408/? I/art: Debugger is no longer active
11-15 17:12:27.776 704-797/system_process E/WifiStateMachine: CMD_START_SCAN : connected mode and no configuration
11-15 17:12:47.778 704-797/system_process E/WifiStateMachine: CMD_START_SCAN : connected mode and no configuration
11-15 17:13:07.776 704-797/system_process E/WifiStateMachine: CMD_START_SCAN : connected mode and no configuration
11-15 17:13:30.131 704-797/system_process E/WifiStateMachine: CMD_START_SCAN : connected mode and no configuration
11-15 17:13:47.779 704-797/system_process E/WifiStateMachine: CMD_START_SCAN : connected mode and no configuration
11-15 17:13:53.387 82-82/? D/Genyd: Received Set Clipboard
11-15 17:13:53.387 82-82/? D/Genymotion: Received Set Clipboard

I have tried to run another project of mine and it worked perfectly (The problem is related to this specific project). Also, i have tried to kill the adb process and close and reopen this project but the problem persisted.

How to solve this problem?

After spending hours searching to solve this problem, I found that the problem is related to my AndroidManifest.xml , and this is how I found the solution:

Let's have a see at this message in the logcat connected mode and no configuration . Here I have thought about something missed in my project configuration, so I have checked it 在此处输入图片说明 Here is the key to finding the solution Run Configuration Error: Default Activity not found . So I have known that the debuger didn't know what is the default activity (the main activity). And now I have checked my AndroidManifest XML file and I have found an important part missing which is the part to tell the debuger which activity is the enter point of my app

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

After updating the AndroidManifest file, everything goes well now, but I still can't understand why Android Studio 1.4 didn't generate it for me automatically.

Hope I have helped.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM