Reputation: 61
Packages to install:
Preparing "Install Android Emulator (revision: 30.5.4)". Downloading https://dl.google.com/android/repository/emulator-windows_x64-7243153.zip An error occurred while preparing SDK package Android Emulator: Tag mismatch!. "Install Android Emulator (revision: 30.5.4)" failed. Failed packages:
I am getting such errors while downloading or updating anything in android studio.
but when I connect with my mobile data it works.
so maybe the problem is with my wifi.
also when I download anything in google chrome it says network failure again and again even if the internet speed is 30mbps.
My internet connection is very good but maybe it's a problem with the firewall or something.
Upvotes: 1
Views: 2796
Reputation: 2403
Long time ago, I struggled with the same thing until I came up with a solution.
I assume your proxy performs SSL Inspection using custom root CA certificate and by doing so, Android Studio and/or JRE does troubles.
First, you need to export that custom certificate to a file: Simply browser to some site (let’s say www.google.com), then download the root certificate to a file. Found some instructions online: https://www.esri.com/arcgis-blog/products/bus-analyst/field-mobility/learn-how-to-download-a-ssl-certificate-for-a-secured-portal/
Second, get Android Studio to trust this certificate by adding it to accepted certificates list in Server Certificate preferences section.
Now configure your proxy in HTTP Proxy preferences section - I believe “Auto-detect proxy settings” is enough.
Finally, and that’s the hard part, get your JRE to trust the certificate. Locate your JDK folder (File -> Project Structure), then install the certificate to the JRE’s key store.
Windows CMD (password is changeit
):
keytool.exe -importcert -alias MY_ALIAS -file PATH_TO_CERT_FILE -keystore PATH_TO_JDK_FOLDER\jre\lib\security\cacert
Mac terminal (password is also changeit
):
sudo keytool -import -alias MY_ALIAS -file PATH_TO_CERT_FILE -keystore PATH_TO_JDK_FOLDER/Contents/Home/jre/lib/security/cacerts
Crossing my fingers that it’ll work :) If not, I’ll delete my answer so please keep me posted.
Upvotes: 4