I have a Flutter app that keeps crashing on Android and iOS.
I don't get any stack trace. The app just minimize on iOS and Android.
I only get the crash report after some time has passed.
I am not getting what the issue is.
I think it is because of some memory issue.

Below is my Android build.gradle file. I am using ListView's that load images within a ListView.

        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.")
        }
        configurations.all {                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
                resolutionStrategy.eachDependency { DependencyResolveDetails details ->
                    def requested = details.requested
                    if (requested.group == "com.android.support") {
                        if (!requested.name.startsWith("multidex")) {
                            details.useVersion "26.+"
                        }
                    }
                }
                all*.exclude group: 'com.google.guava', module: 'listenablefuture'
            }
        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 from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
        android {
            compileSdkVersion 28
            compileOptions {
                sourceCompatibility 1.8
                targetCompatibility 1.8
            }
            lintOptions {
                disable 'InvalidPackage'
            }
            defaultConfig {
                // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
                applicationId "com.xxx.xxx"
                 minSdkVersion 24

                targetSdkVersion 28
                multiDexEnabled true
                versionCode flutterVersionCode.toInteger()
                versionName flutterVersionName
                 ndk {
                    abiFilters = []
                    abiFilters.addAll(ABI_FILTERS.split(';').collect{it as String})
                }
                testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
            }
            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 {
            testImplementation 'junit:junit:4.12'
            def supportLibVersion = rootProject.ext.supportLibVersion
            androidTestImplementation 'androidx.test:runner:1.1.1'                   
            androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'   
            implementation "androidx.appcompat:appcompat:$supportLibVersion"
        }
        apply plugin: 'com.google.gms.google-services'


Solution 1: karan sandhu

I think the issue is that you are using large size of images to load in a nested list view and i cannot see any database that means you are statically loading them from app itself. Which results in out of memory exception because the app is taking way too much memory.Please load that from a database like firebase or sql or load small png size images with low resolution.Hope it helps.