1、将平台厂商提供的 GMS 包解压后所有文件扔到 vendor/google/ 目录下,没有 google文件夹自己创建下
2、修改如下文件,编译烧写
device/mediatek/common/BoardConfig.mk
@@ -201,7 +201,8 @@ ifeq ($(BUILD_GMS),yes) ifeq ($(strip $(MTK_AB_OTA_UPDATER)), yes) DONT_DEXPREOPT_PREBUILTS := false else - DONT_DEXPREOPT_PREBUILTS := true + # DONT_DEXPREOPT_PREBUILTS := true + DONT_DEXPREOPT_PREBUILTS := false endif else ifeq ($(TARGET_BUILD_VARIANT),userdebug)
device/mediatek/common/device.mk
@@ -927,7 +927,8 @@ ifeq ($(strip $(BUILD_GMS)), yes) # ifeq ($(strip $(BUILD_AGO_GMS)), yes) # $(call inherit-product-if-exists, vendor/go-gms/products/gms.mk) # else -$(call inherit-product-if-exists, vendor/google/gms.mk) +# $(call inherit-product-if-exists, vendor/google/gms.mk) +$(call inherit-product-if-exists, vendor/google/products/gms.mk) # endif
device/mediatek/common/device.mk
device/mediatek/system/common/device.mk
两个地方都一样,直接注释
@@ -3875,33 +3875,35 @@ endif # From Android Q, GMS devices must preload Google signed Mainline module release ifeq ($(BUILD_GMS), yes) # Mainline module overlay + # PRODUCT_PACKAGES += \ + # GoogleExtServicesConfigOverlay \ + # GooglePermissionControllerOverlay \ + # GooglePermissionControllerFrameworkOverlay + + # PRODUCT_PACKAGE_OVERLAYS += device/mediatek/common/overlay/mainline + + # # Mainline common and must APK + # PRODUCT_PACKAGES += \ + # GoogleExtServicesPrebuilt \ + # ModuleMetadataGooglePrebuilt \ + # GooglePermissionControllerPrebuilt + + # # Mainline other APK dependent on A-Go configuration + # ifneq ($(strip $(MTK_GMO_RAM_OPTIMIZE)), yes) + # PRODUCT_PACKAGES += \ + # GoogleDocumentsUIPrebuilt\ + # GoogleCaptivePortalLogin\ + # GoogleNetworkStack\ + # GoogleNetworkPermissionConfig + # PRODUCT_MAINLINE_SEPOLICY_DEV_CERTIFICATES := vendor/partner_modules/NetworkStackPrebuilt + # else + # PRODUCT_PACKAGES += \ + # InProcessNetworkStack \ + # PlatformCaptivePortalLogin \ + # PlatformNetworkPermissionConfig + # endif ifneq ($(call math_gt_or_eq,$(PRODUCT_SHIPPING_API_LEVEL),29),) # FBE device can support updatable APEX
device/mediateksample/编译项目名字/ProjectConfig.mk
@@ -88,6 +88,9 @@ MTK_AAL_SUPPORT = no MTK_AB_OTA_UPDATER = no MTK_AEE_SUPPORT = yes MTK_AGPS_APP = yes +#for GMS interface +BUILD_GMS=yes +BUILD_GMS_WITH_FASTPASS=yes MTK_AIV_SUPPORT = no