問題描述
我剛開始 Android 編程,所以下載了 Eclipse 并開始使用.
I have just started Android programming so downloaded Eclipse and got started.
從這里按照教程創建了我的第一個項目:http://developer.android.com/training/basics/firstapp/creating-project.html#CommandLine
Created my first project following tutorial from here: http://developer.android.com/training/basics/firstapp/creating-project.html#CommandLine
當我在下一課從這里運行該應用程序時:http://developer.android.com/training/basics/firstapp/running-app.html
And when I was on next lesson to run that application from here: http://developer.android.com/training/basics/firstapp/running-app.html
我照他們說的做了.通過 USB 連接我的設備,也啟用了 USB 調試,但是當我在 Eclipse 上單擊運行時,出現上述錯誤.
I did as they said. Connected my device via USB, enabled USB debugging too, but when I clicked Run on eclipse, got the above error.
我做錯了什么?
推薦答案
Eclipse 無法計算出您想要運行的內容,并且由于您之前沒有運行過任何內容,因此它也無法嘗試重新運行.
Eclipse can't work out what you want to run and since you've not run anything before, it can't try re-running that either.
不要單擊綠色的運行"按鈕,而是單擊它旁邊的下拉菜單并選擇運行配置.在 Android 選項卡上,確保將其設置為您的項目.在目標"選項卡中,根據您的設備設置相應的復選框和選項.然后單擊運行.密切注意 Eclipse 中的 Console 選項卡——它會讓你知道發生了什么.設置好運行配置后,下次只需點擊綠色的運行"按鈕即可.
Instead of clicking the green 'run' button, click the dropdown next to it and chose Run Configurations. On the Android tab, make sure it's set to your project. In the Target tab, set the tick box and options as appropriate to target your device. Then click Run. Keep an eye on your Console tab in Eclipse - that'll let you know what's going on. Once you've got your run configuration set, you can just hit the green 'run' button next time.
有時,讓所有內容都與您的設備通信可能會出現問題.考慮使用 AVD(即模擬器)作為替代方案,至少在遇到問題時開始.您可以從 Eclipse 中的菜單 Window -> Android Virtual Device Manager 輕松創建一個.
Sometimes getting everything to talk to your device can be problematic to begin with. Consider using an AVD (i.e. an emulator) as alternative, at least to begin with if you have problems. You can easily create one from the menu Window -> Android Virtual Device Manager within Eclipse.
要查看您的項目在您的設備上安裝和啟動的進度,請檢查控制臺.它是 Eclipse 中的一個面板,帶有標簽 Problems/Javadoc/Declaration/Console/LogCat 等.它可以被最小化 - 檢查右下角的托盤.或者只是使用菜單中的 Window/Show View/Console 使其位于最前面.有兩個控制臺,Android 和 DDMS - 其圖標旁邊有一個下拉菜單,您可以在其中切換.
To view the progress of your project being installed and started on your device, check the console. It's a panel within Eclipse with the tabs Problems/Javadoc/Declaration/Console/LogCat etc. It may be minimised - check the tray in the bottom right. Or just use Window/Show View/Console from the menu to make it come to the front. There are two consoles, Android and DDMS - there is a dropdown by its icon where you can switch.
這篇關于Eclipse 錯誤,“無法啟動選擇,并且最近沒有啟動"的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!