Install Google Apps on AOSP Build

I installed android-6.0.1_r72 AOSP Rom on a Nexus 5 device. Rod does not ship with Google Apps.

I tried installing from the following site , but after installation I get

Sorry, Google Play services have stopped

Is there a special version of Google Apps that I have to install?

UPDATE:

I found this error in logcat:

01-17 11:14: 52.750 3525 5402 E AndroidRuntime: FATAL EXCEPTION: GoogleLocationService

01-17 11:14: 52.750 3525 5402 E AndroidRuntime: Process: com.google.android.gms.persistent, PID: 3525

01-17 11:14: 52.750 3525 5402 E AndroidRuntime: java.lang.SecurityException: gps location provider requires ACCESS_FINE_LOCATION permission.

01-17 11:14: 52.750 3525 5402 E AndroidRuntime: at android.os.Parcel.readException(Parcel.java:1620)

01-17 11:14: 52.750 3525 5402 E AndroidRuntime: at android.os.Parcel.readException(Parcel.java:1573)

01-17 11:14: 52.750 3525 5402 E AndroidRuntime: at android.location.ILocationManager $Stub $Proxy.addGpsStatusListener(ILocationManager.java:741)

01-17 11:14: 52.750 3525 5402 E AndroidRuntime: at android.location.LocationManager.addGpsStatusListener(LocationManager.java:1522)

01-17 11:14: 52.750 3525 5402 E AndroidRuntime: at aker.a(: com.google.android.gms: 1064)

01-17 11:14: 52.750 3525 5402 E AndroidRuntime: at akbc.b(: com.google.android.gms: 6342)

01-17 11:14: 52.750 3525 5402 E AndroidRuntime: at akbc.handleMessage(: com.google.android.gms: 279)

01-17 11:14: 52.750 3525 5402 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102)

01-17 11:14: 52.750 3525 5402 E AndroidRuntime: at android.os.Looper.loop(Looper.java:148)

01-17 11:14: 52.750 3525 5402 E AndroidRuntime: at android.os.HandlerThread.run(HandlerThread.java:61)

# 2:

, GApps git.

+4
4

, :
1. APK, Android, .
2. APK Google , Google.
3. , -.

, , APK Google :

AOSP FACTORY
, AOSP Codenames, Tags , , . android-6.0.1_r72, M4B30X.

APK ( ) APK Google Factory . M4B30X . cd , , SHA-256:

$ cd Downloads

$ echo "10cfaa5c8ff1753af20283f5e5f938ddebbad094c4e22aadbd925ecdc806e8b3   
  hammerhead-m4b30x-factory-10cfaa5c.zip" | sha256sum -c

: hammerhead-m4b30x- factory -10cfaa5c.zip: OK
- , .

FLASH FACTORY IMAGE PULL GENUINE GOOGLE APK
1. FACTORY .
2. " USB"
3. ADB, () 100% APK Google Play:

$ adb pull /system/priv-app/GoogleServicesFramework/GoogleServicesFramework.apk
$ adb pull /system/priv-app/Phonesky/Phonesky.apk
$ adb pull /system/priv-app/PrebuiltGmsCore/PrebuiltGmsCore.apk

FLASH AOSP HAMMERHEAD M4B30X PUSH GENUINE GOOGLE APK
, userdebug eng.

APK SD-:

$ adb push GoogleServicesFramework.apk /sdcard/
$ adb push Phonesky.apk /sdcard/
$ adb push PrebuiltGmsCore.apk /sdcard/

MANUALLY INSTALL APK AS SYSTEM APPS

$ sudo adb shell

: root @hammerhead:/# mount | grep "/system" : /dev/block/platform/msm _sdcc.1/by-name/system/system ext4 ro, seclabel, relatime, data = ordered 0 0

rw (read-write)

root@hammerhead:/ # mount -o remount,rw -t ext4 /dev/block/platform/msm_sdcc.1/by-name/system /system 

root@hammerhead:/ # cd /system/priv-app   
root@hammerhead:/ # mkdir GoogleServicesFramework
root@hammerhead:/ # mkdir Phonesky
root@hammerhead:/ # mkdir PrebuiltGmsCore

root@hammerhead:/ # cp /sdcard/GoogleServicesFramework.apk GoogleServicesFramework/GoogleServicesFramework.apk
root@hammerhead:/ # cp /sdcard/Phonesky.apk Phonesky/Phonesky.apk
root@hammerhead:/ # cp /sdcard/PrebuiltGmsCore.apk PrebuiltGmsCore/PrebuiltGmsCore.apk

root@hammerhead:/ # chmod 755 GoogleServicesFramework
root@hammerhead:/ # chmod 755 Phonesky
root@hammerhead:/ # chmod 755 PrebuiltGmsCore

root@hammerhead:/ # chmod 644 GoogleServicesFramework/GoogleServicesFramework.apk
root@hammerhead:/ # chmod 644 Phonesky/Phonesky.apk
root@hammerhead:/ # chmod 644 PrebuiltGmsCore/PrebuiltGmsCore.apk

AOSP

Google Apps
> ( )

Google Play .
Google Services Framework Google Play (PrebuiltGmsCore).
, AOSP .
AOSP .
:
Android-





Email

Launcher3



* , - .

, Wi-Fi / SIM- .
Reboot.
, , , , .

+8

AOSP.

, , Google Play Google .

+1

andDevW answer .

. FLASHing FACTORY IMAGE PULL GENUINE GOOGLE APK,

simg2img system.img

  • simg2img .img .raw
simg2img /home/<user>/../aosp/../out/system.img system.raw
  1. ext4
sudo mount -t ext4 -o loop system.raw /system

system.raw , /priv -app , , /system.

, apks system.img FACTORY Google.

+1

, , Runtime, , Android API 23 (Marshmallow onwards). , , , , , .

Google . API 23 , , - DANGEROUS, . - https://developer.android.com/training/permissions/requesting.html

, . , , , API 23 . , , , , , ( ).

In short, try to find a version of the application designed for Marshmallow and up. Unfortunately, Google has made this change in a way that limits backward compatibility to some extent. Therefore you cannot run away. Find a newer version

0
source

Source: https://habr.com/ru/post/1667001/


All Articles