在AOSP Build上安装Google Apps [英] Install Google Apps on AOSP Build

查看:273
本文介绍了在AOSP Build上安装Google Apps的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经安装了 android-6.0.1_r72 Nexus 5 设备上的 AOSP Rom. rom不随 Google Apps 一起提供.

I have installed android-6.0.1_r72 AOSP Rom on a Nexus 5 device. The rom doesn't come with Google Apps.

我尝试从以下站点进行安装,但是安装后,我得到

I've tried to install from the following site, but after the installation I get

很遗憾,Google Play服务已停止

Unfortunately, Google Play services has stopped

我必须安装 Google App 的特殊版本吗?

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

更新:

我在logcat中发现此错误:

I found this error in logcat:

01-17 11:14:52.750 3525 5402 E AndroidRuntime:致命例外:GoogleLocationService

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

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

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"位置提供者需要ACCESS_FINE_LOCATION权限.

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:位于android.os.Parcel.readException(Parcel.java:1620)

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:在android.os.Parcel.readException(Parcel.java:1573)

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:位于android.location.ILocationManager $ Stub $ Proxy.addGpsStatusListener(ILocationManager.java:741)

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:位于android.location.LocationManager.addGpsStatusListener(LocationManager.java:1522)

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:在aker.a(:com.google.android.gms:1064)

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:位于akbc.b(:com.google.android.gms:6342)

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 akbc.handleMessage(:com.google.android.gms:279)

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

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:在android.os.Looper.loop(Looper.java:148)

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:位于android.os.HandlerThread.run(HandlerThread.java:61)

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

更新#2 :

我仍然收到错误消息,因此我在 GApps git .

I still get the error, so I've opened an issue in the GApps git.

推荐答案

您做错的三件事:
1.通常,您需要安装从要运行的同一版本的Android中提取的APK.
2.永远不要从非Google网站下载Google APK.
3.为了安装系统应用程序,您需要先将系统分区重新安装为可读写状态.

Three things you are doing wrong:
1. You generally need to install APK pulled from the same version of Android that you want to run.
2. Don't ever download Google APK from non-Google sites.
3. In order to install system apps you need to first remount the system partition as read-write.

以下是获取并安装正版Google APK作为系统应用程序的方法:

Here's how to get and then install genuine Google APK as system apps:

使用您的AOSP内置号码获取匹配的工厂图片
您为
AOSP代号提供的链接,标签和内部编号 具有您需要匹配的内部编号. 在页面上搜索 android-6.0.1_r72 ,相应的内部版本号为 M4B30X .

USE YOUR AOSP BUILD NUMBER TO GET THE MATCHING FACTORY IMAGE
The link you provided for AOSP Codenames, Tags, and Build Numbers has build numbers that you need to match. Search the page for android-6.0.1_r72 and the corresponding build number is M4B30X.

您可以直接从Google的好朋友的图片. 接下来,将cd放入下载图像的文件夹中,然后对SHA-256 Checksum进行检查:

Instead of using untrusted APK from random sites (a terrible idea) you can obtain genuine APK directly from the good folks at Google with the help of their Factory Images. Search the page for your build number M4B30X and download the image. Next, cd into the folder where you downloaded the image and run a check on the SHA-256 Checksum:

$ cd Downloads

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

它应该打印:Hammerhead-m4b30x-factory-10cfaa5c.zip:确定
-如果没有,请重新下载图像.

It should print: hammerhead-m4b30x-factory-10cfaa5c.zip: OK
-If not, download the image again.

FLASH FACTORY IMAGE and PULL GENUINE GOOGLE APK
1.刷新Factory Image并启动进入系统.
2.激活开发人员选项并允许"USB调试"
3.现在,使用ADB提取(获取)100%正版Google Play APK:

FLASH FACTORY IMAGE AND PULL GENUINE GOOGLE APK
1. Flash the Factory Image and boot into the system.
2. Activate Developer options and allow 'USB Debugging'
3. Now use ADB to pull(get) the 100% genuine Google Play APK:

$ 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 变体.

FLASH AOSP HAMMERHEAD M4B30X AND PUSH GENUINE GOOGLE APK
Make sure that you flash either the userdebug or eng variant.

将APK文件推送到您的SD卡:

Push APK files to your sdcard:

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

手动安装APK作为系统应用

$ sudo adb shell

找到系统分区: root @ hammerhead:/#安装| grep"/系统" 您应该回来: /dev/block/platform/msm_sdcc.1/by-name/system/system ext4 ro,seclabel,relatime,data = ordered 0 0

Locate system partition: root@hammerhead:/ # mount | grep "/system" You should get back: /dev/block/platform/msm_sdcc.1/by-name/system /system ext4 ro,seclabel,relatime,data=ordered 0 0

现在将该系统分区安装为rw(读写)

Now mount that system partition as 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键盘
浏览器
日历
相机
时钟
联系人
电子邮件
图库
Launcher3
消息传送
音乐
电话

*如果您出于某些原因不想禁用它,那么搜索看起来会很古怪.

Grant Google Apps Permissions
On your phone, go into Settings>Apps In the overflow menu (gear button upper right corner)
Select Show system
Navigate down to Google Play Store and allow it all of the permissions.
Do the same for Google Services Framework and Google Play Services (PrebuiltGmsCore).
Now make sure ALL of the default AOSP apps have their respective permissions granted.
AOSP by default comes with many permissions turned off.
Allow ALL permissions for the following apps:
Android Keyboard
Browser
Calendar
Camera
Clock
Contacts
Email
Gallery
Launcher3
Messaging
Music
Phone

*And the ever-janky looking Search, if for some reason you don't want to disable it.

现在,请确保已连接Wifi和/或您的SIM卡已插入并提供信号.
重新启动.
整理完所有内容后,您应该会遇到一些简短的错误,尽管如果错误仍然存​​在,则应重新启动才能解决该问题.

Now make sure that Wifi is connected and/or your SIM card is in and providing signal.
Reboot.
You should have some brief errors as everything gets sorted, although if the errors continue, another reboot should fix it.

这篇关于在AOSP Build上安装Google Apps的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆