2012-11-25 64 views
-1

我安裝了Android SDK 21 bundle Windows x64,並且如果我嘗試向初始項目創建代碼添加任何代碼,則只會發生錯誤。我嘗試通過Hello World運行,並且每個條目都出現錯誤。順便說一句:我是Android和Linux的新手,但我做了很多Windows編程。謝謝...Android sdk 21庫錯誤

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout 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:orientation="horizontal"> 
<EditText android:id="@+id/edit_message" 
    android:layout_weight="1" 
    android:layout_width="0dp" 
    android:layout_height="wrap_content" 
    android:hint="@string/edit_message" /> 
<Button 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:text="@string/button_send" /> 
</LinearLayout> 

編輯:刪除冗餘。

+2

在這裏發佈你得到的錯誤。 –

+0

描述\t資源\t路徑\t位置\t類型 錯誤:錯誤:找不到與給定名稱匹配的資源('提示'值'@ string/edit_message')。 \t activity_hello_world.xml \t/HelloWorld/res/layout \t line 7 \t Android AAPT問題 – user1850999

+0

您的res/values/strings.xml文件是否包含名爲edit_message的字符串? –

回答

0

Try: 1)重新加載Eclipse 2)運行Project Clean。

2

您最後的Button(button_send)沒有任何父級視圖。

你應該把它放到像LinearLayout或其他的視圖。