[Not proper] Install OpenGapps in atvXperience TWRP

Post your great articles here :)
User avatar
SrWladimir
Verified Member
Posts: 43
Joined: Fri Feb 01, 2019 9:44 pm
Answers: 0
Has thanked: 15 times
Been thanked: 3 times

#1

WARNING: YOU ARE ALREADY GOOD WITH atvXperience DEFAULT GAPPS, ONLY TRY THIS IF YOU LIKE TO MESS WITH YOUR DEVICE
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
What you get:

Code: Select all

         Total System Size (KB) | Filesystem
         Used System Space (KB) | 1K-blocks
         Current Free Space (KB) | Used
         Additional Space Required (KB) | 42844
If you for some reason want to install OpenGapps anyway, here is my work-around:

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
And make it look like this:

Code: Select all

ro.build.version.sdk=25
ro.build.version.release=7.1.2
(You can put another android version, just be sure to put the android version of you atvXperience build and his matching sdk)
- 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
And replace it with this:

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
- Save it
- 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.
Last edited by SrWladimir on Mon Apr 22, 2019 11:19 pm, edited 4 times in total.
Nayam
Administrator & Developer
Posts: 1263
Joined: Mon Jun 11, 2018 11:58 pm
Answers: 0
Has thanked: 192 times
Been thanked: 434 times
Contact:

#2

[mention]SrWladimir[/mention] Thanks for the guide.

Flashing GAPPS might add some problems with the existing data, also, There are some apps that weren't added in atvx because they don't work in L3 and make the system unstable.
It should be alright for most part, although I don't recommend updating gapps because of the pre-existing data partition.
BE NICE, BE RESPECTFUL
RESPECT THE MODERATORS
PM ONLY WHEN IMPORTANT
ENJOY!
My Devices:
X96 Mini, A95X Pro, H96 Pro Stick, A95X Max
User avatar
ricklar
Moderator
Posts: 889
Joined: Fri Nov 30, 2018 10:30 pm
Answers: 0
Has thanked: 139 times
Been thanked: 249 times

#3

[mention]SrWladimir[/mention] nice little Tutorial, I may toy with at a later date.

My questions for you...
1) What device or devices do you have with AtvXperience installed in?
2) What this tested as working OK in your device with no bugs?
3) What advantages, new functions, or fixes were observed? Besides the Google system apps being updated...
BE KIND, BE NICE, BE RESPECTFUL TO OTHERS, RESPECT THE MODERATORS,
*IMPORTANT NOTE* ONLY PM MODERATORS OR DEVELOPERS AS A LAST RESORT!!!

☢️ My test device: H96 Pro+ 3gb/32gb DDR4 ☢️ Plus own Tanix, Beelink, Alfawise, X96S, Odroid-N2, Khadas VIM3L, X3, ADT-3, X96-Air
GEARBEST.com
PLEASE ENJOY ATVX!
User avatar
SrWladimir
Verified Member
Posts: 43
Joined: Fri Feb 01, 2019 9:44 pm
Answers: 0
Has thanked: 15 times
Been thanked: 3 times

#4

ricklar wrote: Sat Feb 02, 2019 6:37 am @SrWladimir nice little Tutorial, I may toy with at a later date.

My questions for you...
1) What device or devices do you have with AtvXperience installed in?
2) What this tested as working OK in your device with no bugs?
3) What advantages, new functions, or fixes were observed? Besides the Google system apps being updated...
1) s905x (t95x box) but it should work for others because it does not have device specific things
(EDIT: I forgot to say that I use atvXperience 2H)
2) I didn't have any bugs like FC, things not working or other so far
3) Nothing really, I just wanted to install them for testing, anyway.
Last edited by SrWladimir on Sat Feb 02, 2019 10:23 am, edited 1 time in total.
User avatar
SrWladimir
Verified Member
Posts: 43
Joined: Fri Feb 01, 2019 9:44 pm
Answers: 0
Has thanked: 15 times
Been thanked: 3 times

#5

Nayam wrote: Sat Feb 02, 2019 6:24 am [mention]SrWladimir[/mention] Thanks for the guide.

Flashing GAPPS might add some problems with the existing data, also, There are some apps that weren't added in atvx because they don't work in L3 and make the system unstable.
It should be alright for most part, although I don't recommend updating gapps because of the pre-existing data partition.
What problems can happen from flashing them? I didn't experience any stability issue for now
and what parts of gapps can't be used with widevine L3? maybe I add a part to unselect those parts of the gapps.

Anyway I will add another warning that is not recommended to do this
User avatar
ricklar
Moderator
Posts: 889
Joined: Fri Nov 30, 2018 10:30 pm
Answers: 0
Has thanked: 139 times
Been thanked: 249 times

#6

[mention]SrWladimir[/mention] thanks for your answers.
I was also curious, because another ATV developer says to use 2 Gapps packages = (TVSTOCK+Nano) and then Chromecast may function properly. Is just speculation and not confirmed yet.
BE KIND, BE NICE, BE RESPECTFUL TO OTHERS, RESPECT THE MODERATORS,
*IMPORTANT NOTE* ONLY PM MODERATORS OR DEVELOPERS AS A LAST RESORT!!!

☢️ My test device: H96 Pro+ 3gb/32gb DDR4 ☢️ Plus own Tanix, Beelink, Alfawise, X96S, Odroid-N2, Khadas VIM3L, X3, ADT-3, X96-Air
GEARBEST.com
PLEASE ENJOY ATVX!
User avatar
SrWladimir
Verified Member
Posts: 43
Joined: Fri Feb 01, 2019 9:44 pm
Answers: 0
Has thanked: 15 times
Been thanked: 3 times

#7

ricklar wrote: Sat Feb 02, 2019 2:30 pm [mention]SrWladimir[/mention] thanks for your answers.
I was also curious, because another ATV developer says to use 2 Gapps packages = (TVSTOCK+Nano) and then Chromecast may function properly. Is just speculation and not confirmed yet.
How I can test Chromecast? I don't use it but I can test if installing tvstock and nano gapps make it working
Nayam
Administrator & Developer
Posts: 1263
Joined: Mon Jun 11, 2018 11:58 pm
Answers: 0
Has thanked: 192 times
Been thanked: 434 times
Contact:

#8

ricklar wrote: Sat Feb 02, 2019 2:30 pm [mention]SrWladimir[/mention] thanks for your answers.
I was also curious, because another ATV developer says to use 2 Gapps packages = (TVSTOCK+Nano) and then Chromecast may function properly. Is just speculation and not confirmed yet.
SrWladimir wrote: Sat Feb 02, 2019 5:51 pm
ricklar wrote: Sat Feb 02, 2019 2:30 pm [mention]SrWladimir[/mention] thanks for your answers.
I was also curious, because another ATV developer says to use 2 Gapps packages = (TVSTOCK+Nano) and then Chromecast may function properly. Is just speculation and not confirmed yet.
How I can test Chromecast? I don't use it but I can test if installing tvstock and nano gapps make it working
Chromecast will Never work natively with google's official app. It always checks for widevine l1.
BE NICE, BE RESPECTFUL
RESPECT THE MODERATORS
PM ONLY WHEN IMPORTANT
ENJOY!
My Devices:
X96 Mini, A95X Pro, H96 Pro Stick, A95X Max
User avatar
ricklar
Moderator
Posts: 889
Joined: Fri Nov 30, 2018 10:30 pm
Answers: 0
Has thanked: 139 times
Been thanked: 249 times

#9

Ok
BE KIND, BE NICE, BE RESPECTFUL TO OTHERS, RESPECT THE MODERATORS,
*IMPORTANT NOTE* ONLY PM MODERATORS OR DEVELOPERS AS A LAST RESORT!!!

☢️ My test device: H96 Pro+ 3gb/32gb DDR4 ☢️ Plus own Tanix, Beelink, Alfawise, X96S, Odroid-N2, Khadas VIM3L, X3, ADT-3, X96-Air
GEARBEST.com
PLEASE ENJOY ATVX!
bennieFeaft
Posts: 2
Joined: Sat Apr 20, 2019 8:16 pm
Answers: 0

#10

Hi, thanks a lot for the detailed guide. However, I am getting an error, I attached the related image to this post. I dont know what steps should I follow, can you guys help me? Thanks in advance.
Post Reply