我知道R.java文件對於android中的很多功能都很重要。所以我瞭解到瞭解決這個問題的方法是在創建新的Android應用程序項目之後清理項目。但經過幾次清理並且您有很多代碼後,R.java文件就會消失,並且您剩下一個錯誤纏身的MainActivity.java
文件!爲什麼經過幾次清理後R.java文件會消失?
我的XML文件中沒有錯誤。這就是爲什麼我很困惑。我的包/項目文件夾中唯一的錯誤是在MainActivity.java
任何想法如何解決這個問題?
我使用Eclipse製作Android應用程序,但更穩定的IDE建議,以創建Android應用程序也將不勝感激!
這裏是我的xml文件:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/Quote"
/>
<EditText
android:id="@+id/Quote"
android:inputType="text"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
<Button
android:id="@+id/go"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/press"
/>
<Button
android:id="@+id/genRan"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/genRan"
/>
</LinearLayout>
R.java在代碼中出現錯誤時消失... – Deepzz
您是否嘗試過重建項目? – juned
我嘗試了多次BUilding和清理。它仍然不會生成 –