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.