gpt4 book ai didi

android - 如何在 android 项目中导入 jar?

转载 作者:行者123 更新时间:2023-11-29 02:06:00 26 4
gpt4 key购买 nike

我正在使用 Eclipse。我已经按照多个教程在我的 android 项目上设置 ksoap。 ksoap2 jar 文件包含在我的构建路径中。本教程包括以下几行。

    SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
SoapSerializationEnvelope envelope = new SoapSerializaionEnvelope(SoapEnvelope.VER11);
envelope.setOutputSoapObject(request);

SoapObject 带有红色下划线,当我将鼠标悬停在它上面时,系统不会提示我选择导入它。创建类、创建接口(interface)等都是选项。

非常感谢任何帮助。

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

最佳答案

我将 jars 复制到我项目的 libs 文件夹中。如果不存在,请创建 libs 目录。进入 Eclipse 选择您的项目,右键单击/刷新(F5 有效?)。您会在文件面板中看到 lib 文件夹。

一旦 lib 显示在您的项目中,进入项目->属性->java 构建路径 [添加 jars]。您应该会在该文件夹中看到带有 jar 的 lib 文件夹。选择它,你应该会很好。

设置完成后,项目应该可以看到它...尝试使用 clean。

enter image description here

enter image description here

关于android - 如何在 android 项目中导入 jar?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10020740/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com