简体   繁体   中英

Update External Jar in Android Project

All, I have an external JAR that I'm adding to my Android project. However, as my jar is consistently updating and changing. When I update my JAR, I get the dalvik VM magic number error.

I don't understand how I'm supposed to fix this?

Here's the steps I've followed.

Adding The Jar Initially

  1. Copy JAR to libs folder in my project
  2. Run project

My JAR is picked up, installed everyone is happy.

Updating the Jar

  1. In Eclipse, go to the jar in libs and right click -> delete.
  2. Copy my new jar (same name) into the libs folder.
  3. Receive bad class file magic error.

My Troubleshooting So Far

  1. In eclipse, Project -> Clean...
  2. Select my project, clean it.
  3. Run it. Same error... magic number
  4. Project Properties -> Java Build Path -> Remove Android Private Libraries

Now the private libraries aren't being re-added. (Which equates to missing imports in my Java project) Why is this a nightmare? Any suggestions?

Turns out that my issue was caused by the multiple JDK's I had. Android was defaulting to use JDK 1.7 while my console jar was using JDK 1.8

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM