# [HELP] Everything's Broken!



## andoird213 (Sep 15, 2012)

Hi all,

So yesterday I compiled my own 4.2 build for toro. No problems there. When all was said and done, there weren't any real working Gapps packages (at that time, anyway) so I decided to take my chances and flash the leaked 4.2 one (which was reported not working) and see what happened. I was _expecting_ it not to work, which is why I backed up in TiBu and in TWRP. All else fails, restore, right? So went ahead and did it, and as expected, force close galore on the Gapps till it went in to a bootloop. So disappointed, but still ok. So I go to boot in to recovery and restore my backup, and guess what isn't there... TWRP! Now stock recovery has somehow been installed. Ok...this sucks. BUT there's ADB! Adb pull my TiBu folder and my TWRP Backup and then restore to stock, install TWRP, push files, and all is dandy. So boot in to fastboot mode, and I get this lovely little thing! "Fastboot Command Read Error -2147483647" No commands work, adb or fastboot. So I have no custom recovery, no bootable ROM, and no adb or fastboot. Now I've gotten myself out of similar situations, but I only when I have a combination of two of the above not all 3. I see no doors, no options. They say Nexi are unbrickable...here's to that! Please someone help!!


----------



## mentose457 (Aug 26, 2011)

There is always ODIN.

http://forum.xda-developers.com/showthread.php?t=1827685


----------



## andoird213 (Sep 15, 2012)

mentose457 said:


> There is always ODIN.
> 
> http://forum.xda-developers.com/showthread.php?t=1827685


If my device isn't being read properly for adb or fast boot, wouldn't the same problem arise with ODIN?

Sent from my Nexus 7


----------



## wigsplittinhatchet (Nov 5, 2011)

Try updating the SDK or reinstall your drivers. Also are you using Linux or windows

Sent from my Galaxy Nexus using RootzWiki


----------



## andoird213 (Sep 15, 2012)

wigsplittinhatchet said:


> Try updating the SDK or reinstall your drivers. Also are you using Linux or windows
> 
> Sent from my Galaxy Nexus using RootzWiki


Linux. No drivers. And already updated SDK


----------



## altimax98 (Jul 14, 2011)

I know this is dumb but have you tried a different USB port?


----------



## terryrook (Jun 10, 2011)

andoird213 said:


> Linux. No drivers. And already updated SDK


still broke,?

Sent from my Galaxy Nexus using RootzWiki


----------



## andoird213 (Sep 15, 2012)

terryrook said:


> I know this is dumb but have you tried a different USB port?


Yep, my PC has 3 and I tried all 3


----------



## 00negative (Jul 25, 2011)

andoird213 said:


> If my device isn't being read properly for adb or fast boot, wouldn't the same problem arise with ODIN?
> 
> Sent from my Nexus 7


Does adb show your device when it's connected? Couldn't tell since you said that it isn't being read properly.

Does it show your device if you type ddms in Linux terminal. It will show you debug info.


----------



## codesplice (Oct 21, 2011)

andoird213 said:


> Hi all,
> 
> So yesterday I compiled my own 4.2 build for toro. No problems there. When all was said and done, there weren't any real working Gapps packages (at that time, anyway) so I decided to take my chances and flash the leaked 4.2 one (which was reported not working) and see what happened. I was _expecting_ it not to work, which is why I backed up in TiBu and in TWRP. All else fails, restore, right? So went ahead and did it, and as expected, force close galore on the Gapps till it went in to a bootloop. So disappointed, but still ok. So I go to boot in to recovery and restore my backup, and guess what isn't there... TWRP! Now stock recovery has somehow been installed. Ok...this sucks. BUT there's ADB! Adb pull my TiBu folder and my TWRP Backup and then restore to stock, install TWRP, push files, and all is dandy. So boot in to fastboot mode, and I get this lovely little thing! "Fastboot Command Read Error -2147483647" No commands work, adb or fastboot. So I have no custom recovery, no bootable ROM, and no adb or fastboot. Now I've gotten myself out of similar situations, but I only when I have a combination of two of the above not all 3. I see no doors, no options. They say Nexi are unbrickable...here's to that! Please someone help!!


Unless you've altered your build environment to avoid it, AOSP builds will by default include all filesystems (including recovery). Additionally, stock builds will create two files (/system/recovery-from-boot.p and /system/etc/install-recovery.sh) which will reflash the stock recovery on every boot. Unless you modify your build environment to omit the recovery, I'd recommend that you keep a flashable .zip of your recovery on your "sdcard". Then (1) flash your build, (2) reflash your recovery (for good measure), (3) delete those two files using TWRP's file manager (you'll have to mount /system first), and (4) reboot. This should avoid this problem in the future...

For now, I also had some screwy stuff happen with fastboot yesterday. As was suggested, check *ddms* to see if Linux is correctly detecting your device. Try using a different USB cable if possible - not all are created equally. Also reboot both your Linux machine and your Android device (for good measure) - this actually seems to have solved the issue for me yesterday.

If all else fails, Odin may be an option but you'd need Windows to pull that off - though really, trying a different OS with a different set of drivers may not be a bad idea at all.

Good luck!

PS - let me know if you've run across a good working 4.2 GApps package to use on AOSP builds


----------



## 00negative (Jul 25, 2011)

codesplice said:


> Unless you've altered your build environment to avoid it, AOSP builds will by default include all filesystems (including recovery). Additionally, stock builds will create two files (/system/recovery-from-boot.p and /system/etc/install-recovery.sh) which will reflash the stock recovery on every boot. Unless you modify your build environment to omit the recovery, I'd recommend that you keep a flashable .zip of your recovery on your "sdcard". Then (1) flash your build, (2) reflash your recovery (for good measure), (3) delete those two files using TWRP's file manager (you'll have to mount /system first), and (4) reboot. This should avoid this problem in the future...
> 
> For now, I also had some screwy stuff happen with fastboot yesterday. As was suggested, check *ddms* to see if Linux is correctly detecting your device. Try using a different USB cable if possible - not all are created equally. Also reboot both your Linux machine and your Android device (for good measure) - this actually seems to have solved the issue for me yesterday.
> 
> ...


There is one that I think is working alright by user or dev craigacgomez over on xda. Not sure if its on rootz but check mmuzzy or mrom aosp there. He also shows how to get tether and google now location working


----------



## codesplice (Oct 21, 2011)

00negative said:


> There is one that I think is working alright by user or dev craigacgomez over on xda. Not sure if its on rootz but check mmuzzy or mrom aosp there. He also shows how to get tether and google now location working


Sweet, thanks for the heads-up: found it here.


----------



## andoird213 (Sep 15, 2012)

codesplice said:


> Unless you've altered your build environment to avoid it, AOSP builds will by default include all filesystems (including recovery). Additionally, stock builds will create two files (/system/recovery-from-boot.p and /system/etc/install-recovery.sh) which will reflash the stock recovery on every boot. Unless you modify your build environment to omit the recovery, I'd recommend that you keep a flashable .zip of your recovery on your "sdcard". Then (1) flash your build, (2) reflash your recovery (for good measure), (3) delete those two files using TWRP's file manager (you'll have to mount /system first), and (4) reboot. This should avoid this problem in the future...
> 
> For now, I also had some screwy stuff happen with fastboot yesterday. As was suggested, check *ddms* to see if Linux is correctly detecting your device. Try using a different USB cable if possible - not all are created equally. Also reboot both your Linux machine and your Android device (for good measure) - this actually seems to have solved the issue for me yesterday.
> 
> ...


Could you walk me through perhaps how I should go about making Linux detect my device? But FYI, I used my friend's Mac and tried, and I got that same read error


----------



## andoird213 (Sep 15, 2012)

00negative said:


> Does adb show your device when it's connected? Couldn't tell since you said that it isn't being read properly.
> 
> Does it show your device if you type ddms in Linux terminal. It will show you debug info.


I get the read error which is why adb isn't recognizing it


----------



## codesplice (Oct 21, 2011)

andoird213 said:


> Could you walk me through perhaps how I should go about making Linux detect my device? But FYI, I used my friend's Mac and tried, and I got that same read error


You can follow the guide here to make sure you have your SDK and USB access set up correctly on Linux.


----------



## 00negative (Jul 25, 2011)

andoird213 said:


> I get the read error which is why adb isn't recognizing it


Read through this. You might need to set up an androidcentral user account to see links though. But they had same error and got it fixed

http://forums.androidcentral.com/verizon-galaxy-nexus-rooting-roms-hacks/184408-need-serious-help.html


----------



## andoird213 (Sep 15, 2012)

codesplice said:


> You can follow the guide here to make sure you have your SDK and USB access set up correctly on Linux.


This didn't work for me


----------



## andoird213 (Sep 15, 2012)

OK guys! This is interesting. adb devices returns blank, it doesn't see anything attatched. HOWEVER, fastboot devices returns my device. Hmmm


----------



## andoird213 (Sep 15, 2012)

So I was able to flash TWRP back. Unfortunately, at some point, all my data was deleted (including my backup). So guys...I'm basically getting a new phone! Lol. Thanks all


----------



## andoird213 (Sep 15, 2012)

codesplice said:


> Unless you've altered your build environment to avoid it, AOSP builds will by default include all filesystems (including recovery). Additionally, stock builds will create two files (/system/recovery-from-boot.p and /system/etc/install-recovery.sh) which will reflash the stock recovery on every boot. Unless you modify your build environment to omit the recovery, I'd recommend that you keep a flashable .zip of your recovery on your "sdcard". Then (1) flash your build, (2) reflash your recovery (for good measure), (3) delete those two files using TWRP's file manager (you'll have to mount /system first), and (4) reboot. This should avoid this problem in the future...
> 
> For now, I also had some screwy stuff happen with fastboot yesterday. As was suggested, check *ddms* to see if Linux is correctly detecting your device. Try using a different USB cable if possible - not all are created equally. Also reboot both your Linux machine and your Android device (for good measure) - this actually seems to have solved the issue for me yesterday.
> 
> ...


Since I now have nothing to lose, I shall try try again with this 4.2! Would you be so kind as to tell me how to remove the recovery img from the build? Do I have to uncompress the zip and delete it? Or is there a way to omit it?


----------



## codesplice (Oct 21, 2011)

andoird213 said:


> Since I now have nothing to lose, I shall try try again with this 4.2! Would you be so kind as to tell me how to remove the recovery img from the build? Do I have to uncompress the zip and delete it? Or is there a way to omit it?


You should be able to just open the archive on your Linux machine (open, not extract) and delete the recovery folder. Sure, the zip won't be signed anymore, but it should still flash fine in a custom recovery. Flash your ROM, flash the gapps I linked a few posts back, maybe SuperSU, and then boot. Good luck!


----------



## andoird213 (Sep 15, 2012)

codesplice said:


> You should be able to just open the archive on your Linux machine (open, not extract) and delete the recovery folder. Sure, the zip won't be signed anymore, but it should still flash fine in a custom recovery. Flash your ROM, flash the gapps I linked a few posts back, maybe SuperSU, and then boot. Good luck!


Thanks


----------

