yashsingh1/xdaforums huggingface dataset:
[Huawei Ascend Mate 2] Bratzilla:
I believe the Error 7 message is because your bootloader is showing as "unknown". I downloaded an app from the Playstore that gave me my device's technical info, and sure enough, my bootloader is listed as "unknown". I forwarded a question to Huawei's EMUI team asking them if that happened due to unlocking it (using Huawei's official unlocking request). Still waiting for a replay. In order to get any of the ROMs to install, I had to downgrade TWRP to 2.8.7.0. Any version above that would trigger Error 7.

Out of curiosity, I then downgraded and flashed CandySix (with a corresponding GAPPS package) - and sure enough, the same looping happened. And again when I flashed CM13 AND LineageOS. The phone would successfully boot, get to the actual Start screen, and then boot again. I could NEVER predict exactly what triggered this. Also, I tried installing ROMs without GAPPS, and that didn't go well for me (couldn't get any of them to load properly without flashing a GAPPS package for some reason).

Something goofy seems to be happening between Google services and the custom ROMs on this phone. I'm not sure what's triggering it, but given the sheer number of different ROMs I've tried - ALL of which have the EXACT SAME ISSUE - I strongly suspect there is indeed a GAPPS problem lurking somewhere.

As a side note - I reflahsed B322 (restoring from backup) and the phone is again as stable as it has always been.

Is there an EMUI GAPPS package for Marshmallow and/or Nougat (i.e., pulled from Mate 7, 8 or 9) available for download? I'm game for testing.
[Huawei Ascend Mate 2] EndlessFall:
RE: MT2 boot loop

(*** SEE POST #25 FOR UPDATED FIX!***)

I just noticed this thread, wish I found it earlier. I recently posted my discussion of the boot loop (and fix) here:

https://xdaforums.com/ascend-mate2/orig-development/cm-nougat-mt2-t3478345/page14

Bratzilla was right when he said in his post, "I strongly suspect there is indeed a GAPPS problem lurking somewhere".
[Huawei Ascend Mate 2] hondaman82:
Thanks EndlessFall,

please help to check this link: github(dot)com/opengapps/arm/releases/download/20170811/open_gapps-arm-7.1-pico-20170811.zip

no files listed.
[Huawei Ascend Mate 2] EndlessFall:
RE: dead link for Open GApps previous versions & boot loop fix

Strange, it seems that in the past day Open GApps has purged their GitHub archive. The "Older Releases" button at their website still redirects to the GitHub repo, but it no longer displays any version other than the current one.

As long as it does not violate any policy, I can always post a copy of the Open GApps 08/11/17 ARM 7.1 Pico package.

Although I have not tried other GApps distributions (Delta, Beans, etc), in theory there is no reason why they shouldn't work, as long as Google Play Services is not newer than v11.3.02. I recommend the minimal GApps available. Installing "pico" was an important part of isolating, and simplifying the search for, the culprit.

As I mentioned in my original post, I tested all versions of Google Play Services on apkmirror newer than v11.3.02 (build format 436 for MT2L03), up until 08/26. All newer builds induced an immediate boot loop. A future version may resolve the boot loop issue and work fine on the MT2L03, but it does not seem to be available as of today.

Have been running custom ROMs on my MT2L03 for years. Boot looping problem began for me two weeks ago when I completely wiped/formatted my CandyROMs v7.1.2 06/15 install and flashed MDMower's 08/19 LineageOS. Began digging deep into the cause (knowing MDMower would not release garbage) and discovered the connection to Play Services. Have been running MDMower's LineageOS & CandyROMs v7.1.2 ever since without any issues.

Remember to use MDMower's TWRP v3.1N0-0, it is much more stable on the MT2L03.
[Huawei Ascend Mate 2] hondaman82:
Thanks again Endless,

I follow your instruction to flash Candie ROM and the matching GAPP from 6/15, all went well, no more bootloop. I will check the phone from time to time to see if the Loop of death come back, maybe once GAPP get updated it may come back. LOL... hopefully not though. :)
[Huawei Ascend Mate 2] EndlessFall:
RE: MT2 boot loop fix (workaround)

Great, hondaman82 - so glad it worked for you. Funny, the exact same environment that you are using (06/15 CandyROMs with the matching 06/15 Open GApps) is what served as my "proof of concept" that current Open GApps with updated Play Services was likely the problem.

Although the proper GApps package resolves the boot loop issue, it is important to point out that it's more of a workaround than a fix. The root cause might be a bug in the AOSP/LineageOS source code itself, preventing MT2L03 compatibility with the latest versions of Play Services.

MDMower has just released a new build of LineageOS dated 08/29/17. I'll continue to test the latest ROMs with the latest GApps & Play Services to see if new commits/updates fix the problem...
[Huawei Ascend Mate 2] MT2-User:
Have you had the chance to try 0829 Build of Lineage OS with newer GApps? TIA.
[Huawei Ascend Mate 2] hondaman82:
Oh nooo.. the LOD (loop of death) come back, after 3 days of working OK... sigh.... back to EMUI stock :(
[Huawei Ascend Mate 2] EndlessFall:
RE: new ROM builds, GApps, & boot loop issue

Yes, I tested MDMower's LineageOS 08/29 last night using the 08/29 Open GApps package. Unfortunately, the boot loop bug persists. However, the 08/29 LineageOS runs great with Open GApps 08/11 and is worth installing (at least for me). Hopefully MDMower will keep up the good work and release a build in the next week or two with the Sept security patch.

I'll continue to test and report back if there is any progress...
[Huawei Ascend Mate 2] MT2-User:
Thanks!
[Huawei Ascend Mate 2] EndlessFall:
RE: return of boot loop

Sorry to hear that Hondaman82.

I can only speak from my own experience, which is that my MT2L03 has been stable for the past 2 weeks using Open GApps pico dated no later than 08/11. It is possible that your Google Play Services was auto-updated to a version newer than v11.3.02 (inducing the loop), but you won't be able to tell because you can't boot the corrupted OS to read the version number in app settings. If my boot loop returns, I'll do an ADB pull from TWRP to examine the Play Services package version (curious to see if there is an update correlation).

Goes to show what I mentioned yesterday, which is that the root cause is likely some incompatibility between the ROMs customized for MT2L03 and Play Services that can only be fixed by a commit to the ROM source code, a script, patch, or change to Play Services.

Let's see what happens, perhaps MDMower would be willing to offer his expertise? I visited Matt's website, GitHub and XDA profile, but it seems difficult to contact him directly....
[Huawei Ascend Mate 2] EndlessFall:
RE: preventing Google Play Services auto-update

(***SEE UPDATED FIX IN POST #25!***)

For those of you willing to experiment further, there is a method that supposedly disables Google Play Services from updating. This might allow you to "lock in" v11.3.02 until there is a proper fix for the boot loop:

https://xdaforums.com/android/help/delete-disable-downgrade-prevent-update-t3091832

Basically, this involves using a root file manager to create two empty folders entitled "com.google.android.gms-1.apk" and "com.google.android.gms-2.apk" in the "\data\app" directory, causing auto-update to fail.

I haven't used this hack, try at your own risk!

Of course, this works off of the assumption that updating Google Play Services beyond v11.3.02 is the only factor involved in the boot loop. I just haven't dug deep enough...
[Huawei Ascend Mate 2] MT2-User:
Mine (Candy 0725 build) went into LOD by itself a moment ago:(
[Huawei Ascend Mate 2] divhandyman:
Does anyone have a B322 TWRP backup ZIP? I as of this morning have 2 MT2 phones dead. One went into LOD about 3am and the other about 4am. :(
[Huawei Ascend Mate 2] gale2000:
Where did you find GAPP from 6/15?
[Huawei Ascend Mate 2] ArkAngel06:
I can't get mine to boot no matter what I do. Started a few dasy ago. I still had opengapps from 06/09/17, but those dont work with any roms I have tried, including the 8/29 LoS, or Candy Rom.

I really don't even need Gapps anymore, but none of those roms will boot without Gapps either. Atleast I cant get them to.

Is it possible to run LOS on the HAM2 without gapps?
[Huawei Ascend Mate 2] hondaman82:
Hi,

I used this one, not 6/15 exactly,

https://www.androidfilehost.com/?w=files&flid=174567
[Huawei Ascend Mate 2] divhandyman:
Didnt work for me :(
[Huawei Ascend Mate 2] 4l3x15:
Thanks for the solution, what Gapps are you using for MDMower's LineageOS 08/19 & 08/29? Maybe a link please :)
[Huawei Ascend Mate 2] EndlessFall:
For the initial install, I used Open Gapps pico 08/11/17, the last version with Play Services v11.3.02. Up until a few days ago, this package was available in Open GApp's "older versions" repo, but they just purged files older than 08/29.

I don't mind sharing the 08/11 Open GApps package, as long as it does not violate any XDA policy.

If you use some other GApps, I recommend the minimal package. It keeps compatability testing simple.
[Huawei Ascend Mate 2] 4l3x15:
Unfortunately as you say they deleted that version and I cant find it anywhere else. :eek:
[Huawei Ascend Mate 2] Bratzilla:
Sorry for the late reply. I haven't gotten update notices on this thread even though I'm subscribed. [emoji15]

I have the stock B322 for MT2 L03. Let me know if you still need it.

EDIT: Whoops! I should have said I have the stock ROM from Huawei, which isn't TWRP flashable. Gonna see if I can get TWRP to backup my image as I'm on B322.
[Huawei Ascend Mate 2] EndlessFall:
I'll post an alternative install method soon that simplifies the process and allows you to use the latest Open GApps instead of a version with Play Services <= 11.3.02.
[Huawei Ascend Mate 2] Bratzilla:
For some reason I can't locate the Qualcomm location file with that name. My searches find nothing. :confused:

UPDATE: Never mind... found the bugger. It's simply labeled as LocationServices (one word). I had to use an app that showed me the full details. :good:
[Huawei Ascend Mate 2] EndlessFall:
UPDATE TO POST #25: new boot loop workaround/fix, method #2

This is an update to my post #25. This alternative method to fix the boot loop issue achieves the exact same result as Method #1, but it will be easier and faster for most users.

As with Method #1, the goal is to disable "com.qualcomm.location", the component that triggers boot loops when Play Services is newer than v11.3.02.

This method will NOT disable GPS location from working on the MT2 (for example, Google Maps still works fine).

*** UPDATE: If you are installing a ROM newer than 09/02/17, the developer may have already integrated the fix, disabling or removing "com.qualcomm.location" ***

*** For those of you with TWRP installed who have an OS that is currently boot looping, you can avoid a reinstall and rescue your environment. Skip to step 6 below and you should be back up & running quickly ***

Method #2:

1. Backup your files.

2. Install MDMower's TWRP v3.1.N0-0 and boot into recovery. If prompted, allow TWRP to modify system.

3. Wipe & format to remove the current OS & get a clean start.

4. Flash the OS of your choice (AOKP, CandyROMs, CM/LineageOS, etc). I recommend, and tested, MDMower's LineageOS 08/19 & 08/29.

5. Flash the latest GApps package of your choice. I recommend Open GApps pico. This new method does NOT require an older GApps package.

6. Select TWRP's "Mount" option and check the box for "System". Do NOT check the "mount as read-only" box.

7. Select TWRP's "Advanced" option and choose "File Manager". Browse to "/system/priv-app/com.qualcomm.location/". Select "com.qualcomm.location.apk", choose the "Rename" option, and change the extension from ".apk" to ".bak". Technically, you can rename the file to any extension you want, you can even remove the file/folder (although I always prefer to make minimal & reversable changes when possible). The point is to render it unrecognizable as an application. The qualcomm directory and file exists for all recent versions of AOKP, CandyROMs, CM & LineageOS. If you're having trouble finding the folder/file, make sure that you mount the system partition in step 6 and click "(up a level)" in File Manager to start browsing from the root.

8. Done. Reboot to system.

Moving forward, your MT2 will be capable of successfully installing & running the latest Play services via GApps packages, standalone Play Services installers (variant 436 or 430 nodpi), and (presumably) auto-updates. No boot loops.

Caveat: Unless someone invents a time machine, it will always be difficult to create a forward-compatible fix. As new versions of software are released, let's hope this fix provides compatibility between custom MT2 ROMs and Play Services for a long time to come.

(Proof of concept, for uber nerds such as myself: Reboot into TWRP and change the extension in step 7 back to ".apk". Boot loop will immediately return upon reboot.)
[Huawei Ascend Mate 2] MT2-User:
Add .bak to the above mentioned file name in TWRP and successfully boots into system. My Google Play Service is on v11.5.09.
[Huawei Ascend Mate 2] divhandyman:
Seems to be working here. Thanks for the effort to get this thing fixed for us:good:
[Huawei Ascend Mate 2] Davinci50:
[MENTION=8256500]EndlessFall[/MENTION] Thank You Very Much !!! Your hard work is Truly appreciated.
[Huawei Ascend Mate 2] lunaris242:
Candy does not have the same directory structure, but Lineage OS worked fine.

THANK YOU SO MUCH. I have never been able to use Lineage, it has OS looped since day one, and this also fixed the problem with me logging into Google. I was one step away from being done with my Ascend Mate 2, which would suck cause I LOVE this phone.

You are the best EndlessFall, again, thanks so much.
[Huawei Ascend Mate 2] gale2000:
Thanks so much Divhandyman. You saved my favorite phone. Your solution is working so far.
[Huawei Ascend Mate 2] EndlessFall:
Glad to help. I own multiple phones, but I really enjoy using the MT2 and I want to keep it running as long as possible. I just can't accept using the B322 EMUI image with security patches 2+ years old (yikes, time to retire the phone if that's my only option!). A significantly out-of-date OS may be great for CandyCrush and Instagramming pictures of your sandwich, but those of us who conduct business and banking need modern security. Besides, who doesn't enjoy all the cool features of new ROMs?

I understand that stability is important (utmost for some), but I honestly believe that Method #2 in post #32 accomplishes that with current ROMs.

As has always been true, make frequent backups! :)

---------- Post added at 02:38 PM ---------- Previous post was at 02:33 PM ----------

Thanks for pointing out the issue, I'll update the guide soon for ROMs with a different directory structure... This will help people who choose to rescue their current non-LineageOS environment.
[Huawei Ascend Mate 2] divhandyman:
Thank EndlessFall he's the one that fixed our problem:)

---------- Post added at 05:52 PM ---------- Previous post was at 05:48 PM ----------

Agreed the MT2 has been a good phone I flashed back to B322 when this happened, and I forgot how bad it was. Candy has been a Great upgrade to the Phone.
[Huawei Ascend Mate 2] EndlessFall:
Thanks again for the feedback. Hmmm, I just did a wipe/format & clean install of recent versions of AOKP, CandyROMs, CM & LineageOS. All have "com.qualcomm.location.apk" located in the folder "/system/priv-app/com.qualcomm.location"... I'll update the guide just in case some other version is different.
[Huawei Ascend Mate 2] EndlessFall:
Awesome, MDMower just released a new unofficial LineageOS tonight, build 09/03/17. He chose to integrate the boot loop fix by removing the "com.qualcomm.location" folder completely. Moving forward, his builds should be good-to-go.

I'm running the 09/03 build now, runs like a champ (of course it does, it's MDMower after all)

https://www.androidfilehost.com/?a=show&w=files&flid=40887
[Huawei Ascend Mate 2] divhandyman:
Just Installed 09/03 Build running good so far. Thanks for the link.:good: And Thanks MDMower for the update.:)
[Huawei Ascend Mate 2] Shepxda:
Wait, so I can use 9/03 gapps?
[Huawei Ascend Mate 2] divineBliss:
As long as you disable the previous specified Locationservices apk first - if it's not already disabled/removed.
[Huawei Ascend Mate 2] Davinci50:
[MENTION=6065620]divineBliss[/MENTION] Yes you can use the latest gapps Matt has deleted the Location apk all together to get rid of the bootloop issue. HTH
[Huawei Ascend Mate 2] EndlessFall:
Dirty flashing LineageOS 09/03 over the top of 08/29 worked fine for me (apples to apples). You asked if you can flash LineageOS over the top of your current environment, which is different... I never tried to intermix ROMs with different features and files, but it sounds like an invitation to bugs.

Dirty flashing in general has been hit-or-miss for many of us, so - shall I say it again for the uninitiated? - DO FREQUENT BACKUPS!
[Huawei Ascend Mate 2] sakui23:
Same here also

I'm dealing with the same thing. I have B322 with TWRP 3.1.1.1.
[Huawei Ascend Mate 2] hondaman82:
Wow wow... manny thanks to Endless and of course MDMower... just flash Lineagea 9/03 version ... and everything run very smooth... :)
[Huawei Ascend Mate 2] sakui23:
This is working for me. Thank you.
[Huawei Ascend Mate 2] EndlessFall:
Sakui23, just go to post #32. You may be able to skip directly to step 6. I'm not sure if B322 has "com.qualcomm.location.apk" in the same folder directory, but the fix is to find it and disable or remove. Also, I encourage you to use MDMower's TWRP.

I really don't support continued use of B322. In my IT career, we used to call outdated systems "Typhoid Mary" due to security & infection risks. The better solution to your problem is to backup your files and get on a new ROM.

I see in your followup post #50 that you got your phone working, great
[Huawei Ascend Mate 2] 4l3x15:
Thanks for the link and your valuable help :good:
[Huawei Ascend Mate 2] hanxuinn:
Thank you so much for the fix!!!
[Huawei Ascend Mate 2] gale2000:
Is this Rom rooted?
[Huawei Ascend Mate 2] Bratzilla:
Regarding LineageOS, I don't think so (at least I didn't see any evidence of that) BUT all you have to do is find the latest version of flashable SuperSU that works with your version of TWRP. Flash it and then reboot. You may get a prompt once you've booted that you need to update SuperSU, but that's normal (and will download from the Play store in that case).

So far, absolutely no issues with this on my end. :D

---------- Post added at 06:32 PM ---------- Previous post was at 05:49 PM ----------

Just posting my results from this past Saturday to date.

Switched to MDMower's latest version of TWRP for the Mate 2 (3.1.N0-0)

Followed all of the steps above (reference Post #32) this past Saturday flashing Lineage OS by MDMower dated 08-19-17), along with OpenGapps for Nougat (I think I did Nano instead of Pico) and SuperSU. I changed the extension of the offending Qualcomm file to .bak.

Put my phone through its paces all day Saturday just to see if this held up. Absolutely no looping presented.

On Sunday, I "dirty flashed" MDMower LineageOs 14.1 dated 09-03-17 and rebooted. Everything worked well, except SuperSU was giving me a "busy" error. I then rebooted to TWRP and reflashed SuperSU, and booted back to the system. Now everything including SupserSU worked perfectly.

I then decided to go full metal and flashed the Unofficial Xposed Framework for Nougat Sunday night. And THIS even works fine. Thus far, no problems.

And for good measure, I also downloaded and installed the latest version of SELinux Mode Changer (the switcher version didn't start at boot up like this one does - the creator had posted an updated version here at XDA and it works great!) as well as set my init.d so I could get Viper4Android up and running.

All is running well - Nougat, Xposed, Viper4Android, etc. Mate 2 is STILL a great phone, and these changes have made the phone even better (so much faster than EMUI).

Full thanks to EndlessFall for this fix. My hair is finally growing back in. :good: :cool:

SIDE NOTE: I tried the Qualcomm fix for earlier ROMs (i.e., CM13) but I couldn't get those to work. MDMower LineageOS 14.1 works flawlessly.
[Huawei Ascend Mate 2] hondaman82:
HI Endless,

I flashed the latest Lineage from MDMower with "com.qualcomm.location" removed, but i did not do the following step from your earlier instruction:

Select TWRP's "Advanced" option and choose "File Manager". Browse to "/system/priv-app/com.qualcomm.location/". Select "com.qualcomm.location.apk", choose the "Rename" option, and change the extension from ".apk" to ".bak"

Is this step still necessary?

My phone running great so far, i am just wondering if the boot loop will come back becuase i didnt do that ".apk" to ".bak" renamming step. Thanks alot!
[Huawei Ascend Mate 2] Shepxda:
Why does my HAM2 run really bad on LOS? In the recents menu it lags like hell and the ui is really slow. It's the Canadian B128 version if that helps. Candy and stock firmware runs really smooth though.
[Huawei Ascend Mate 2] Bratzilla:
When I updated, I checked and it looks like that entire folder was gone. So I just booted back into the system and thus far everything is running perfectly.

---------- Post added at 02:27 AM ---------- Previous post was at 02:23 AM ----------

Need more information. Did you upgrade to the latest bootloader first? Did you do a clean flash? What TWRP version? And did you use standard official Los or MD mower version?
[Huawei Ascend Mate 2] EndlessFall:
Hi, glad to hear of all the boot loop fix success stories. Now we can get on with using our phones!

BTW, I want to thank XDA forums, because otherwise I would have resolved this issue in isolation for my own use, without knowing that lots of others needed help too. My posts had some work-in-progress "stream of consciousness" moments, but in the end we got to the fix!

Although I prefer SuperSU, LineageOS has SU built-in if you want to use it. To enable, you have to toggle "Root Access" in Dev Ops. For those just learning, you enable Dev Ops under settings by tapping the "Build" section of "About Phone" 7 times. LineageOS offers the latest flashable SU package here: https://download.lineageos.org/extras

It is completely normal to have to reapply SuperSU after updating your OS, systemless or not. Nice to hear that your environment is still stable with all the extras!

No need to do the renaming step because there is nothing to rename in MDMower's 09/03 build. Remember that the goal of the fix is to prevent the Android OS from recognizing the existence of com.qualcomm.location. You achieve this by renaming or deleting the file/folder, which MDMower did when he compiled his flashable zip. If all MT2 ROMs incorporate this moving forward, we will be back to normal...
[Huawei Ascend Mate 2] MikeyLee:
The version of Linage that everyone is talking about, can it be dirty flashed over regular CM 14.1? Because of this stupid boot loop issue (Thanks Google) I have just about had it with clean flashing and re setting up everything.
[Huawei Ascend Mate 2] EndlessFall:
MikeyLee, intermixing different ROMs, regardless of the source code connection between CM & LOS, may be buggy or fail. If nothing else, it creates a messy file/folder structure. Why not do the following:

1. Quickly repair/rescue your existing CM install by skipping to post #32 step 6, which describes how to use TWRP to rename or delete "com.qualcomm.location":

https://xdaforums.com/showpost.php?p=73634083&postcount=32

2. Make a TWRP backup of your newly rescued CM and keep it safe.

3. Experiment with dirty flashing to MDMower's LineageOS 09/03, knowing that you can always fall back to your TWRP backup. If you choose to flash to any other ROM, remember that you will have to repeat the process in post #32 step 6 if the fix isn't integrated by the developer.