---
title: "Android SDK更新后 ADT R17 E/AndroidRuntime : java.lang.NoClassDefFoundError问题的解决"
author: "w1985chun"
date: "2012-06-19T11:45:37Z"
tags: []
categories: ["移动开发"]
slug: "android-sdk-adt-r17-e-androidruntime-java-lang-noclassdeffounderror"
draft: false
lastmod: "2012-06-19T11:45:37Z"
id: 1563823
url: "https://w1985chun.iteye.com/blog/1563823"
---

更新了Android SDK 和ADT 到 R17 以后出现了一个问题，就是原来所有引入第三方的jar文件的项目，运行到一旦调用了第三方jar文件里的类的地方，都会出现类似

 **E/AndroidRuntime : java.lang.NoClassDefFoundError** 的错误。

后来看国外的网站才解决问题[http://android.foxykeep.com/dev/how-to-fix-the-classdefnotfounderror-with-adt-17/comment-page-1#comment-4346](http://android.foxykeep.com/dev/how-to-fix-the-classdefnotfounderror-with-adt-17/comment-page-1#comment-4346)

**简单的说一下解决方法：**

- 将所有的第三方jar文件从 standard Java build path中移除 :
  
  - 右键项目名 &gt; Properties &gt; Java Build Path &gt; tab Libraries &gt;将 “Android X.X” and the “Android Dependencies”之外的所有jar文件引用全部去除
- 重命名lib文件夹 为libs
  
  - t一旦这样做了以后，libs库文件夹就能被 Android plugin 添加到  “Android Dependencies” 条目里。
- Clean the project (非必要)
- 一切OK。

**这个问题的原因：**

- This problem is due to the fact that libraries are not managed the same way with the new ADT build.
- Instead of having 2 different managements of libraries (one for Android Library Projects, one for the standard jars), now both are merged into the Android Dependencies item.

原文：http://www.cnblogs.com/changety/articles/Android\_ADT\_SDK\_v17\_AndroidRuntime.html