[Q] ADB Can't Read Sideload

Search This thread

hyderaly

Member
Mar 22, 2006
7
0
Phew. Been banging my head against the desk for a while. Finally got the OTA Nougat installing on my Nexus 6p. This is how it goes.
Initially - nexus 6p in standard boot mode was recognised by my x64 Win10. Installed Android Studio. Ran adb reboot recovery to put my phone in recovery mode, used the key combo to get to menu, activated sideload from ADB but.... my Win10 machines would not identify my nexus 6p.

Adb devices and sideload would not return a device. Windows Device manager was empty too.

Turns out I was missing two items:
1. The Google USB driver - which I had to get from Android Studio/Configure/SDK Manager/Android SDK/SDK Tools.
2. Because it was a fresh install of Android Studio, it only installed with Android 7 platform. Had to select Android 6 platform from Android Studio/Configure/SDK Manager/Android SDK/SDK Platforms.

Then, after connecting the nexus 6p in standard boot mode (non-recovery) had to update the driver for 6p from Windows Device Manager (which showed up as ADB interface within USB Devices section). The automatic search re-categorised 6p to Android Phone/Android Composite ADB interface.

Next, used adb reboot recovery to boot into recover mode. Unplugged and reconnected the phone, switched to ADB sideload mode and Windows Device Manager recognised the device.

Hit another snag - this time side-load erred "cannot read zip file". After mucking about with renaming the file and re-downloading a couple of times, decided to rename the image using command prompt. And this time side-load read the file.

Conclusion:
=========
Need the correct ADB drivers.
Need the correct paltform tools for the current version on the phone
Rename the OTA using command prompt (rename command)

Hope this helps.
 

rpatey7394

New member
Mar 1, 2015
2
4
reached the end

I've read so many threads on this problem where the zip file cannot be read that I decided to chip in myself.
Here's all the information I can give you.

I rooted my OnePlus 3 and installed CyanogenMOD 13 but within a day realised that I wanted to go back to Oxygen OS.

I followed a pretty straightforward set of instructions I found on this following a link on the
forums.oneplus.net / threads / guide-how-to-unroot-your-oneplus-3-and-go-back-completely-to-stock.456232

But when I got the bit where you sideload the zip file I got the same error a lot of people seem to get.

C:\Android>adb devices
List of devices attached
c0368ebc sideload

C:\Android>adb sideload abc.zip
loading: 'abc.zip'
* cannot read 'abc.zip' *

I have done a lot of reading in the last few hours but nothing seems to have any positive effect.
Things I've tried.

downloaded the zip file again
renamed the file
renamed the extension
put the file name back to the original again
tried looking for new drivers

At the moment I'm stuck.
No idea what to do next.
 
  • Like
Reactions: Jayce Jocelyn

rpatey7394

New member
Mar 1, 2015
2
4
I've read so many threads on this problem where the zip file cannot be read that I decided to chip in myself.
Here's all the information I can give you.

I rooted my OnePlus 3 and installed CyanogenMOD 13 but within a day realised that I wanted to go back to Oxygen OS.

I followed a pretty straightforward set of instructions I found on this following a link on the
forums.oneplus.net / threads / guide-how-to-unroot-your-oneplus-3-and-go-back-completely-to-stock.456232

But when I got the bit where you sideload the zip file I got the same error a lot of people seem to get.

C:\Android>adb devices
List of devices attached
c0368ebc sideload

C:\Android>adb sideload abc.zip
loading: 'abc.zip'
* cannot read 'abc.zip' *

I have done a lot of reading in the last few hours but nothing seems to have any positive effect.
Things I've tried.

downloaded the zip file again
renamed the file
renamed the extension
put the file name back to the original again
tried looking for new drivers

At the moment I'm stuck.
No idea what to do next.

I chanced upon the solution.
The .zip file was in a folder called C:\android
I spotted a folder called C:\adb and as soon as I put the .zip file in there it worked.
Simple as that.
Hours of reading and searching and it all came down to luck.
 

jstegeman

Senior Member
Feb 20, 2008
345
104
I will point out that adb.exe on Windows is not linked to be "large address aware" If you set the environment variable ADB_DEBUG=all and try to adb sideload a large file, you'll see that the call to malloc is failing to allocate enough memory for the file. The "obvious" fixes would be for adb not to try to read the entire file into memory or to be linked with the /LARGEADDRESSAWARE flag on Windows.

As a workaround, I've used https://www.techpowerup.com/forums/threads/large-address-aware.112556/ to make adb.exe large address aware, and it's now working for me.
 

Trak-X

Senior Member
Feb 14, 2010
423
187
Bucuresti
Google Pixel 5
I will point out that adb.exe on Windows is not linked to be "large address aware" If you set the environment variable ADB_DEBUG=all and try to adb sideload a large file, you'll see that the call to malloc is failing to allocate enough memory for the file. The "obvious" fixes would be for adb not to try to read the entire file into memory or to be linked with the /LARGEADDRESSAWARE flag on Windows.

As a workaround, I've used https://www.techpowerup.com/forums/threads/large-address-aware.112556/ to make adb.exe large address aware, and it's now working for me.

Finally found a solution for this issue. Been struggling for the last 3 days :D

Thank you.
 
  • Like
Reactions: saturax555

iamamitkumar

New member
Oct 24, 2015
2
1
33
mumbai, vadodara
bless you!

I will point out that adb.exe on Windows is not linked to be "large address aware" If you set the environment variable ADB_DEBUG=all and try to adb sideload a large file, you'll see that the call to malloc is failing to allocate enough memory for the file. The "obvious" fixes would be for adb not to try to read the entire file into memory or to be linked with the /LARGEADDRESSAWARE flag on Windows.

As a workaround, I've used [link redacted] to make adb.exe large address aware, and it's now working for me.

Only your technique worked. You are so awesome and I wish you loads of success in whatever you do. Your life be great! Thank you so much.
 
  • Love
Reactions: xDaaexplorer8

sundar.seetharaman

New member
Jun 4, 2014
4
1
chennai
I will point out that adb.exe on Windows is not linked to be "large address aware" If you set the environment variable ADB_DEBUG=all and try to adb sideload a large file, you'll see that the call to malloc is failing to allocate enough memory for the file. The "obvious" fixes would be for adb not to try to read the entire file into memory or to be linked with the /LARGEADDRESSAWARE flag on Windows.

As a workaround, I've used https://www.techpowerup.com/forums/threads/large-address-aware.112556/ to make adb.exe large address aware, and it's now working for me.

Thanks you so much, finally side loaded successfully
 
  • Like
Reactions: Anonymously_Unknown

NielsKersic

New member
Dec 24, 2014
2
0
I will point out that adb.exe on Windows is not linked to be "large address aware" If you set the environment variable ADB_DEBUG=all and try to adb sideload a large file, you'll see that the call to malloc is failing to allocate enough memory for the file. The "obvious" fixes would be for adb not to try to read the entire file into memory or to be linked with the /LARGEADDRESSAWARE flag on Windows.

As a workaround, I've used URL to make adb.exe large address aware, and it's now working for me.

You are a goddamnd legend
 

Scratchling

Senior Member
Feb 10, 2012
583
111
Dublin
Scratching my head for an hour at this, SU was pushing but not any roms. Thanks a mil jstegeman for your solution.

Is it worthwhile opening a bug with google over this that we can all upvote?
 

glenn4466

Member
Jan 31, 2013
29
1
I tried all of the above and still got the read error. What I did to solve this was 1st to download the zip file again and not rename it and 2nd I went to the phone settings and under the developer settings there is an option something like check files over USB or something like that. I turned it off and it worked.
 

DirkBelig

Senior Member
Jun 10, 2010
204
51
I tried all of the above and still got the read error. What I did to solve this was 1st to download the zip file again and not rename it and 2nd I went to the phone settings and under the developer settings there is an option something like check files over USB or something like that. I turned it off and it worked.
Didn't work for me. After pounding my head flat against the desk, checking the hash, re-re-re-renaming the file with and without .zip in Windows and the cmd box, entering the command as "adb sideload ota.zip" and "...zip.zip", ran the Large Address Aware tool on adb.exe (though I've got 16GB RAM), turned off Verify Files Over USB as glenn did. NOTHING WORKS!

I'm not a super hardcore h4x0rZ, but I've messed around a bit with ADB since the Nexus 4 and I have NEVER seen this "cannot read ota.zip" error when doing ADB stuff until tonight trying to put 7.1.1 on my 6P. I've wasted an hour on this. So frustrated. :mad:
 

glenn4466

Member
Jan 31, 2013
29
1
You said that you re-re-renamed the file but did you try it with the original name and yes I know that is a lot of typing? The reason I ask is that I could not do it until I used the original name and the following statement on the update web page which "seems" to indicate that the file checksum is self checked and is included in the file name.

"2. Verify the checksum of the image: the OTA mechanism has a built-in validation feature, but verifying will save you some time if the file is incomplete. The last portion of the filename is the first 8 digits of its SHA-256 checksum; the full SHA-256 checksum is also shown next to the download link."

I tried for two hours and could not get it to work. Only after I changed the two things I mentioned, did it work. Since I did both things at the same time, I don't know which one did it. Anyone who has "show file extensions" enabled should not have a problem with the double zip issue. Putting the file in the same directory as adb.exe or changing the system path will eliminate most of the other problems. Enabling large file support seemed to have no impact on my 64 bit 8GB Win 10 PC.
 

DirkBelig

Senior Member
Jun 10, 2010
204
51
Yes, I tried the original long file name. (You can copypasta into cmd by hitting Alt+Space, then E, then P.) I also ran the SHA-256 checksum on the renamed file just in case the file name impacted the hash. I even copied the full hash from the download page to paste into the checker to verify. I also have show file extension turned on. Believe me, I've tried everything in this thread that people said cured their ills with no success.
 

DirkBelig

Senior Member
Jun 10, 2010
204
51
Gave up and DLed Wugfresh and it slammed the OTA onto my phone, first try, less than 15 minutes from start to finish. Now running 7.1.1 and cursing that I wasted hours on ADB. Yeah, real nerds do it on a command line. Would've, but it didn't work, so pffft. Got results.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 51
    I will point out that adb.exe on Windows is not linked to be "large address aware" If you set the environment variable ADB_DEBUG=all and try to adb sideload a large file, you'll see that the call to malloc is failing to allocate enough memory for the file. The "obvious" fixes would be for adb not to try to read the entire file into memory or to be linked with the /LARGEADDRESSAWARE flag on Windows.

    As a workaround, I've used https://www.techpowerup.com/forums/threads/large-address-aware.112556/ to make adb.exe large address aware, and it's now working for me.
    17
    Make sure you kill adb before you try to run Large Address Aware

    Many thanks to @jstegeman for the genius insight into LARGEADDRESSAWARE. I wanted to clarify a couple things for those who are still having issues...
    1) Enable debug tracing for adb.exe so you actually know why it's failing. Clarification on @jstegeman post -- you need to set the env. variable ADB_TRACE to all, not ADB_DEBUG. Open a command prompt and type 'set ADB_TRACE=all' and you should be set.
    2) Once ADB_TRACE is set try the sideload command again: 'adb sideload <filename>'
    3) adb should now spit out an error message. If it's the large address problem you'll see something like 'Unable to allocate 13345........ bytes'.
    4) BEFORE YOU RUN THE LARGE ADDRESS AWARE EXECUTABLE LINKED TO BY @jstegeman YOU NEED TO KILL ADB. If you don't kill the service then the utility will fail (without any error message) because you can't modify a running EXE. Type 'adb kill-server' then run the utility.

    Once I did 4) then everything worked like it should. Hope it helps.
    14
    I had this problem too, but solved it this way:

    Place the file you're trying to sideload is in the same adb directory, f.i. C:\Android
    And when in the CMD window, change the active directory to this directory before you type: adb sideload [name of file]

    So:
    - run CMD window

    - change your active directory to adb C:\Android
    Code:
    cd\
    cd android
    - type:
    Code:
    adb devices
    (List of devices should indicate a number of the connected device)

    - type:
    Code:
    adb sideload [name of file]
    7
    Adb cannot read

    I tried all the mention here but no luck. I have a look on adb and its commands and the problem solved this:
    Code:
    adb kill-server
    adb root
    adb sideload <filename.zip>

    I hope it will help you guys.
    5
    I've tried both of these, I still get the cannot read sideload FML why is this keep happening? :crying:

    I was getting that message because my zip file already was a zip file and I named the file update.zip. Had to remove .zip from the file name then it worked.