我一直在下面爲Android訓練營的YouTube系列(3的Hello World)儘可能接近的指示,但我所遇到的問題進行了全蛻:Eclipse的ADK:在主要活動和Rec
問題1:AVD Manager
Eclipse將無法識別我的手機(Samsung Galaxy S5)以進行調試/運行應用程序。它完全不在AVD中顯示。
- 我已經下載了我的補償所需的驅動程序與手機
- 我已經啓用了開發者的模式我的手機上
- 我已經啓用調試了USB
- 我已經重新啓動Eclipse和我的電話溝通
- 這款手機是新的,完好無損,運行良好
- 我的電腦識別我的手機和屬性正確的名稱,可以提取文件等
問題2:正在運行的應用
我試圖通過單擊「運行」,簡單地選擇我的手機來規避AVD管理。然而,選舉爲一個運行後,「Android應用程序,」我得到了一個錯誤:
Errors occurred during the build.
Errors running builder 'Android Pre Compiler' on project 'XXX'
我通過經由this thread提出的建議從(Help > Install new Software > http://download.eclipse.org/releases/luna > 'Collaboration' > 'Subversive SVN JDT Ignore Extensions' and 'Subversive SVN Team Provider'
)安裝新的軟件解決了這個錯誤。這使錯誤消失。
不幸的是,雖然錯誤不再出現,但應用程序仍然拒絕運行。現在有誤差:
HelloWorld1 (ERRORS)
src (ERRORS)
com.example.helloworld1 (ERRORS)
HelloWorldActivity.java (ERRORS)
和
rec (ERRORS)
values (ERRORS)
values-v11 (ERRORS)
values-vw820dp (ERRORS)
可悲的是,我不知道什麼時候出現的錯誤,但我知道,他們阻止我跑什麼。
我試圖清理項目,但每次都會失敗,並且不會返回警告或消息。
自創建項目以來,我唯一感受到的文件就是xml片段。我在圖形佈局中單擊並拖動了幾個元素,然後將其刪除。我沒有觸及任何代碼,除了用於在HelloWorldActivity中更改「Hellow World」的字體顏色的十六進制顏色代碼。十六進制顏色代碼是正確的,並且工作得很好。
代碼XML斷枝:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.example.helloworld1.HelloWorldActivity" >
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="102dp"
android:text="@string/hello_world" />
</RelativeLayout>
代碼HelloWorldActivity.java
:
package com.example.helloworld1;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
public class HelloWorldActivity extends ActionBarActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_hello_world);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.hello_world, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
}
我一直在處理什麼,但錯誤4天。我還沒有做任何實際的工作。我在智慧結束。
任何和所有的幫助是深深的,深深的讚賞。
我創建了一個全新的項目和新的之間屬性重新嘗試沒有碰到任何東西運行項目。最後,我的手機出現了,程序完美顯示。然而,我仍然很好奇我做了什麼,應該得到所有這些錯誤。 – SirenKing 2014-10-17 15:24:48
Eclipse有時候可能真的很怪異。打算建議你重新開始一個新的重新安裝,很高興你找到了一個更快的解決方案。 – Floegipoky 2014-10-17 15:28:29