How can I overcome the /AndroidRuntime(331): java.lang.NoClassDefFoundError: javax.microedition.io.Connector error in Android?

℡╲_俬逩灬. 提交于 2019-12-13 20:36:06

问题


I am using the ksoap2-android-2.5.2 for SOAP webservices Login like this

HttpTransportBasicAuth aht = new  HttpTransportBasicAuth(URL, username , pass);

When I run the program I get the following exception.

02-08 16:57:27.014: E/AndroidRuntime(331): java.lang.NoClassDefFoundError:
                                                javax.microedition.io.Connector

How can I get that class to our KSOAP2 Library?


回答1:


You are probably not using the correct kSoap package for Android.

See this post: java.lang.NoClassDefFoundError: javax.microedition.io.Connector and the following link




回答2:


This is error can also be raised if you have more than one Activity and if you try to access one Activity without Registering in the AndroidManifest.xml file. So make sure that you have registered all your Activity class under this xml file. eg. if u have an activity called Act you will register as

<application ...............>
   ----------
   ----------
    <activity android:name=".Act2" /> here goes your registration.    
</application>



回答3:


This class is not in android, its in j2me.



来源:https://stackoverflow.com/questions/9376866/how-can-i-overcome-the-androidruntime331-java-lang-noclassdeffounderror-jav

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!