2008年10月7日 星期二

java.lang.VerifyError in Android

中文版在下面

Android uses different Java Compiler with Sun's, so if you build a project with class file(like a compiled jar library) compiled with Sun's Java Compiler that uses classes/interfaces/fields/methods not supported by Android (Actually dakvik), you'll get java.lang.VerifyError.
To fix this, you must rewrite or delete such codes. Class Index and Pacakge Index in Android page will help. If the library is not source-opened, it's over and you can now find for another.
==
Android用的Java Compiler和一般的Java Compiler不一樣,所以你如果用別人在一般環境下compile好的class檔(jar library之類),而裡面包含了Android(正確來說是dalvik)不支援的class/interface/field/method的話,dalvik就會丟java.lang.VerifyError給你。
解決方法只有一種,就是不使用Android不支援的東西。看你是要改寫或是要刪減功能都可,反正就是所有用到的東西都要在Android的Class Index裡面找的到就對了。

我有一股Java也開始走向各家混亂的fu

沒有留言:

CODE { display: block; /* fixes a strange ie margin bug */ font-family: Courier New; font-size: 8pt; overflow:auto; background: #f0f0f0 url(http://klcintw.images.googlepages.com/Code_BG.gif) left top repeat-y; border: 1px solid #ccc; padding: 10px 10px 10px 21px; max-height:200px; height:200px; // for IE6 line-height: 1.2em; } #quote { display: block; /* fixes a strange ie margin bug */ font-family: Verdana; font-size: 10pt; overflow:auto; background: #f7f7f7 url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKN19b4aT1DHj8GUNi63hQtkKMMZBz85Is4BxJdhPcfrcbaDczl_1lhtztSIirdEAoNLN5F-aDcr7pBSdyFbupvipv2q7vmWWhcqhgsf8nr_nH0jBKyn4YGlBfuiV-BOWA56z7mdE4XXo/s288/quote-l.gif) left top no-repeat; border: 4px dotted #ccc; padding: 15px 15px 15px 31px; /*up right bottom left*/ max-height:300px; line-height: 1.2em; }