2012年12月11日 星期二

Eclipse無法與htc 連線(htc sync也無法同步)

最近使用HTC Legend開發時,卻一直無法使用同步軟體,雖然將htc的軟體
全部移除後再安裝上去,可以同步,但是eclipse打開後又全部變成斷線
而無法連線,在eclipse上面雖然可以看到htc的裝置,但卻無法將apk安裝
一直出現下面的訊息:
Installation error: INSTALL_FAILED_CONTAINER_ERROR
 Please check logcat output for more details.

Launch canceled!就算在裝置管理員上重新安裝不同的adb驅動程式,也都無法解決問題
後來在網站上找到一個解決方法,暫時可以在eclipse上將程式安裝
只是仍無法用htc sync連線,先暫時可以開發就好~其他的再慢慢處理了…

解決方法:
1、用usb線將手機與電腦連結,而連結的方式設為磁碟機
2、在手機sd卡中找尋 .android_secure的資料夾
3、找到smdl2tmp1.asec檔案,並且將它刪除(或先移到別的地方)
再使用eclipse來安裝程式,應該就可以了 

2012年12月6日 星期四

Eclipse更新後出現錯誤(Incorrect line ending: found carriage return (\r) without corresponding newline (\n))

今天更新後,在xml出現這個錯誤
Incorrect line ending: found carriage return (\r) without corresponding newline (\n)
使用更新前的版本卻沒有出錯,後來找到了解決方法

 原本的寫法
 <LinearLayout    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="@drawable/gradient_white"
    android:orientation="vertical" >

後來改成
 <LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="@drawable/gradient_white"
    android:orientation="vertical" >

這樣子就解決了,推測更新的版本要求每個xml指令,必須換行才能正確執行

另一種方法更有效,Ctrl+Shift+F  按下後,儲存即可