Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Apk only runs in debug mode. Apk started with "Run" in Eclipse stops on breakpoints

I note that this has been asked before but I haven't found an answer yet. The main tell tale of this problem is that Eclipse stops on break points when the apk has been deployed as "Run"

I've done these so far and none produce a correctly running "Run" build from Project shell -> Run As -> 1. Android Application

• Disconnecting, uninstalling and re installing the apk does not fix the problem (this is a tablet device, not an emulator.) • Made all of the project and library projects write able using the file system
• Brand new projects work correctly e.g. they don't stop on breakpoints in "Run" mode in the same Eclipse workspace as the problem project
• Window -> Preferences -> Run/Debug(expand) -> Launching "Launch in debug mode when workspace contains breakpoints" is set to never
• Closed and opened Eclipse
• Killed all of the running processes under the "Debug" tab in that perspective
• Cleaned the entire workspace both in Eclipse IDE and manually by deleting the res and gen folders of the main and library project dependencies
• Checked for the occurrence of the word "debug" in the project build files
• Clean built the project from the command line using: ant clean then ant release

Interestingly enough, when I clean build from the command line then fresh-install the new apk, if Eclipse is open the debugger will attach to the running process and stop at the first break point! If Eclipse is closed, the program will wait for the debugger with the standard "Waiting for Debugger" dialog.

So something is broken in the build process (haven't figured out what all files are getting involved yet) and/or something in .metadata and/or some depenency.

edit I've found a file at:

C:\Projects\Mobile\Android\.metadata\.plugins\org.eclipse.debug.core\.launches\MyProjectName.launch

in the xml:

<launchConfiguration type="com.android.ide.eclipse.adt.debug.LaunchConfigType">

Don't know if it's a clue, but if I delete the file Eclipse will just replace it with the same.

edit

*Confirmed that the project Runs correctly when built and run from another machine, so I suspect that it's my work machine's Eclipse workspace that's causing this issue. Maybe I need to throw out all of the workspace's metadata and start over.

like image 274
jchristof Avatar asked Jul 28 '11 18:07

jchristof


1 Answers

I encountered same issue. The solution is, restarting your device. Good luck.

like image 197
Göksel Güren Avatar answered Sep 21 '22 04:09

Göksel Güren