從 .net 跳到 java 真不習慣 @@

光是編輯器就十分的難用~才沒多久就遇到一堆問題

 

問題1 : error : R.layout.main cannot be resolved

解決方式 : 刪除自動產生的 import android.R;

http://job.achi.idv.tw/2009/11/27/android-2-0%E6%87%89%E7%94%A8%E7%A8%8B%E5%BC%8F%E6%9E%B6%E6%A7%8B/

裡面有說這段

以前自然生成的R.java會跟src的irdc.ex03_01同一個目錄,現在的2.0 generator會另外產生gen的資料夾,然後在一樣的package的資料夾結構,但是這樣的改變,android在一些自動產生的程式部份,像是自動產生的import android.R;這一行,會造成R.layout.main產生R.layout.main cannot be resolved的錯誤,只有手動移除這一行才會正確。

 

問題2 : 亂改有的沒的然後 run 程式時發生 "could not find xxxxxxxx.apk"

解決方式 : 

http://mjz-memo.blogspot.com/2009/03/could-not-find-apk.html

裡面說...點選 project 右鍵,在 build path->configure build path,點選 Order and Export(在此設定classpth順序),將 Android Library 打勾即可正常執行。

 

見鬼了...我從來沒改過那個也會出事

 

 

問題3 : 出現 Error generating final archive: Debug certificate expired

很莫名奇妙的出現憑證過期,原來eclipse裡用android ADT只能用一年....到底是為什麼 @@

所以我今年五月就到期了,好久沒玩有夠混....

解決方式 :

http://androidstudy.blogspot.com/2011/09/android-eclipse-error-generating-final.html

1.刪除電腦裡"C:\Documents and Settings\user\.android" 的 debug.keystore

2.建立新專案,讓他產生新的 debug.keystore

 

 

問題4 : 在AVD Manager 裡面新增時發生  "Unable to find a 'userdata.img' file for ABI armeabi to copy into the AVD folder."

 

解決方法 :  http://tech.thecoolblogs.com/2012/01/unable-to-find-userdataimg-file-for-abi.html

原來發生原因是這樣 : 

 

This error is happening because the location of userdata.img file has changed since Android 4 (API Level 14). So we need to reinstall the ARM EABI package. 

Reference: http://tech.thecoolblogs.com/2012/01/unable-to-find-userdataimg-file-for-abi.html#ixzz2CIsgLLhk

 

問題 5 : 解决android.os.NetworkOnMainThreadExceptio

在4.0之後在主線程裡面執行Http請求都會報這個錯

解決辦法有兩個思路,分別是:

第一種方法:直接忽視,強制使用(強烈不推薦,但是修改簡單)

第二種方法:使用Thread、Runnable、Handler (推薦使用)

解法看這

http://my.eoe.cn/iceskysl/archive/4382.html

 

網路上有好多教學資料 :

 

androidbmi

http://code.google.com/p/androidbmi/wiki/IntroAndroid (佛心來的這網站)

Android 程式設計與開發教學筆記

http://blog.chinatimes.com/tomsun/archive/2007/10/23/209954.html

http://www.hksilicon.com/kb/articles/3701/Google-Android

 

先紀錄一下以後慢慢看

arrow
arrow
    全站熱搜

    小雕 發表在 痞客邦 留言(0) 人氣()