How to Install GApps to Android 6 on eMMC from Ubuntu


(Chong Thien Pow) #1

Prerequisite:

  1. you must have already done the “How to Flash Android to eMMC from Ubuntu” How to Flash Android to eMMC from Ubuntu
  2. you must be able to boot into Android 6 on your BPi-M64 already.

Download: I have prepared a set of open gapps easy for you to push to the /system folder https://pan.baidu.com/s/1slkytYl

Install:

  1. make sure your BPi-M64 is power connected and also USB OTG connected to your PC.

  2. double check if your usb is connected by typing:

      adb devices
    
  3. if it shows one long unique id number under the List of devices means you are connected and ready to go.

  4. type the following:

      adb root
      adb remount
      adb shell "rm -rf system/priv-app/PackageInstaller"
    
  5. unzip the gapps.tar.gz file you have just downloaded.

  6. cd gapps

  7. inside gapps folder, you should see only 1 system folder, then type:

      adb push system /
      adb shell "pm grant com.google.android.gms android.permission.ACCESS_COARSE_LOCATION"
      adb shell "pm grant com.google.android.gms android.permission.ACCESS_FINE_LOCATION"
      adb shell "pm grant com.google.android.setupwizard android.permission.READ_PHONE_STATE"
      adb shell "pm grant com.google.android.setupwizard android.permission.READ_CONTACTS"
      adb reboot
    

after reboot, ignore any “unfortunately … has stopped” message if got any… and please don’t rush to open the apps yet, else it will cache the error and make things more complicated.

Fix Errors via Settings:

  1. go to Settings->Apps

  2. go into all the newly installed google apps, and go into the permissions, allow all of it that it suggest you to enable.

  3. double check if any google apps that you miss adding the permissions.

  4. reboot again by typing:

      adb reboot
    
  5. done!

if you didn’t listen and rushed to open apps before fixing the permissions, you will have to go to Settings->Apps->top right corner menu choose “Reset app preferences”, then reboot, and then go fix the permissions first, then reboot, then it should be ok.


(BPI_Justin) #2

Support Android GMS Service. Good job !


(Eta Prime) #3

I cannot get it to work. it crashes at the setup wizard. ive tried everything. can you update the guide?


(BPI_Justin) #4

HI: We will update new android as soon as possible.


(Eta Prime) #5

The android image works great! I just can’t get Gapps installed


(Chong Thien Pow) #6

don’t skip these

adb root adb remount adb shell “rm -rf system/priv-app/PackageInstaller”

first 2 lines is to make sure you have root access at root folder, else it will be readonly and can’t push. 3rd line is to make sure you are not using the old setup wizard by removing it… because you will push in a new installer that come with the system folder i prepared.


(Alex Miller) #7

Hi Man,

Im trying to follow up your instruction about how to install Google play store on android, but the Gapps that you shared on Baidu doesnt seem like that it is working!!

I tried with multiple different download managers, but all failed. Could you please share the zip file on another provider, ie Gdrive or Mega??

Thanks :slight_smile:


(Chong Thien Pow) #8

(Alex Miller) #9

Thanks mate, I have installed the google play services successfully with your guide and it works absolutely fine.

Only one thing that i noticed is that the output audio has some noise in the background.

I have a hdmi cable running between the BPI and my TV. For example when i play a movie in Kodi, the audio is good for a few seconds and then the noise comes in the background and goes away again and so forth. :frowning:

Is there any way that i can fix this issue??

I have tried with multiple different HDMI cables and had the same results. Thanks


(Chong Thien Pow) #10

It could be the rusty on cable’s male connector or female port at tv… it could be the power to pi is not stable… sometime its just because the “gains” are not matched for 2 different connected device which can be solved by adjusting it with a good equalizer software.


(Chong Thien Pow) #11

Another problem would be both 3.5mm audio jack and hdmi audio is enabled. You will have to disable either one.


(Alex Miller) #12

The HDMI connection is secure and clean on both side. About the headphone jack, any suggestions on how to disable it in android?

Other thing that I noticed is that the audio is completely fine when I play music on Spotify. The noise only starts when I play a video in YouTube or Kodi. Thanks


(Chong Thien Pow) #13

Can try look into SoundAbout app… not sure how well it work. Or u can look into developing ur own app to force select. I will try built a simple app to force select later when i got time.


(Alex Miller) #14

sure, yea i might give it a go. by the way i tried to root this image, but apparently the boot-loader is locked and i cant root the android. any idea about that?

Sorry to ask you a lot of questions tho :slight_smile:


(Chong Thien Pow) #15

busybox is already included in this image… if you want to modify the bootanimation or boot logo or put in root app… can just do adb root then adb remount


(Chong Thien Pow) #16

Btw i have just tested soundabout… its good to go… it also remove the problem of having a poping jeezzz sound every few seconds… force only 1 audio output is the way to go.


(Alex Miller) #17

Thanks a lot man, I’ll let you know how i go. :slight_smile:


(Sahaj Sarup) #18

i don’t know what i am missing

ric@ric-ubuntu:~/gapps$ adb push system / push: system/framework/com.google.android.media.effects.jar -> /framework/com.google.android.media.effects.jar failed to copy ‘system/framework/com.google.android.media.effects.jar’ to ‘/framework/com.google.android.media.effects.jar’: Read-only file system ric@ric-ubuntu:~/gapps$


(Edmilson Junior) #19

Hi all! anyone can help me? i try to install gapps but in the middle of process when i try to give the permision the i got an error on adb cosole “No device connected” now i try to flash my m64 with phoenixsuit but cat flash a new image