APK只能运行在调试模式。 APK开始"运行"在Eclipse中的断点停止 [英] Apk only runs in debug mode. Apk started with "Run" in Eclipse stops on breakpoints

查看:226
本文介绍了APK只能运行在调试模式。 APK开始"运行"在Eclipse中的断点停止的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我注意到,这已经问过,但我还没有找到答案。这个问题的主要告诉故事是,Eclipse的停在破发点的时候APK已经部署的运行

我所做的这些,到目前为止,并没有产生一个运行正常的运行构建项目壳 - >运行方式 - > 1. Android应用程序

•断开,卸载后重新安装APK不能解决问题(这是一种平板设备,而不是一个仿真器。) •使用文件系统
把所有的项目和库项目,写能力 •全新项目正常工作例如他们不断点在运行模式,在相同的Eclipse工作空间问题项目
停止 •窗口 - > preferences - >运行/调试(扩大) - >启动启动在调试模式下,当工作区包含断点设置为从不
•关闭和打开Eclipse的
•从这一角度
调试选项卡下杀死了所有正在运行的进程 •清理整个工作区无论是在Eclipse IDE和手动删除主库项目依赖的资源和根文件夹
•选中单词调试项目中的生成文件
的发生 •清洁内置的命令行项目中使用:蚂蚁干净然后蚂蚁释放

有趣的是,当我清理构建命令行,然后全新安装新的APK,如果Eclipse是开放式的调试器将附加到正在运行的进程,并停在第一个破发点!如果Eclipse正在关闭,程序将等待与标准的等待调试器对话框中的调试器。

所以,事情是在构建过程中损坏(还没有想出什么卷入的所有文件还)和/或一些在.metadata和/或一些depenency。

修改 我发现一个文件:

<$p$p><$c$c>C:\Projects\Mobile\Android\.metadata\.plugins\org.eclipse.debug.core\.launches\MyProjectName.launch

在XML:

 &LT; launchConfiguration TYPE =com.android.ide.eclipse.adt.debug.LaunchConfigType&GT;
 

不知道这是否是一个线索,但如果我删除该文件中的Eclipse将只使用相同的替换它。

修改

*证实,该项目建成,并从另一台机器上运行时正常运行,所以我怀疑,这是我的工作机器的Eclipse工作区是造成这个问题。也许我需要扔掉所有的工作区的元数据并重新开始。

解决方案

更新

使用的IntelliJ代替Eclipse进行Android开发(少得多的IDE接口的bug),然后忽略以下干脆:

两个重要的规则,因为原来的职位,我发现:

1)在等待,直到Eclipse正在完成建立工作区的习惯获取 - 指标显示在Eclipse中的默认的左下角。 WS建立时间可以在大型项目中有多个库需要几分钟时间。不要改变任何东西,直到构建完成。

2)关闭所有的工作区,并重新打开它们的项目之一,在-A-时间开始与没有的库依赖等项目。确保不要打开一个项目,直到你可以验证的工作区已完成建设的是已经打开。打开下一个项目之前修复过程中的任何问题。

祝你好运。

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.

解决方案

Update

Use Intellij instead of Eclipse for Android development (far fewer IDE interface bugs) and then disregard the following altogether:

Two important rules I've found since the original post:

1) Get in the habit of waiting until Eclipse is finished build the workspace - the indicator shows up in the bottom left corner of Eclipse by default. WS build times can take minutes in a large project with multiple libs. Don't change anything until the build is complete.

2) Close all projects in the workspace and reopen them one-at-a-time starting with the project with no lib dependencies and so on. Make sure not to open a project until you can verify the the workspace has finished building what is already open. Fix any issues along the way before opening the next project.

Good luck.

这篇关于APK只能运行在调试模式。 APK开始&QUOT;运行&QUOT;在Eclipse中的断点停止的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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