0

I just upgraded Android Studio to 1.0RC4. One of my Android projects used an older buildToolVersion so Android studio suggested that I upgrade to 19.1.0 but while downloading this from Android Studio I get the following errors:

Loading SDK information...
Refresh Sources:
  Failed to fetch URL https://dl-ssl.google.com/android/repository/addons_list-2.xml, reason: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
  Fetched Add-ons List successfully
  Refresh Sources
  Failed to fetch URL https://dl-ssl.google.com/android/repository/repository-10.xml, reason: SSL java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
Refresh Sources:
  Failed to fetch URL https://dl-ssl.google.com/android/repository/repository-10.xml, reason: SSL java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
There is nothing to install or update.

I saw several related questions on google and SO but none related to Android Studio and no solutions worked for me.

Below is more information about my environment

File -> Project Structure
   Android SDK Location: /Applications/Android Studio.app/sdk
   JDK Location: /Library/Java/JavaVirtualMachines/jdk1.7.0_07.jdk/Contents/Home

$ java -version
java version "1.7.0_07"
Java(TM) SE Runtime Environment (build 1.7.0_07-b10)
Java HotSpot(TM) 64-Bit Server VM (build 23.3-b01, mixed mode)

$ /usr/libexec/java_home -V
Matching Java Virtual Machines (4):
    1.8.0_25, x86_64:   "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home
    1.7.0_07, x86_64:   "Java SE 7" /Library/Java/JavaVirtualMachines/jdk1.7.0_07.jdk/Contents/Home
    1.6.0_35-b10-428, x86_64:   "Java SE 6" /Library/Java/JavaVirtualMachines/1.6.0_35-b10-428.jdk/Contents/Home
    1.6.0_35-b10-428, i386: "Java SE 6" /Library/Java/JavaVirtualMachines/1.6.0_35-b10-428.jdk/Contents/Home

/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home

Solutions I've tried:

cd $(/usr/libexec/java_home -v 1.7)/jre/lib/security   
ln -fsh /System/Library/Java/Support/CoreDeploy.bundle/Contents/Home/lib/security/cacerts

After the above I restart Android Studio but the same problem persists.

Anthony
  • 33,838
  • 42
  • 169
  • 278
  • @EJP I saw the answer you've posted in other questions but that solution does not work for me. I've edited the question showing what I've tried. – Anthony Dec 06 '14 at 13:01
  • As my answer in the duplicated question says, the error message simply means that you didn't specify the truststore correctly. There is nothing in your question relating to that. – user207421 Dec 06 '14 at 21:26
  • Duplicate of http://stackoverflow.com/questions/6784463/error-trustanchors-parameter-must-be-non-empty/6788682#6788682 – user207421 Jan 04 '15 at 22:41

1 Answers1

-1

I had the same error and i ended up solving it by doing these steps (on linux) :

You need to find which keystore java is using and import in that the base64 cert of the website you are trying to access to:

for example on ubuntu, all java certificates are in /etc/ssl/certs/java/cacerts with default password being "changeit".

to import the cert i had to use keytool in this way:

keytool -importcert -trustcacerts -alias myalias -file path_to_cert_file -keystore /etc/ssl/certs/java/cacerts

and use changeit as password when asked; i don't know where java keystore (usually named cacerts) is located on OsX. Of course you also need to export https://dl-ssl.google.com cert from a browser.

samu
  • 89
  • 1
  • 6