Android SDK manager fails with this message:
Downloading SDK Platform Android 8.1.0, API 27, revision 1 Download finished with wrong size. Expected
I had the exact same issue. A clear cache (tools->options..->Clear cache) and restart of sdk manager solved it.
Had this same issue three weeks ago. Tried again last week. SDK 8.1 installed properly with Android SDK Manager. Google apparently included an incorrect checksum that has been subsequently corrected. Try the download again, it should work.
Leo Li's instructions worked for me, too. Thanks for the info!
When download fails, you can notice a temp folder for this path:
"C:\Program Files (x86)\Android\android-sdk\temp". There should be a file called platform-27_r01.zip. Copy it out and extract the android-8.1.0 folder.
The next step, rename it to android-27. Then, copy it to the path.
"C:\Program Files (x86)\Android\android-sdk\platforms"
When download fails, you can notice a temp folder for this path:"C:\Program Files (x86)\Android\android-sdk\temp". There should be a file called "platform-27_r01.zip". Copy it out and extract the "android-8.1.0" folder. The next step, rename it to "android-27". Then, copy it to the path "C:\Program Files (x86)\Android\android-sdk\platforms".
Open the SDK manager again, you will notice it is solved.
EDIT (For others):
Using the sdkmanager
tool instead of the deprecated android
tool prevents the validation error. It looks like someone at Google forgot to update the checksums of SDK Platform 8.1.0 for the android
tool.
EDIT (For Travis CI):
Current recommended workaround is to add
before_install:
- yes | sdkmanager "platforms;android-27"
to your .travis.yml file to use the sdkmanager
to download the API 27 platform.
I just encountered the same issue a few hours ago while using Travis CI, so I manually uninstalled and reinstalled my local android-27
package, expecting the reinstallation to fail with the same error. To my surprise though, it succeeded when I ran ./sdkmanager.bat "platforms;android-27" --verbose
after uninstalling it.
The only difference I can tell is Travis CI using the deprecated android
command instead of the modern sdkmanager command, but the deprecated android
command correctly redirects to the sdkmanager
command in my local SDK.
My exact error message, which is the same:
Download finished with wrong size. Expected 65606517 bytes, got 65738431 bytes.
There is now an issue on the Travis CI GitHub: https://github.com/travis-ci/travis-ci/issues/8874
Leo Li Thank you so much, it work for me ;-)
When download fails, you can notice a temp folder for this path:
"C:\Program Files (x86)\Android\android-sdk\temp".
There should be a file called platform-27_r01.zip
. Copy it out and extract the android-8.1.0
folder.
The next step, rename it to android-27
. Then, copy it to the path.
"C:\Program Files (x86)\Android\android-sdk\platforms"