'ionic cordova IO exception while downloading manifest

When I try building my ionic project using ionic cordova build android I get the following error:

IO exception while downloading manifest:
java.io.FileNotFoundException: https://dl.google.com/android/repository/sys-img/android-desktop/sys-img2-1.xml
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1890)
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1492)
        at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:263)
        at com.android.sdklib.repository.legacy.remote.internal.DownloadCache.openUrl(DownloadCache.java:248)
        at com.android.sdklib.repository.legacy.remote.internal.DownloadCache.downloadAndCache(DownloadCache.java:624)
        at com.android.sdklib.repository.legacy.remote.internal.DownloadCache.openCachedUrl(DownloadCache.java:547)
        at com.android.sdklib.repository.legacy.LegacyDownloader.downloadAndStream(LegacyDownloader.java:61)
        at com.android.repository.impl.downloader.LocalFileAwareDownloader.downloadAndStream(LocalFileAwareDownloader.java:51)
        at com.android.repository.impl.manager.RemoteRepoLoaderImpl.lambda$fetchPackages$0(RemoteRepoLoaderImpl.java:139)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)

Still waiting for package manifests to be fetched remotely.

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> Failed to find Build Tools revision 33.0.0-rc2

If I try to access the xml URL from second line above, its showing 404 page. Also, I have build tool 33.0.0-rc2 in my Android dir.

I am getting similar results when i run sdkmanager command in CMD

Warning: java.io.FileNotFoundException: https://dl.google.com/android/repository/sys-img/android-desktop/sys-img2-1.xml
[=======================================] 100% Computing updates...

ionic info

Ionic:

   Ionic CLI                     : 6.19.0 (C:\Users\CGauns\AppData\Roaming\nvm\v16.15.0\node_modules\@ionic\cli)
   Ionic Framework               : @ionic/angular 5.5.2
   @angular-devkit/build-angular : 0.1100.4
   @angular-devkit/schematics    : 10.0.8
   @angular/cli                  : 10.0.8
   @ionic/angular-toolkit        : 3.0.0

Cordova:

   Cordova CLI       : 11.0.0
   Cordova Platforms : android 9.0.0
   Cordova Plugins   : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 5.0.0, (and 35 other plugins)

Utility:

   cordova-res : 0.15.4
   native-run  : 1.5.0

System:

   Android SDK Tools : 26.1.1 (D:\Android\sdk)
   NodeJS            : v16.15.0 (C:\Program Files\nodejs\node.exe)
   npm               : 8.5.5
   OS                : Windows 10

It looks like that file sys-img2-1.xml is removed or something.



Solution 1:[1]

I just fixed this for me by updating Cordova from v10 to v11.

I see you're listing v11 in your question, but maybe there's something to it. Try running which cordova together with your build command to make sure you're utilizing the right cordova version.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Daniel Birowsky Popeski