Cannot flash factory images to Google Pixel 2 XL


Question

Device: Google Pixel 2 XL (taimen)



Carrier: Unlocked (purchased from the Play store)



Image: image-taimen-opm1.171019.011.zip



Ultimately, I'm trying to root the phone by flashing a batched boot.img to the stock image, but I'm unable to flash any images, whether that's the patched boot.img, TWRP, or even the stock factory images themselves. I've already unlocked the bootloader, using fastboot flashing unlock_critical.



I am running the newest version of adb and fastboot, downloaded yesterday:



$ fastboot --version
fastboot version 0.0.1-4500957
Installed as [REDACTED]

$ adb version
Android Debug Bridge version 1.0.39
Version 0.0.1-4500957
Installed as [REDACTED]


Here's what happens when I try to flash the stock factory images, downloaded straight from Google:



$ adb reboot bootloader
$ ./flash-all.sh
target didn't report max-download-size
sending 'bootloader' (36344 KB)...
FAILED (remote: Requested download size is more than max allowed
)
finished. total time: 0.000s
rebooting into bootloader...
OKAY [ 0.000s]
finished. total time: 0.201s
target didn't report max-download-size
sending 'radio' (60428 KB)...
FAILED (remote: Requested download size is more than max allowed
)
finished. total time: 0.000s
rebooting into bootloader...
OKAY [ 0.001s]
finished. total time: 0.201s
extracting android-info.txt (0 MB) to RAM...
Warning: Could not determine slot for secondary images. Ignoring.
extracting boot.img (40 MB) to disk... took 0.289s
target didn't report max-download-size
archive does not contain 'boot.sig'
extracting dtbo.img (8 MB) to disk... took 0.039s
archive does not contain 'dtbo.sig'
archive does not contain 'dt.img'
archive does not contain 'recovery.img'
extracting system.img (1936 MB) to disk...
archive does not contain 'system.sig'
extracting vbmeta.img (0 MB) to disk... took 0.000s
archive does not contain 'vbmeta.sig'
extracting vendor.img (349 MB) to disk... took 4.445s
error: Failed to identify current slot


Other commands fail with inconsistent error messages or failure modes. For example:



$ fastboot flash boot boot.img 
target didn't report max-download-size
sending 'boot' (40960 KB)...
FAILED (remote: Requested download size is more than max allowed
)
finished. total time: 0.000s


If I retry with -S



$ fastboot -S 512K flash boot boot.img 
Invalid sparse file format at header magic
sending sparse 'boot' 1/51 (508 KB)...


which hangs indefinitely, never sending the first segment.



I can try booting directly, which yields the same problem:



$ fastboot boot boot.img 
downloading 'boot.img'...
# hangs indefinitely


Similarly:



$ fastboot --set-active=_a


will just hang indefinitely as well. I have to restart the bootloader to kill it, at which point it just prints the cryptic error: Device does not support slots (the Pixel 2 XL does support slots!).



The error messages aren't always consistent; sometimes the first fastboot flash boot boot.img command will appear to hang (requiring a restart, similar to --set-active) instead of printing the error message about max-download-size. I've let that run for about fifteen minutes before having to kill it. Unlike system.img, boot.img is only about 40MB, so it shouldn't take that long to flash - something is clearly wrong.



I've also tried this with multiple cables on different USB ports, with the same results.


Answer

Ultimately, I solved this by using a Macbook Pro with a USB-C to USB-C cable.



Previously, I had tried it with two different USB-A to micro-USB cables, using two different micro-USB to USB-C adapters, on a Linux laptop with two different USB-A ports and the then-latest version of fastboot/adb downloaded. Unfortunately, I can't be certain what the issue was, but since it happened consistently with multiple cables (and those cables still appear to be working), my guess is that there was a bug with the Linux version of adb/fastboot.


Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes