首页 > 解决方案 > GooglePlay64 位要求

问题描述

我正在使用 Nativescript 和 Angular 开发移动应用程序。当我将我的 apk 文件上传到 Google Play 商店时,它给了我如下所示的警告消息:此版本不符合 Google Play 64 位要求。从 2019 年 8 月 1 日起,所有版本都必须符合 Google Play 64 位要求。如果对此有一些经验,请分享我如何跟进解决此问题。

谢谢和最好的问候, Zaw Zaw Naing

标签: angular2-nativescript

解决方案


检查您的 APK 或 app bundle 是否有本机代码。在您的项目 App_Resources 目录 app.gradle 和 AndroidManifest.xml 文件中添加几行代码以创建应用程序包。

文件路径:- projectName -> App_Resources -> app.gradle :-

android {

  defaultConfig { 

    generatedDensities = []

    applicationId = "com.tcpi.tcpsales"

    ndk {
      abiFilters.clear()
    }

}

aaptOptions {

    additionalParameters "--no-version-vectors"

}

splits {

    abi {

      enable true //enables the ABIs split mechanism

      reset() //reset the list of ABIs to be included to an empty string

      include 'arm64-v8a', 'armeabi-v7a', 'x86'

      universalApk true

    }

  }

}

project.ext.abiCodes = ['armeabi-v7a': 1, 'arm64-v8a': 2, 'x86': 3]

android.applicationVariants.all { variant ->

    variant.outputs.each { output ->

        def baseAbiVersionCode = project.ext.abiCodes.get(output.getFilter("ABI"), 0)

        if (baseAbiVersionCode != null) {

            output.versionCodeOverride = baseAbiVersionCode * 100017 + variant.versionCode

        }

    }

}

def settingsGradlePath

if(project.hasProperty("appResourcesPath")) {

    settingsGradlePath = "$project.appResourcesPath/Android/settings.gradle";

} else {

    settingsGradlePath = "$rootDir/../../app/App_Resources/Android/settings.gradle";

}

def settingsGradleFile = new File(settingsGradlePath);

if(settingsGradleFile.exists())
{

    apply from: settingsGradleFile;

}

更改 Android 清单文件中的版本代码,例如:-

文件路径是 projectName -> App_Resources -> src -> AndroidManifest.xml :-

<?xml version="1.0" encoding="utf-8"?>

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
	
package="com.tcpi.tcpsales"
	
android:versionCode="2032"
	
android:versionName="2.32">


推荐阅读