2008年8月24日 星期日

Android HelloAndroid 出現錯誤 - invalid constant pool index 0000

Google Android SDK - HelloAndroid 出現錯誤 - invalid constant pool index 0000


Android SDK - Beta1

Platform : UBuntu 8.0.4

IDE : Eclipse 3.4 (eclipse-jee-ganymede-linux-gtk)

JDK: 6.x

在安裝跟設定完 ADT  Plug-in之後 ,

根據說明文件在  Eclipse 下產生 HelloAndroid 並執行 ,
 結果出現錯誤訊息
[2008-08-21 22:15:45 - HelloAndroid] invalid constant pool index 0000
...while parsing LocalVariableTable attribute at offset 00000193
...while parsing attributes[1]
...while parsing Code attribute at offset 00000170
...while parsing attributes[0]
...while parsing methods[0]
...while parsing com/android/helloandroid/HelloAndroid.class
...while processing com/android/helloandroid/HelloAndroid.class
[2008-08-21 22:15:45 - HelloAndroid]

去查詢過其他相關討論區說明 , 發現全部都不是正確解答(包含 Android 的討論區)

後 來重新檢視 Android 的文件 , 它出現一行小小的文字: "Android 不支援 GCJ"

嗯 , 剛剛在啟動 Eclipse 3.4 (ganymede) 時有看到說電腦有 GCJ 之類的提示說明

很不幸的 我的Ubuntu上面有安裝 GCJ (有點忘記是 UBuntu 預設安裝 , 還是我自己手賤裝上去的)

原因:
Android SDK 不支援 GCJ

解決方法:
使用Synaptic 套件管理程式 , 搜尋 gcj , 把所有有關 gcj 的套件整個徹底移除之後

重新啟動 Eclipse , 建立 Android Project 去測試 HelloAndroid 整個就是沒有問題 

沒有留言: