简体   繁体   中英

AndroidHttp Exception NoClassDefFoundError

Well am using eclipse to make an android app which accesses google calendar API am getting a NoClassDefFoundError Exception whenever i tried to execute this method

private void setupCalendarConnection(final String accessToken) throws IOException {

    HttpTransport transport = AndroidHttp.newCompatibleTransport();// Here where the exception 
    GoogleCredential googleCredential = new GoogleCredential().setAccessToken(accessToken);
    JacksonFactory jacksonFactory = new JacksonFactory();

also i tried to replace it with

HttpTransport transport = new NetHttpTransport () ;

and i got the same error

05-07 20:08:04.513: E/AndroidRuntime(781): java.lang.NoClassDefFoundError: com.google.api.client.extensions.android2.AndroidHttp

From my knowledge in Java.. This exception means that the class am trying to access is not defined by classLoader ALTHOUGH i checked the dependencies and JAR files included and it is included and imported

So any clue about how can i solve this problem Thank you in advance..

Eclipse 3.7 Indigo --- Google-java-client-api 1.8----Android ICS(4.0.3) Api lvl 15

Go to your build path in Eclipse via Project >> Properties , then Java Build Path . Under the tab Order and Export , tick the library you are importing.

当我前往Netbeans而不是Eclipse并将我的Jars手动导入libs文件夹中时,问题就解决了……自动添加到Project中,它像火马一样运行。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM