Warning 2: This tutorial will asume that you know how to use Amlogic Tools and you know how to edit a file, this is just a dirty hack and only try this at your risk
Why this happen?
atvXperience firmware (or the firmware that atvx is based on) has an issue that in TWRP if you try to install OpenGapps(TVSTOCK) you will receive various errors like:
1. "This package is for 7.1.x" even if you have 7.1.2
2. "There is not space in the system" even having space for it.
1.) Happens because of the "default.prop" recovery image that for some reason has android version 5.1.1 and sdk 22 in the settings and OpenGapps uses this data for detecting version, easily fixable for the atvxperience team
2.) This happens because TWRP (or the entire firmware) has a bad setup of project treble: causing the OpenGapps fail to calculate the size and space left of the system: (I don't how to fix this on the firmware)
How Opengapps should display the size calculation in the log:
Code: Select all
Total System Size (KB) | 2049200
Used System Space (KB) | 940488
Current Free Space (KB) | 1092328
Code: Select all
Total System Size (KB) | Filesystem
Used System Space (KB) | 1K-blocks
Current Free Space (KB) | Used
Additional Space Required (KB) | 42844
Requirements
- Windows PC
- A text editor that is not the in-built notepad in windows (notepad++ or sublime text)
- AmlogicTool (Customization tool)
- Basic knowledge of using AmlogicTools
- Patience
How-to:
Wrong android version bug
- Unpack atvXperience IMG in level 2 mode
- Go to the "Kernel/Recovery" tab and click "Open recovery directory"
- Search for the "default.prop" file and open it with a text editor
- Look for these two settings:
Code: Select all
ro.build.version.sdk
ro.build.version.release
Code: Select all
ro.build.version.sdk=25
ro.build.version.release=7.1.2
- Save it
- Repack recovery and flash it in the way you like (if you will select only recovery mode in packaging, when you flash it uncheck any erase setting)
- Flash it
- Done, if the other error appears follow the next steps
Insufficient system space
- Download the latest Opengapps-tvstock package
- Extract "installer.sh" from the OpenGapps zip file
- Open "installer.sh" it with a text editor
- Search for this:
Code: Select all
if [ -n "$(cat /proc/cmdline | grep slot_suffix)" ];
then
device_abpartition=true
SYSTEM=/system/system
VENDOR=/vendor/vendor
else
device_abpartition=false
SYSTEM=/system
VENDOR=/vendor
fi
Code: Select all
if [ -n "$(cat /proc/cmdline | grep slot_suffix)" ];
then
device_abpartition=false
SYSTEM=/system
VENDOR=/vendor
else
device_abpartition=false
SYSTEM=/system
VENDOR=/vendor
fi
- Put the "Installer.sh" file back into the Opengapps.zip
- Flash it with TWRP
- Done
If you still have the error of insufficient system space, try resizing the system partition in TWRP.
If nothing of what I write worked, there is nothing I can do for it.
Hope this helped in any way.