Exception in thread "Loading Sources" when starting Android SDK Manager

1

I have installed the Android SDK to create an emulator and try an app and there is no way for the Android SDK Manager to show me the available packages to be able to install them. When opened it only shows me the packages that have been installed by default with Android Studio.

The error that appears to me in the terminal when executing the SDK Manager from outside of Android Studio is the following:

(Android SDK Manager:21996): GLib-GObject-CRITICAL **: g_type_add_interface_static: assertion 'g_type_parent (interface_type) == G_TYPE_INTERFACE' failed

(Android SDK Manager:21996): GLib-GObject-CRITICAL **: g_type_add_interface_static: assertion 'g_type_parent (interface_type) == G_TYPE_INTERFACE' failed

Exception in thread "Loading Sources" java.lang.ExceptionInInitializerError
at javax.crypto.JceSecurityManager.<clinit>(java.base@9-Ubuntu/JceSecurityManager.java:65)
at javax.crypto.Cipher.getConfiguredPermission(java.base@9-Ubuntu/Cipher.java:2595)
at javax.crypto.Cipher.getMaxAllowedKeyLength(java.base@9-Ubuntu/Cipher.java:2619)
at sun.security.ssl.CipherSuite$BulkCipher.isUnlimited(java.base@9-Ubuntu/CipherSuite.java:602)
at sun.security.ssl.CipherSuite$BulkCipher.<init>(java.base@9-Ubuntu/CipherSuite.java:574)
at sun.security.ssl.CipherSuite$BulkCipher.<clinit>(java.base@9-Ubuntu/CipherSuite.java:460)
at sun.security.ssl.CipherSuite.<clinit>(java.base@9-Ubuntu/CipherSuite.java:1074)
at sun.security.ssl.SSLContextImpl.getApplicableSupportedCipherSuiteList(java.base@9-Ubuntu/SSLContextImpl.java:353)
at sun.security.ssl.SSLContextImpl.access$100(java.base@9-Ubuntu/SSLContextImpl.java:41)
at sun.security.ssl.SSLContextImpl$AbstractTLSContext.<clinit>(java.base@9-Ubuntu/SSLContextImpl.java:582)
at java.lang.Class.forName0(java.base@9-Ubuntu/Native Method)
at java.lang.Class.forName(java.base@9-Ubuntu/Class.java:291)
at java.security.Provider$Service.getImplClass(java.base@9-Ubuntu/Provider.java:1844)
at java.security.Provider$Service.newInstance(java.base@9-Ubuntu/Provider.java:1820)
at sun.security.jca.GetInstance.getInstance(java.base@9-Ubuntu/GetInstance.java:236)
at sun.security.jca.GetInstance.getInstance(java.base@9-Ubuntu/GetInstance.java:164)
at javax.net.ssl.SSLContext.getInstance(java.base@9-Ubuntu/SSLContext.java:166)
at org.apache.http.conn.ssl.SSLSocketFactory.createSSLContext(SSLSocketFactory.java:202)
at org.apache.http.conn.ssl.SSLSocketFactory.createDefaultSSLContext(SSLSocketFactory.java:209)
at org.apache.http.conn.ssl.SSLSocketFactory.<init>(SSLSocketFactory.java:333)
at org.apache.http.conn.ssl.SSLSocketFactory.getSocketFactory(SSLSocketFactory.java:165)
at org.apache.http.impl.conn.SchemeRegistryFactory.createDefault(SchemeRegistryFactory.java:45)
at org.apache.http.impl.client.AbstractHttpClient.createClientConnectionManager(AbstractHttpClient.java:294)
at org.apache.http.impl.client.AbstractHttpClient.getConnectionManager(AbstractHttpClient.java:445)
at com.android.sdklib.internal.repository.UrlOpener.openWithHttpClient(UrlOpener.java:369)
at com.android.sdklib.internal.repository.UrlOpener.openUrl(UrlOpener.java:188)
at com.android.sdklib.internal.repository.DownloadCache.openUrl(DownloadCache.java:298)
at com.android.sdklib.internal.repository.DownloadCache.downloadAndCache(DownloadCache.java:681)
at com.android.sdklib.internal.repository.DownloadCache.openCachedUrl(DownloadCache.java:603)
at com.android.sdklib.internal.repository.AddonsListFetcher.fetchXmlUrl(AddonsListFetcher.java:272)
at com.android.sdklib.internal.repository.AddonsListFetcher.fetch(AddonsListFetcher.java:137)
at com.android.sdklib.internal.repository.updater.PackageLoader.loadRemoteAddonsListInTask(PackageLoader.java:465)
at com.android.sdklib.internal.repository.updater.PackageLoader.access$200(PackageLoader.java:52)
at com.android.sdklib.internal.repository.updater.PackageLoader$3.run(PackageLoader.java:435)
at com.android.sdkuilib.internal.tasks.ProgressView$2.run(ProgressView.java:140)
at com.android.sdkuilib.internal.tasks.ProgressView.startTask(ProgressView.java:162)
at com.android.sdkuilib.internal.tasks.ProgressViewFactory.start(ProgressViewFactory.java:46)
at com.android.sdklib.internal.repository.updater.PackageLoader.loadRemoteAddonsList(PackageLoader.java:432)
at com.android.sdklib.internal.repository.updater.PackageLoader$1.run(PackageLoader.java:238)
at com.android.sdkuilib.internal.tasks.ProgressView$2.run(ProgressView.java:130)
at java.lang.Thread.run(java.base@9-Ubuntu/Thread.java:843)

Caused by: java.lang.SecurityException: Can not initialize cryptographic mechanism
at javax.crypto.JceSecurity.<clinit>(java.base@9-Ubuntu/JceSecurity.java:91)
... 41 more

Caused by: java.lang.NullPointerException
at sun.nio.fs.UnixPath.normalizeAndCheck(java.base@9-Ubuntu/UnixPath.java:75)
at sun.nio.fs.UnixPath.<init>(java.base@9-Ubuntu/UnixPath.java:69)
at sun.nio.fs.UnixFileSystem.getPath(java.base@9-Ubuntu/UnixFileSystem.java:280)
at java.nio.file.Paths.get(java.base@9-Ubuntu/Paths.java:84)
at javax.crypto.JceSecurity.setupJurisdictionPolicies(java.base@9-Ubuntu/JceSecurity.java:254)
at javax.crypto.JceSecurity.access$000(java.base@9-Ubuntu/JceSecurity.java:49)
at javax.crypto.JceSecurity$1.run(java.base@9-Ubuntu/JceSecurity.java:82)
at javax.crypto.JceSecurity$1.run(java.base@9-Ubuntu/JceSecurity.java:79)
at java.security.AccessController.doPrivileged(java.base@9-Ubuntu/Native Method)
at javax.crypto.JceSecurity.<clinit>(java.base@9-Ubuntu/JceSecurity.java:78)
... 41 more

I have tried to install the SDK both independently and together with Android Studio. I've also tried to activate the Force https: // ... sources to be fetched using http: // ... option in Tools > options but nothing.

The operating system is Ubuntu 16.10 and the java version I use is OpenJDK 9:

openjdk version "9-Ubuntu"
OpenJDK Runtime Environment (build 9-Ubuntu+0-9b134-2ubuntu1)
OpenJDK 64-Bit Server VM (build 9-Ubuntu+0-9b134-2ubuntu1, mixed mode)

EDIT:

This is the log that the SDK Manager shows me. The last URL stays in Fetching and is not complete.

Fetching http://dl.google.com/android/repository/addons_list-2.xml
Fetched Add-ons List successfully
Fetching URL: http://dl.google.com/android/repository/repository-11.xml
Done loading packages.
Fetching http://dl.google.com/android/repository/addons_list-2.xml

I have tried to access the URL from my browser and I can see the XML document without problems.

    
asked by Enrique Carrillo 11.02.2017 в 16:52
source

2 answers

0

Problem solved! The error was causing Java 9. I have seen in several forums people with the same problem and they all had version 9 of Java installed. I tried to uninstall it and go back to Java 8 and problem solved. I can now update and download new packages without problem.

    
answered by 28.05.2017 / 13:05
source
-1

An important detail is that you mention that you have the option

Force https: // ... sources to be fetched using http: // ...

If this does not work, you are probably inside a proxy, check if this is so, I suggest you configure the proxy and specify the necessary credentials.

    
answered by 11.02.2017 в 21:58