HTTP_TRANSPORT = GoogleNetHttpTransport.newTrustedTransport();
导致“未找到KeyStore JKS实现”:
W/System.err(20142): java.security.KeyStoreException: java.security.NoSuchAlgorithmException: KeyStore JKS implementation not found
W/System.err(20142): at java.security.KeyStore.getInstance(KeyStore.java:119)
W/System.err(20142): at com.google.api.client.util.SecurityUtils.getJavaKeyStore(SecurityUtils.java:48)
W/System.err(20142): at com.google.api.client.googleapis.GoogleUtils.getCertificateTrustStore(GoogleUtils.java:74)
W/System.err(20142): at com.google.api.client.googleapis.javanet.GoogleNetHttpTransport.newTrustedTransport(GoogleNetHttpTransport.java:55)
当我读到Android不支持JKS时,我应该如何修改此方法来解决它?
答案 0 :(得分:10)
代替
HTTP_TRANSPORT = GoogleNetHttpTransport.newTrustedTransport();
带
HTTP_TRANSPORT = AndroidHttp.newCompatibleTransport();
问题消失了。
答案 1 :(得分:2)
替换
HTTP_TRANSPORT = GoogleNetHttpTransport.newTrustedTransport();
与
HTTP_TRANSPORT = new com.google.api.client.http.javanet.NetHttpTransport()
但不知道,它是如何运作的。