NoSuchAlgorithmException: KeyStore JKS implementation not found

8,670 views
Skip to first unread message

Ofey85

unread,
Oct 29, 2013, 7:04:42 AM10/29/13
to rob...@googlegroups.com
Hi!

I'm trying to add my google appengine cloud endpoints to my libgdx game, but I get NoSuchAlgorithmException. I am using the same endpoint jars in the ios version as in the desktop version if it matters.

Here is the stacktrace:

java.security.KeyStoreException: java.security.NoSuchAlgorithmException: KeyStore JKS implementation not found
    at java.security.KeyStore.getInstance(KeyStore.java)
    at com.google.api.client.util.SecurityUtils.getJavaKeyStore(SecurityUtils.java)
    at com.google.api.client.googleapis.GoogleUtils.getCertificateTrustStore(GoogleUtils.java)
    at com.google.api.client.googleapis.javanet.GoogleNetHttpTransport.newTrustedTransport(GoogleNetHttpTransport.java)
    at fi.bugybte.luftwooffen.RobovmLauncher$11.call(RobovmLauncher.java)
    at fi.bugybte.luftwooffen.RobovmLauncher$11.call(RobovmLauncher.java)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java)
    at java.util.concurrent.FutureTask.run(FutureTask.java)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java)
    at java.lang.Thread.run(Thread.java)
Caused by: java.security.NoSuchAlgorithmException: KeyStore JKS implementation not found
    at org.apache.harmony.security.fortress.Engine.notFound(Engine.java)
    at org.apache.harmony.security.fortress.Engine.getInstance(Engine.java)
    ... 11 more

I have included the following in the robovm.xml file:

<forceLinkClasses>
    <pattern>com.badlogic.gdx.scenes.scene2d.ui.*</pattern>
    <pattern>com.android.org.bouncycastle.**</pattern>   
    <pattern>org.apache.harmony.xnet.provider.jsse.**</pattern>    
     <pattern>org.apache.harmony.security.**</pattern>   
  </forceLinkClasses>

Any ideas to what to include next?

Niklas Therning

unread,
Oct 29, 2013, 12:29:13 PM10/29/13
to Ofey85, rob...@googlegroups.com
The JKS KeyStore provider is not supported on Android and thus not on RoboVM either. You will have to use the BouncyCastle BKS provider and format instead. Please see http://stackoverflow.com/questions/9312193/does-android-support-jks-keystore-type.


--
You received this message because you are subscribed to the Google Groups "RoboVM" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robovm+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ofey85

unread,
Oct 30, 2013, 5:07:41 AM10/30/13
to rob...@googlegroups.com
Ok, I tried using the AndroidHttp as the Http transport instead of the GoogleNetHttpTransport, but I got this problem:

Caused by: java.lang.NoClassDefFoundError: android/os/Build$VERSION
    at com.google.api.client.extensions.android.AndroidUtils.isMinimumSdkLevel(AndroidUtils.java)
    at com.google.api.client.extensions.android.http.AndroidHttp.newCompatibleTransport(AndroidHttp.java)

    at fi.bugybte.luftwooffen.RobovmLauncher$11.call(RobovmLauncher.java)
    at fi.bugybte.luftwooffen.RobovmLauncher$11.call(RobovmLauncher.java)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java)
    at java.util.concurrent.FutureTask.run(FutureTask.java)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java)
    at java.lang.Thread.run(Thread.java)

Is this fixable?

The google appengine can also generate cloud endpoint libraries for iOS, so I could use them instead. But then I guess I would have to bind those to be able to use them in java, which seems like a huge hassle. Any advice ?

Niklas Therning

unread,
Oct 30, 2013, 5:56:00 AM10/30/13
to Ofey85, rob...@googlegroups.com
Is your code calling newCompatibleTransport() directly? If so just replace that call with

  new com.google.api.client.http.javanet.NetHttpTransport()

If not called directly try to add this class to your project:

package android.os;

public class Build {
  public static class VERSION {
    public static final int SDK_INT = 15;
  }
}

Let me know if it works.


--

Ofey85

unread,
Oct 30, 2013, 7:46:19 AM10/30/13
to rob...@googlegroups.com, Ofey85
Sweet calling new com.google.api.client.http.javanet.NetHttpTransport() works beautifully!

I just had to force link the following classes:
<pattern>java.util.logging.ConsoleHandler</pattern>
<pattern>java.util.logging.SimpleFormatter</pattern>

Big thanks Niklas!
Reply all
Reply to author
Forward
0 new messages