Eclipse (Android):单击“运行”/“调试”时什么也没有发生
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/15021129/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Eclipse (Android): When clicking 'Run'/'Debug' nothing happens
提问by Popokoko
I have just installed (extracted) properly the ADT bundle for eclipse + android SDK and also set a new AVD which is currently working on my background and looks fine.
我刚刚为 eclipse + android SDK 正确安装(提取)了 ADT 包,并设置了一个新的 AVD,它目前正在我的背景上工作并且看起来不错。
my problem is: once i create any app and click the 'Run'or 'Debug'button, nothing happens. I don't see any 'launching : (nn%) ..' message at the bottom and the AVD is not effected at all - nothing happens! I have no idea what is the problem but a while ago i installed this exactly same way and had seen this issue before. could anyone please advice me what to do?
我的问题是:一旦我创建了任何应用程序并单击“运行”或“调试”按钮,就没有任何反应。我在底部没有看到任何“正在启动:(nn%) ..”消息,AVD 根本没有受到影响 - 没有任何反应!我不知道是什么问题,但不久前我以完全相同的方式安装了这个问题,并且以前见过这个问题。任何人都可以请教我该怎么做?
回答by Kapil Vats
right click you project->run as -> run configuration, check whether launce default activity is selected, and in target tab check "always prompt to pick device"
右键单击您的项目-> 运行方式-> 运行配置,检查是否选择了 launce 默认活动,并在目标选项卡中选中“始终提示选择设备”
回答by Triang3l
If the button works fine for the first time and doesn't work later, try this.
如果该按钮第一次工作正常并且稍后不起作用,请尝试此操作。
Open Devices view using Window > Show View > Devices
.
使用打开设备视图Window > Show View > Devices
。
Then, in Devices, under your emulator, find your application package name. Select it and press the red "STOP" button.
然后,在 Devices 中,在您的模拟器下,找到您的应用程序包名称。选择它并按下红色的“停止”按钮。
After this, the application should run properly.
在此之后,应用程序应该可以正常运行。
回答by Sunil Kumar
In the editor MainActivity.java file should be open/in focus.Then run your app. It should work fine. Problem occurs when some other xml file is in focus in the editor eg.styles.xml etc.
在编辑器中 MainActivity.java 文件应该是打开的/焦点。然后运行你的应用程序。它应该可以正常工作。当编辑器中的某个其他 xml 文件处于焦点时会出现问题,例如.styles.xml 等。
回答by rafmav
The problem is with the phone: you have to activate the developper abilities of the phone.
问题出在手机上:你必须激活手机的开发者能力。
On the phone with Jelly Bean (4.2) and newer versions of Android: Go to "Settings" --> "About Phone" --> tap “Build Number” until you get a popup that you have become a developer (5 or 7 times, count down will decrease ). Then go to "Settings" --> "Developer" --> "USB debugging" and enable it.
在装有 Jelly Bean (4.2) 和更新版本 Android 的手机上:转到“设置”-->“关于手机”--> 点击“内部版本号”,直到出现一个弹出窗口,表明您已成为开发人员(5 或 7次,倒计时会减少)。然后进入“设置”-->“开发者”-->“USB调试”并启用它。
Elder versions of Android on your phone: This is usually done from "Settings" --> "Applications" --> "Development" --> "USB debugging" and enable it.
您手机上的旧版 Android:这通常是通过“设置”-->“应用程序”-->“开发”-->“USB 调试”并启用它来完成的。
That's it !
就是这样 !
Perhaps you will have to reboot the phone (not sure about this).
也许您将不得不重新启动手机(对此不确定)。
Then, retry "adb devices" on your computer console: your phone is on the list, and ready to use with android studio or else !
然后,在您的计算机控制台上重试“adb devices”:您的手机在列表中,并准备好与 android studio 一起使用,否则!
Good luck now !
现在祝你好运!
Reference : https://wiki.archlinux.org/index.php/Androidhere: Connect device
参考:https: //wiki.archlinux.org/index.php/Android这里:连接设备
回答by allen kusiluka
Make sure the connected device is responding or if you are using emulator then make sure it's well configured, I had this problem, I changed the usb cable and it worked.
确保连接的设备有响应,或者如果您使用的是模拟器,然后确保它配置良好,我遇到了这个问题,我更换了 USB 电缆并且它工作正常。
回答by anzaidemirzoi
click the down arrow next to run button go to run configurations. select target on the tab menu and check always prompt to pick device is selected
单击运行按钮旁边的向下箭头转到运行配置。在选项卡菜单上选择目标并选中始终提示选择设备