RTAndroid

1,415 views
Skip to first unread message

Juergen Rieger

unread,
Aug 21, 2016, 6:02:58 AM8/21/16
to Android-rpi
Hello Mr Kalkov,
I have tried to install GAPPS with your script gapps.sh. I have only Windows at my PC, so I to have first built the folder "sys" at my Raspberry PI with your script to the step: "for ..done".
The rest from your script I have manuell execute at my Windows.
The entry point at windows in your script: adb root ... until the end of the script.
Finally, I start Android at Raspberry Pi. Anroid hangs at "Unfortufortunately, Google Playservicees has stopped" and "Unfortunately, Setupwizard has stopped". This message disappears not from the screen.
regards Jürgen Rieger

Aradyn

unread,
Aug 21, 2016, 8:45:11 AM8/21/16
to Android-rpi
Juergen,

Resolution: Those are the error messages received when the script does not run completely through. After the PI reboots the first time, you have to fight through those error messages to get wifi re-enabled, then the script installs the permissions for the applications and reboots the PI a second time. So the solution, re-run the script, make sure after PI3 reboots once you get wifi enabled and CONNECTED quickly, then the script will take off and reboot PI3 again and your problem should be solved.

Side notes: Very interesting technique building the SD card on the PI itself and then executing the final script from Windows. I hadn't thought of that. I am curious, what all from that script is executing from Windows. I.E. is there anything in that script that would conflict with windows, which I don't think there is.

Igor Kalkov

unread,
Aug 21, 2016, 4:37:35 PM8/21/16
to Android-rpi
Sorry guys, I had to mention that I'm using an ethernet cable, so I automatically get an ADB connection after boot. I didn't think about people who have to activate wifi after the first boot.
Aradyn is right, you have to fix the permissions before your device will be able to boot. The script has following parts:

1) Download OpenGapps - you can also do it from windows.
2) Extract the needed apps - also doable from windows. You don't need to build the "sys" directory separately, all the apps / files / settings can be immediately pushed to the correct location on the RPi (maybe even offline - I didn't check that).
3) Apps are pushed to the system partition, so it has to be writeable (adb root + adb remount)

Now comes the challenge: GApps require several permissions to be set, but the package manager doesn't know the apps are there yet. Trying to set them now will just fail. This is why you need the first reboot - the package manager detects new apps automatically and set them up. But Android will also try to start them after the system boots up, although the permissions are still missing. My script just waits (with ethernet cable connected) until the device is ready and finishes the installation. There are two things you can try:

- Use ethernet cable (easy)
- Write an own script for waiting for the system to boot up, remount the system partition and apply permissions. put the script in /system/etc/init.d/, it will be executed automatically on the next boot.
- Try to close your error messages and connect using wifi.

Hary Ayala

unread,
Aug 22, 2016, 3:03:44 AM8/22/16
to Android-rpi
I don't have access to ADB over linux since i'm running it from a usb stick, so i did it a bit differently

What I did was this, I executed the script so it downloaded and extracted the files then created it's own folders, once the script started waiting for ADB, i closed it
after that, I moved the sys folder over to the system partition on the sd card (I was doing this on the linux machine itself)
then I moved the sdcard to the Pi and booted

after you start getting errors, just keep accepting and after a few minutes it stops, at that point go to the settings -> apps
select google play services and play store and enable all permissions for them, then reboot and you're done.

Igor Kalkov

unread,
Aug 22, 2016, 6:37:33 AM8/22/16
to Android-rpi
That's an interesting approach. Thanks for sharing, Hary.

May I ask what exaclty is different, if you boot Linux from USB stick? I always thought you get a fully functional system regardless of boot partition.

Aradyn

unread,
Aug 23, 2016, 10:32:01 AM8/23/16
to Android-rpi
I believe he is running a Live CD version of Linux instead of Linux itself. Basically the same, but you can't make changes that stay permanent.

Hary thanks for the heads up on setting the permissions up that way, I will have to give that a try. Just a side note, have you considered running your Linux via a VR Box? I run my linux off a USB drive as well, but I run it as a VR box so I can save it/have internet access/etc.

Hary Ayala

unread,
Aug 23, 2016, 11:54:34 AM8/23/16
to Android-rpi
Hmm... It seems I might have accidentally private messaged Igor, I answered this thread yesterday :P

Aradyn, I have a laptop with ubuntu as the OS, but it kept corrupting the installation, it was your question about that which made me test from a usb stick on a different one
but since I don't need much from linux on this machine other than writting images, I am just running it from the USB stick for simplicity's sake
I ran the script the way I did, because i'm just not trusting the linux machine with access to my sdcard anymore :P

Juergen Rieger

unread,
Aug 24, 2016, 4:32:26 AM8/24/16
to Android-rpi
Hello Igor,
thank you for your answer.
I'll try your suggestion. However, I have difficulty your script (wait for an answer from Andrioid to root, reboot) at my windows PC.
My problem seems to be, I have not executed this part off the shell-script:

echo " * Applying correct permissions..."
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"

echo " * Waiting for ADB..."
wait_for_adb

...
...
...
wait_for_adb()
{
  while true; do
    sleep 1
    adb kill-server > /dev/null
    adb connect $address > /dev/null
    if is_booted; then
      break
    fi
  done
}

How I solve this in Windows, thats my problem.

regards Jurgen



Igor Kalkov

unread,
Aug 24, 2016, 6:06:14 AM8/24/16
to Android-rpi
If I get you right, you have no ADB connection after the reboot? Just for clarification:
- Is the first reboot (before permissions are applied) or second reboot (after permissions are applied)?
- Do you use an ethernet cable or wifi?
- Did you try Hary's approach without ADB?

Juergen Rieger

unread,
Aug 24, 2016, 11:48:40 AM8/24/16
to Android-rpi

Hello Igor,

- Is the first reboot (before permissions are applied) or second reboot (after permissions are applied)?
        I have not doing anything I could affect permissions.

- Do you use an ethernet cable or wifi?
        I use a Ethernet connection.


- Did you try Hary's approach without ADB?
        I have the Folder "sys" generated and then transmitted via "ADB connect ..." and "ADB push ....."
        After this procedure, I have
started Android with "ADB reboot bootloader ".
       This corresponds to what Hary has performed.
       Android was started and
  Anroid hangs at "Unfortufortunately, Google Playservicees has stopped" and "Unfortunately, Setupwizard has stopped".
       I could not change the Android settings, because constantly appeared messages on the screen.
regards Jurgen

Hary Ayala

unread,
Aug 24, 2016, 12:32:48 PM8/24/16
to Android-rpi
Juergen, I think I see what your problem is, i tested on windows and what i'm getting is, while services is crashed, adb connects to the pi and immediately disconnects, so the script can't proceed...
This seems to not happen in linux tho...

2 Options from what I can see, 

use an old adb binary that might stay connected through the errors, I don't know linking policy here, so search on google for standalone adb, you'll find a old xda thread with one you can use
or
leave the pi alone for a few minutes, don't close the error dialogs, so that the services stop trying to refresh so often that they won't let you do anything and see if they give you enough time to get into the settings.

Juergen Rieger

unread,
Aug 24, 2016, 2:23:08 PM8/24/16
to Android-rpi
Hello Hary,
I have waited for a long, long time after boot Android, always appears "Unfortunately, Setup Wizzard has stopped". I click always at OK and always "Unfortunately, Setup Wizzard has stopped". I can do nothing at Android.
regards Jurgen

Juergen Rieger

unread,
Aug 24, 2016, 2:38:02 PM8/24/16
to Android-rpi
Hello Hary,
a new situation. I have removed the messages on my Android. I have the commands:


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"

started at Windows. And now I can open and visit the google Play Store.
many thanks for your helps.
regards Jurgen

Message has been deleted

Tony Riley

unread,
Oct 9, 2016, 11:48:59 PM10/9/16
to Android-rpi
Hi all cant seem to get install on 32 gig samsung evo sd card anyone know why I am using ubuntu lts16 live cd I used cheap card and it was only 16 gigs it flashed but got blank screen 

Igor Kalkov

unread,
Oct 10, 2016, 9:36:38 AM10/10/16
to Android-rpi
Hey, I'm using Samsung Evo 64 GB Card, which is working fine. Do you get any errors while installing?

meng....@gmail.com

unread,
Nov 16, 2016, 8:01:41 PM11/16/16
to Android-rpi
Hi Igor,

I'm trying to get the script running but I've noticed a few strange errors occurring when the packages are being extracted:
 * Extracting supplied packages...
tar (child): lzip: Cannot exec: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
----<<<< THIS GOES ON FOR A WHILE... >>>>----
tar (child): lzip: Cannot exec: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
 * Creating local system partition...
ls: cannot access gapps/tmp/*: No such file or directory
  - including gapps/tmp/*/
rsync: change_dir "/home/herpderp/rpi3android//gapps/tmp/*/" failed: No such file or directory (2)
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1183) [sender=3.1.1]
 * Waiting for ADB...
 * Pushing system files...
0 files pushed. 0 files skipped.

Very much wondering what you make of this...
I've saved the entire log in case you want to take a look at it.

Igor Kalkov

unread,
Nov 17, 2016, 4:38:19 AM11/17/16
to Android-rpi, meng....@gmail.com
tar (child): lzip: Cannot exec: No such file or directory

sudo apt-get install lzip
Reply all
Reply to author
Forward
0 new messages