eclipse 导入 org.ksoap2.transport.HttpTransportSE 无法解析

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7606963/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 17:05:00  来源:igfitidea点击:

The import org.ksoap2.transport.HttpTransportSE cannot be resolved

androideclipseksoap2android-ksoap2

提问by user972570

I downloaded ksoap2 from this link:

我从这个链接下载了 ksoap2 :

after importing the downloaded .jar file into an Android project in Eclipse, I got import error for only the first import line (HttpTransportSE). I searched but nobody else has had/posted this issue. How could this be? thanks!

将下载的 .jar 文件导入 Eclipse 中的 Android 项目后,我仅在第一个导入行 (HttpTransportSE) 中出现导入错误。我搜索过,但没有其他人有/发布过这个问题。这怎么可能?谢谢!

import org.ksoap2.transport.HttpTransportSE; //ERROR:The import org.ksoap2.transport.HttpTransportSE cannot be resolved
import org.ksoap2.SoapEnvelope;
import org.ksoap2.serialization.SoapObject;
import org.ksoap2.serialization.SoapSerializationEnvelope;   

回答by Jens

You've downloaded the J2ME package, but HttpTransportSE is part of the J2SE jar file.

您已经下载了 J2ME 包,但 HttpTransportSE 是 J2SE jar 文件的一部分。

Shouldn't ksoap2-j2se-full-2.1.2.jarwork just fine with Android?

不应该ksoap2-j2se-full-2.1.2.jar在 Android 上工作得很好吗?

回答by Shark

Use this library its specific for android and it worked for me (Ksoap2-j2se-full didn't work for me as well)

使用这个专门针对 android 的库,它对我有用(Ksoap2-j2se-full 对我也不起作用)

http://code.google.com/p/ksoap2-android/

http://code.google.com/p/ksoap2-android/

回答by MRX

You should use ksoap2-android-assembly-2.6.3-jar-with-dependencies.jarfile. visit http://code.google.com/p/ksoap2-android/wiki/HowToUse?tm=2

您应该使用ksoap2-android-assembly-2.6.3-jar-with-dependencies.jar文件。访问http://code.google.com/p/ksoap2-android/wiki/HowToUse?tm=2

回答by Rishubh Jain

You will Have to add it to Library. (I am using Android Studio)

您将不得不将其添加到库中。(我正在使用 Android Studio)

Right click the library file in the Android Studio(shown under project_name/app/libs/ -> there will an option "Add As Library", select that

右键单击 Android Studio 中的库文件(显示在 project_name/app/libs/ 下 -> 会有一个选项“添加为库”,选择那个

Then A dialogue box will appear where you will have to Select the Module

然后将出现一个对话框,您必须在其中选择模块

Thats IT! :)

就是这样!:)