English 中文(简体)
安装自动机器人上的 JAR
原标题:Installing JAR on Android

每次我使用 < 坚固> 构建路径 & gt; 配置构建路径 & gt; 添加外部 JAR 的外部 JAR < / 坚固 > 我的Android 应用程序丢出一个例外, 并说 java. lang. noClassDefffoundError...

我做错什么了?

问题回答

步骤 # 1 : 撤消您的“ 配置构建路径” 东西

第2步: 确保您正在使用最新的 SDK 工具以及 Eclipse 的 ADD 插件

步骤 # 3 : 在您的工程根根中创建 libs/ 目录

步骤4:将您的 JAR 复制到 libs/ 目录

您的 JAR 将被自动添加到您的构建路径中, 其内容将被自动添加到您的APK 中 。

这个是给我修的:

  • Remove all Android Library projects and external jars from the build path.
  • Create a folder named libs in your project.
  • Place all external .jars in that folder, the ADT should now place them under Android Dependencies .
  • Re-import all your previous Android Library projects the normal way.

问题是,当使用属性 - Java 构建路径 - 添加外部 Jar 时,外部罐子不会默认地放置在 libs 文件夹中,而是被置于参考图书馆之下, 而不是安卓德依附关系之下, 这导致了 NoClass DefffoundError 。

请 < a href=> "http://tools.android.com/recent/dealing withependendendiesinandroid projects" rel="nofollow" > 检查Android项目中的依赖关系,以了解更多详情





相关问题
In Eclipse, why doesn t "Show In" appear for non-Java files?

If I have a *java file open, I can right click on the source, scroll down to "Show In (Alt-Shift-W)", and select Navigator. If I have an *xml, *jsp, or pretty much anything besides a Java source ...

Eclipse: Hover broken in debug perspective

Since upgrading Eclipse (Galileo build 20090920-1017), hover in debug no longer displays a variable s value. Instead, hover behaves as if I were in normal Java perspective: alt text http://...

Eclipse smart quotes - like in Textmate

Happy Friday — Does anyone know if eclipse has the notion of smart quotes like Textmate. The way it works is to select some words and quote them by simply hitting the " key? I m a newbie here so be ...

Indentation guide for the eclipse editor

Is there a setting or plugin for eclipse that can show indentation guides in the editor? Something like the Codekana plugin for visual studio (not so fancy is also OK). Important that it works with ...

Adding jar from Eclipse plugin runtime tab

I want to add .jar files for plugin from the Runtime tab of manifest file. When I use the Add... button, I can see only sub-directories of the plugin project. So if I want to add same .jar file to ...

How to copy multiple projects into single folder in eclipse

I have two projects, Project1 and Project2. Now i want to copy this projects into eclipse workspace but i want these projects to be in a single folder like below. Eclipse Workspace -> Project -> ...

Java: Finding out what is using all the memory

I have a java application that runs out of memory, but I have no idea which code is allocating the memory. Is there an application with which I can check this? I use Eclipse.

热门标签