0

Possible Duplicate:
Getting NoClassDefFoundError when using common.lang.StringUtils in android java code?

I'm new in android.

my application crashes on the device with ANdroid 4.1.

    java.lang.NoClassDefFoundError: org.bouncycastle.asn1.x509.X509Name
at android.net.http.DomainNameChecker.matchDns(DomainNameChecker.java:187)
at android.net.http.DomainNameChecker.match(DomainNameChecker.java:62)
at com.android.email.mail.store.TrustManagerFactory$SecureX509TrustManager.checkServerTrusted(TrustManagerFactory.java:82)
at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.verifyCertificateChain(OpenSSLSocketImpl.java:597)
at org.apache.harmony.xnet.provider.jsse.NativeCrypto.SSL_do_handshake(Native Method)
at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:395)
at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl$SSLInputStream.<init>(OpenSSLSocketImpl.java:647)
at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.getInputStream(OpenSSLSocketImpl.java:618)
at com.android.email.mail.store.ImapStore$ImapConnection.open(ImapStore.java:1330)

On devices with andorid less than 4.1 everything is working well. Who can tell me . where is problem?

list of included libraries

Yes. in bottom list of included libraries:
google-http-client-1.6.0-beta.jar
google-http-client-extensions-1.6.0-beta.jar
google-http-client-extensions-android2-1.6.0-beta.jar

Yahoo I did found right solution:

In android 4.1 there is no bouncycastle library. I added it into project and the error disappeared

Community
  • 1
  • 1
idreamussr
  • 69
  • 6

1 Answers1

0

You should try this:

  1. Remove all references to the JAR in your project -> Java Build path --> Libraries.

  2. Create a libs folder at the root of your project Copy the JAR into the libs folder

  3. If still not running OK. Right click your project > Android Tools > Fix Project Properties

Clean your project once and Run .

RajaReddy PolamReddy
  • 22,428
  • 19
  • 115
  • 166