Flutter app is experiencing crashes on Android 13 and above when attempting to select an image using the image_picker

218 views Asked by At

My Flutter app is experiencing crashes on Android 13 and above when attempting to select an image using the image_picker plugin. The application functions correctly on Android 12 and below. The error message displayed simply states 'Lost Device Connection.'

Regards,

1

There are 1 answers

0
WizardKing On

Try following methods (note : these are not steps)

  1. Make sure you have necessary permission in AndroidManifest.xml file

    If not try adding this permissions

    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    
  2. Update or downgrade image_picker plugin

  3. If this happening after flutter sdk update then downgrade sdk

  4. Enable multidex in app/build.gradle

    defaultConfig {
        .......
        minSdkVersion 21
        targetSdkVersion 28 
        multiDexEnabled true
        .......
     }
    
    dependencies {
        .....
        implementation 'com.google.firebase:firebase-core:16.0.9'
        compile  'com.android.support:multidex:1.0.3'
     }