這是我第一次爲android開發。我試圖在eclipse環境中開發,但我遇到了一個問題。沒有生成類R.java。我已經嘗試了所有的功能,如清理或刷新 - >清理,然後重新安裝eclipse。也許問題可以在我的佈局:Eclipse沒有生成R.java
我的佈局:
<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=".MainActivity" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/hello_world" />
</RelativeLayout>
在任何xml文件中是否有任何錯誤? – codeMagic 2013-03-21 18:18:33
有很多原因爲什麼[R無法解決 - Android錯誤](http://stackoverflow.com/questions/885009/r-cannot-be-resolved-android-error)...像導入「android.R'和你的XML中的錯字。 – Sam 2013-03-21 18:19:51
還檢查您的導入,如果它與android.R.java聯繫,則將其從導入中刪除。 – Pragnani 2013-03-21 18:21:45