Generate android App Bundle with x86 version

1,443

The x86 architecture is not supported at this time.

https://flutter.dev/docs/deployment/android#what-are-the-supported-target-architectures

Share:
1,443
GunJack
Author by

GunJack

I don't worry about life as I know, I am not going to survive it anyways.

Updated on December 23, 2022

Comments

  • GunJack
    GunJack over 1 year

    I use flutter to develop my app. However, to generate an app bundle and upload it to play console, I use Android Studio (Build -> Generate Signed Apk).

    In flutter I have the option of generating three distinct apks for three architectures (arm, arm64 and x86(64?)) through flutter build commands. However when I generate signed app bundle from Android Studio and upload it play console, I only get two build variants or abi (arm64-v8a, armeabi-v7a). How do I make my app bundle include an x86 abi?

    Additional: I only use Android Studio to generate App Bundle. I use VS Code to write these apps.

    Edit: The module/App level 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"
    }
    
    • Spatz
      Spatz over 3 years
      Can you show build.gradle content?
    • GunJack
      GunJack over 3 years
      The project level or the module level?
    • Spatz
      Spatz over 3 years
    • Spatz
      Spatz over 3 years
      Does this answers your question?
  • GunJack
    GunJack over 3 years
    NDK? Are you sure? I am not using the NDK.
  • miken32
    miken32 almost 2 years
    Copied without attribution from stackoverflow.com/a/56112744