生成x86版本的android应用程序包

生成x86版本的android应用程序包,android,android-studio,flutter,abi,android-app-bundle,Android,Android Studio,Flutter,Abi,Android App Bundle,我使用flutter开发我的应用程序。然而,为了生成应用程序包并将其上传到游戏控制台,我使用Android Studio(Build->generate-Signed-Apk) 在颤振中,我可以选择通过颤振构建命令为三种体系结构(arm、arm64和x86(64?)生成三种不同的APK。然而,当我从Android Studio生成已签名的应用程序包并将其上传到play console时,我只得到两个构建变体或abi(arm64-v8a、armeabi-v7a)。如何使我的应用程序包包含x86 a

我使用flutter开发我的应用程序。然而,为了生成应用程序包并将其上传到游戏控制台,我使用Android Studio(Build->generate-Signed-Apk)

在颤振中,我可以选择通过颤振构建命令为三种体系结构(arm、arm64和x86(64?)生成三种不同的APK。然而,当我从Android Studio生成已签名的应用程序包并将其上传到play console时,我只得到两个构建变体或abi(arm64-v8a、armeabi-v7a)。如何使我的应用程序包包含x86 abi

附加:我只使用Android Studio生成应用程序包。我使用VS代码编写这些应用程序

编辑:模块/应用程序级别build.gradle

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
    localPropertiesFile.withReader('UTF-8') { reader ->
        localProperties.load(reader)
    }
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
    throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
    flutterVersionCode = '1'
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
    flutterVersionName = '1.0'
}

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'com.google.gms.google-services'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
    compileSdkVersion 29

    sourceSets {
        main.java.srcDirs += 'src/main/kotlin'
    }

    lintOptions {
        disable 'InvalidPackage'
    }

    defaultConfig {
        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
        applicationId "com.spayro.spayroshop"
        minSdkVersion 21
        targetSdkVersion 29
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
    }

    buildTypes {
        release {
            // TODO: Add your own signing config for the release build.
            // Signing with the debug keys for now, so `flutter run --release` works.
            signingConfig signingConfigs.debug
        }
    }
}

flutter {
    source '../..'
}

dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}

请将此代码放入您的gradle中:

ndk.abiFilters 'armeabi-v7a','arm64-v8a','x86','x86_64'
范例

    android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.test.test"
        minSdkVersion 21
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        ndk.abiFilters 'armeabi-v7a','arm64-v8a','x86','x86_64'
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
}

目前不支持x86体系结构


NDK?你确定吗?我没有使用NDK。你能显示
build.gradle
内容吗?项目级还是模块级?模块级回答你的问题吗?