又是個Android SDK的很嚴重的Bug

從8/16發現,一直到現在9月了,才把這個嚴重的Bug給繞過去

搞了一個多月了,終於不用再找其他電腦頂替了

 

2011-08-16 00 58 01.png

 

 

 

怎麼說呢

使用的是Windows版Android SDK r12版(最新)

使用Java版本:已測試JDK 6u23 6u24 6u25 6u26皆有這狀況

只要是在Library裡面有drawable,aapt.exe又是在verbose模式底下

就一定會crash

 

請大家集氣反映給google請他修掉這個Bug~~~~~

 

 

測試方式如下

  1. open an Android project under eclipse and call it 'a'
  2. open the 'a' properties and check the 'Is Library' check box.
  3. open another Android project and name it 'b'.
  4. open it's properties and add 'a' as an android library it uses.
  5. open the android plugin preferences and change the build from silent to verbose
  6. clean both projects.
  7. on linux everything is neat, on windows it crashes after the line:'baseFile zd has flavor (null)' which according to linux should be:'baseFile 0 has flavor ,,,,,,,,,,,hdpi,,,,,,,' most chances null pointer exception occurs here, the question is why only on windows ?

 

1.  eclipse開一個專案叫A
2.  A專案  滑鼠右鍵 >  內容,勾上Is Library
3.  開另一個專案叫B
4.  B專案 滑鼠右鍵 > 內容,引用A專案的函式庫
5.  在eclipse裡, Windows > Preferences > Android > Build

Build output的選項為Verbose

6.   二個專案分別做 Project > Clean

7.  跳出Bug


[2011-09-03 01:41:01 - (專案名稱A)] Refreshing resource folders.
[2011-09-03 01:41:01 - (專案名稱A)] Starting full Pre Compiler.
[2011-09-03 01:41:01 - (專案名稱A)] Removing generated java classes.
[2011-09-03 01:41:01 - (專案名稱A)] Preparing generated java files for update/creation.
(android-sdk路徑)\platform-tools\aapt.exe package -m -v --auto-add-overlay
-J (專案路徑A)\gen -M (專案路徑A)\AndroidManifest.xml -S (專案路徑A)\res
-S (專案路徑B)\res -I (android-sdk路徑)\platforms\android-8\android.jar 
[2011-09-03 01:41:05 - (專案名稱A)] 'aapt' error. Pre Compiler Build aborted.

把系統產生的ㄧ大串指令貼到cmd上得到

(.....前面略)
Including resources from package: (android-sdk路徑)\platforms\android-8\android.jar

applyFileOverlay for drawable
trying overlaySet Key=icon.png
baseFile zd has flavor (null)

 

---------------------------------------------------------------------------------

 

解決方法其實上面就有提到了

我還是補一下圖好了

 

在eclipse裡, Windows > Preferences

2011-09-03 02 15 05.png  

 

 

在 Android > Build這裡,將Build output改為Silent或是Normal即可繞過這個Bug

2011-09-03 02 17 58.png  

---------------------------------------------------------------------------------

 

另外,順道一提

2011-09-03 02 30 27.png  

 

Android SDK r12版目前只能搭配 Java JDK 1.6.0 (6u xx)版唷~

(文章截止Java出到 JDK 1.6.0 (6u27) )

不能直接灌JDK 7喔

因為JDK 7的金鑰計算工具有改

JDK 6版預設使用MD5
JDK 7版預設使用SHA-1

在使用Google Map的時候,算key.store的時候,就會不管怎麼樣都會驗證不過  (哇哈哈~~)

 

 

 

補充:JDK7的使用者需要加上 -v 這個參數,使用MD5數值

keytool -v -list -keystore ~/.android/debug.keystore

就可以用它產生金鑰了, (感謝BB大大提供的方法)

 

 

Google  API 註冊頁面

http://code.google.com/android/maps-api-signup.html

2011-09-03 02 33 43.png  

 

 

 

 

希望大家能感受到Android小綠機器人快樂的體驗

而不會做小綠機器人的噩夢 (對開發者而言啦XD)

 

Google呀Google.   大家都在接連修正你的Bug.....(囧)

 

參考文章

http://stackoverflow.com/questions/6887886/debugging-android-tools-code-under-windows
http://comments.gmane.org/gmane.comp.handhelds.android.devel/146994

arrow
arrow
    全站熱搜

    Johnny 鋼鍊 發表在 痞客邦 留言(1) 人氣()