About the issues with OpenGapps / Magisk on top of LineageOS (Patreon)
Content
As a bunch of people have had issues flashing these, I figured I'd review the README and make a public post to explain the process and its issues once more.
First of all: All the issues you guys are having with flashing these are because OpenGapps don't like being flashed over a LineageOS setup that has been previously booted.
For all the people that just want to be on their merry way and get things up and running, this is where you can stop reading (more or less) as you now know exactly what went wrong and how to fix it.
Just boot TWRP, factory reset your system, flash OpenGapps & Magisk, reboot, and you'll be done.
For those that want to know why this happens, or those that need a more in-depth tutorial, here's a more detailed answer.
Why do OpenGapps break my LineageOS install?
This is because Android ROMs have something called a "FirstTimeSetup", a small little APK file that launches on first boot and initializes the ROMs Android settings with some initial default settings.
When you flash a OpenGapps package on top of your ROM, it will replace this "FirstTimeSetup" APK with one that sets Google Apps compatible default settings on first boot.
But because you previously booted your ROM while the Google Apps incompatible "FirstTimeSetup" APK was still present, your Google Apps are now missing some mission critical permissions which in turn makes them crash.
This in turn triggers a Android Zygote safeguard, which results in Zygote, the main process of Android, essentially taking the whole operating system down with it after a certain number of errors occured.
How do I properly flash OpenGapps & Magisk? (The long version...)
- Go to https://opengapps.org, pick ARM64 as your Platform, 8.1 as your Android version and pico as your Variant, then hit the red download button.
- Go to https://github.com/topjohnwu/Magisk/releases and download the latest revision of Magisk. The filename is usually named Magisk-v{insert version number here}.zip.
- Long press your XD+'s power button for about 5 seconds to turn it on, let go of the power button, and immediately swap to holding down the Volume+ button until you reach a very minimalistic (shown sideways) menu.
- Tap the Volume+ button until "Recovery mode" is selected, finally confirm your choice with the Volume- button.
- Connect your XD+ to your PC.
- On your XD+ tap the "Wipe" button and slide the "Swipe to Factory Reset" bar to the right, followed by the "Home" navigational button.
- On your XD+ tap the "Advanced" button, followed by the "ADB Sideload" button, and confirm your selection by sliding the bottom blue bar to the right.
- On your PC execute the following ADB command: adb sideload open_gapps-arm64-8.1-pico-*.zip
- Return to the recovery's main menu and repeat step 6 to toggle it back into the "ADB Sideload" mode.
- On your PC execute the following ADB command: adb sideload Magisk-v*.zip
- Wait for the sideloading process to finish and reboot your device, either by long-pressing the power button or picking the "System" reboot option in recovery.
And finally...
Most of you might have noticed that the points listed above are quite similar to the text found in the SPFlash package README.txt.
Well, that is because it is, more or less, a carbon copy of the OpenGapps & Magisk install section of that README.txt file.
However, that README.txt was written from the point of view of a freshly SPFlashed unit, which is why it didn't include the "Factory reset" step seen above.
I didn't anticipate that new users would immediately take the freshly flashed system for a test-drive before flashing OpenGapps & Magisk, which was a slight oversight on my end and the reason why so many of you ran into this issue in the first place.
I should have known better and included that step from the get-go, just to be on the safe side of things, but I learn from my mistakes, and all future builds will include this extra step in the README.txt file as well.
I hope that this post will be of some help to those that struggle with this issue and should any of you find themselves stuck, feel free to direct message me here on Patreon.
I will provide help where possible, but can only do so on weekends for obvious reasons (dayjob, moving, etc).
I wish you all the best!
- Black-Seraph