1) 在實現從1個activity跳轉到另一個activity時出現如下錯誤:
Description Resource Path Location Type
The method setOnClickListener(View.OnClickListener) in the type View is not applicable for the arguments (HelloworldActivity.MyButtonListener) HelloworldActivity.java /helloworld/src/com/example/helloworld line 19 Java Problem
則說明是導入的android包弄錯了,我們應該把
import android.content.DialogInterface.OnClickListener;改為
import android.view.View;//注意view的大小寫
import android.view.View.OnClickListener;
2) 出現Unfortunately,YourPorjectName has stopped.類似的錯誤,則有可能是在該activity對應的xml文件中,對應某個控件的屬性沒有設置好,導致不能顯示,所以會出現這種錯誤。
3) 如果出現Unparsed aapt error(s)!Check the console for output.則有可能是資源文件命名出現錯誤,比如說命名時出現了空格。我遇到的是圖片的命名中出現了空格就會有該錯誤提 示。
4) android開發中,在導入一個已經存在的項目出現如下錯誤:invalid project description時,則需要把目錄下的.project中的<name>XXXX</name>中的XXX該成和目錄文件夾名一樣, 因為有可能是你把文件夾的名字改了而導致的。
5) 如果出現如下錯誤:Description Resource Path Location Type
The type MainActivity.RealTimeDataListener must implement the inherited abstract method Animation.AnimationListener.onAnimationEnd(Animation) MainActivity.java /dvt1/src/com/example/anim_4 line 113 Java Problem
這有很能是缺少某些重寫函數,比如說在使用AnimationListener時,就有3種情況,雖然我們在應用程序中未必都使用了這3種情況,但是這3種情況的代碼也得必須重寫出來,否則會
編譯通過不了。
6) 如果在elipse中run as出現如下錯誤提示:emulator-5554 disconnected! Cancelling 'com.example.****.SplashActivity activity launch'!,則說明是仿真器沒有連接上,解 決方法是:run as->run configurations->Android Application->Target最后一個選項下面的仿真器前打鈎即可。
7) android導入工程時出現如下錯誤:Android requires compiler compliance level 5.0 or 6.0. Found '1.7' instead. Please use Android Tools > Fix Project Properties.
解決方法是Project Properties -> java Compiler -> Enable project specific settings,然后繼續選擇 Compiler Compliance Leave(多嘗試幾個值) -> OK
8) android中修改工程文件名的方法,需要同時更改src文件夾和gen文件夾,在elciplse工程中右擊這2個文件夾,選擇refactor-->rename即可。
9) 如果新加入的工程出現如下錯誤:R.java was removed! Recreating R.java! 說明是R.java文件沒有生成成功,可以先把工程delete掉(不要從硬盤上delete掉),然后重新導入即可。