androidionic-frameworkandroid-sdk-manager

Android SDK installed failed: SocketTimeoutException: Read timed out


I have my first basic "Hello World" app written in Node/TypeScript/React/Ionic and I am trying to see if I can get it running as a native Android app. The idea is that I'd like the app to run on my personal (Samsung Galaxy S10, Android v12) phone.

I have installed Android Studio (2021.3.1 Patch 1) and am now trying to make sure that my Android SDK setup meets two criteria:

So, after installing API level 31 I get the following error:

enter image description here

When I look in idea.log I see:

2022-11-28 15:07:23,298 [263621647]   WARN - ectedPackagesStep$CustomLogger - An error occurred while preparing SDK package Intel x86 Atom_64 System Image: Read timed out. 
java.net.SocketTimeoutException: Read timed out
    at java.base/java.net.SocketInputStream.socketRead0(Native Method)
    at java.base/java.net.SocketInputStream.socketRead(SocketInputStream.java:115)
    at java.base/java.net.SocketInputStream.read(SocketInputStream.java:168)
    at java.base/java.net.SocketInputStream.read(SocketInputStream.java:140)
    at java.base/sun.security.ssl.SSLSocketInputRecord.read(SSLSocketInputRecord.java:478)
    at java.base/sun.security.ssl.SSLSocketInputRecord.readFully(SSLSocketInputRecord.java:461)
    at java.base/sun.security.ssl.SSLSocketInputRecord.decodeInputRecord(SSLSocketInputRecord.java:243)
    at java.base/sun.security.ssl.SSLSocketInputRecord.decode(SSLSocketInputRecord.java:181)
    at java.base/sun.security.ssl.SSLTransport.decode(SSLTransport.java:111)
    at java.base/sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1429)
    at java.base/sun.security.ssl.SSLSocketImpl.readApplicationRecord(SSLSocketImpl.java:1396)
    at java.base/sun.security.ssl.SSLSocketImpl$AppInputStream.read(SSLSocketImpl.java:985)
    at java.base/java.io.BufferedInputStream.read1(BufferedInputStream.java:290)
    at java.base/java.io.BufferedInputStream.read(BufferedInputStream.java:351)
    at java.base/sun.net.www.MeteredStream.read(MeteredStream.java:134)
    at java.base/java.io.FilterInputStream.read(FilterInputStream.java:133)
    at java.base/sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(HttpURLConnection.java:3514)
    at java.base/sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(HttpURLConnection.java:3507)
    at com.intellij.util.net.NetUtils.copyStreamContent(NetUtils.java:186)
    at com.android.tools.idea.sdk.StudioDownloader.lambda$doDownloadFully$2(StudioDownloader.java:229)
    at com.intellij.util.io.HttpRequests.doProcess(HttpRequests.java:516)
    at com.intellij.util.io.HttpRequests.process(HttpRequests.java:498)
    at com.intellij.util.io.HttpRequests$RequestBuilderImpl.connect(HttpRequests.java:333)
    at com.android.tools.idea.sdk.StudioDownloader.doDownloadFully(StudioDownloader.java:219)
    at com.android.tools.idea.sdk.StudioDownloader.downloadFullyWithCaching(StudioDownloader.java:154)
    at com.android.repository.impl.installer.BasicInstaller.doPrepare(BasicInstaller.java:74)
    at com.android.repository.impl.installer.AbstractPackageOperation.prepare(AbstractPackageOperation.java:335)
    at com.android.tools.idea.sdk.wizard.InstallTask.preparePackages(InstallTask.java:269)
    at com.android.tools.idea.sdk.wizard.InstallTask.run(InstallTask.java:132)
    at com.intellij.openapi.progress.impl.CoreProgressManager.startTask(CoreProgressManager.java:436)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.startTask(ProgressManagerImpl.java:120)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressAsync$5(CoreProgressManager.java:496)
    at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$3(ProgressRunner.java:244)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:188)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$12(CoreProgressManager.java:624)
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:698)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:646)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:623)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:66)
    at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:175)
    at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4(ProgressRunner.java:244)
    at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1700)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:668)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:665)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:665)
    at java.base/java.lang.Thread.run(Thread.java:829)
2022-11-28 15:07:23,305 [263621654]   INFO - ectedPackagesStep$CustomLogger - "Install Intel x86 Atom_64 System Image (revision: 4)" failed. 

What went wrong and whats the fix?


Solution

  • Your minSdkVersion should be Android 12 (API level 31) or less than 31 if you want to support older devices. so you should choose Android 12 (API level 31) check box.

    Also if you want to upload your app to Google Play your targetSdkVersion should be Android 12 (API level 31) or higher. so you should choose also the SDK you want to target.

    Starting in November 2022, app updates must target API level 31 or above

    The min sdk version is the earliest release of the Android SDK that your application can run on. Usually this is because of a problem with the earlier APIs, lacking functionality, or some other behavioural issue.

    The target sdk version is the version your application was targeted to run on.