skip to Main Content

I have Flutter app for android(work with the network). the application works in debug mode. I create appbundle – download the console to Google, then download the universal apk file (for all platforms). But when I install the application from the store (that is, for a certain device – a certain platform), I have a problem with the operation of the application.
I managed to reproduce this issue locally on the computer:

  • I create appbundle
  • I will create a set of apks from appbundle(with bundletool)
  • then I install the apk on my phone(with bundletool) – the same problem

it also seems that the problem is related to abi. This is my code from build.gradle:

buildTypes {
        release {
            minifyEnabled false
            zipAlignEnabled false
            shrinkResources false
            signingConfig signingConfigs.release
            ndk.abiFilters 'x86', 'x86_64', 'armeabi-v7a', 'arm64-v8a'
        }
        debug {
            minifyEnabled false
            zipAlignEnabled false
            shrinkResources false
            signingConfig signingConfigs.release
            ndk.abiFilters 'x86', 'x86_64', 'armeabi-v7a', 'arm64-v8a'
        }
    }
    splits {
        abi {
            enable true //enables the ABIs split mechanism
            reset() //reset the list of ABIs to be included to an empty string
            include 'x86', 'x86_64', 'armeabi-v7a', 'arm64-v8a'
            universalApk true
        }
    }
..........

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

android.applicationVariants.all { variant ->
    variant.outputs.each { output ->
        output.outputFileName = "myapp_" + variant.versionName + "_" + output.getFilter(com.android.build.OutputFile.ABI) + ".apk"
        output.versionCodeOverride =
                project.ext.versionCodes.get(output.getFilter(com.android.build.OutputFile.ABI), 0) *
                        1000000 + android.defaultConfig.versionCode
    }
}

Configs for debug and release are same almost the same. but when i run in debug the app works.

how can I understand what is the cause of the error?
how could I join in debug mode to the release apk – but it’s probably not possible.

any advice – I will be very grateful

4

Answers


  1. Chosen as BEST ANSWER

    I fixed this issue - added it line to gradle.properties

      android.bundle.enableUncompressedNativeLibs=false
    

  2. Consider removing x86 because flutter doesn’t support it . and it will work fine.

    put this :

    release {
                minifyEnabled false
                zipAlignEnabled false
                shrinkResources false
                signingConfig signingConfigs.release
                ndk.abiFilters 'x86_64', 'armeabi-v7a', 'arm64-v8a'
            }
    

    instead of this :

    release {
                minifyEnabled false
                zipAlignEnabled false
                shrinkResources false
                signingConfig signingConfigs.release
                ndk.abiFilters 'x86', 'x86_64', 'armeabi-v7a', 'arm64-v8a'
            }
    
    Login or Signup to reply.
  3. enter image description hereRemoved the ndk.abiFilters ‘x86’, ‘x86_64’, ‘armeabi-v7a’, ‘arm64-v8a’

    Automatically showing google play store
    and apk install

    buildTypes {
    release {
    debuggable fale /// upload apk false
    minifyEnabled false
    shrinkResources false
    proguardFiles getDefaultProguardFile(‘proguard-android.txt’), ‘proguard-rules.pro’
    signingConfig signingConfigs.release
    }
    }

    enter image description here

    Login or Signup to reply.
  4. ndk.abiFilters ‘x86’, ‘x86_64’, ‘armeabi-v7a’, ‘arm64-v8a’
    why do you need abi filters? Did you try removing the above line?

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search