1. 程式人生 > >eclipse編譯android的apk發生VFY錯誤

eclipse編譯android的apk發生VFY錯誤

1.編譯jni和jar包,生成的my.jar放到專案的libs下,成功編譯apk

2.執行時出現錯誤:
  ...
  01-01 23:03:34.803 W/dalvikvm(24777): VFY: unable to resolve static method 6025: Lcom/...Manager;.startService ()V

  ...

3.反編譯這個apk (unzip, dex2jar, jar),發現這個方法未被編進去


4.對比引用的my.jar,說明這個包是沒有問題的,只是eclipse編譯時這個方法未被編進去 


5.Properties -> Libraries -> Add JARs


6.Properties -> BuildPath -> Order and Export -> Select All


0.Enjoy


參考:
eclipse引用第三方jar包,編譯後發現第三方jar有個方法未被編譯進classes.dex [
http://www.oschina.net/question/587911_88748
]