khoren93 / flutter_zxing

Flutter plugin for scanning and generating QR codes using the ZXing library, supporting Android, iOS, and desktop platforms
https://pub.dev/packages/flutter_zxing
MIT License
89 stars 50 forks source link

Crash Release Android x86 #67

Closed rod-moraes closed 1 year ago

rod-moraes commented 1 year ago

This bug is reproducible when you generate the app using in release mode and you open it in an x86 or arm32 emulator

If you are having issues opening an app on your x86 or arm32 emulator, you may be seeing the following error message: "{AppName} consistently crashes". This may be caused by the fact that Flutter does not support x86 files, as mentioned in this link: https://docs.flutter.dev/deployment/android#what-are-the-supported-target-architectures. According to the documentation, Flutter currently does not offer support for generating x86 files for Android (see Issue 9253).

This can be a particularly problematic when you are trying to use packages that depend on resources such as the camera or MLKit. To resolve this issue, you can edit the 'build.grandle' file in the 'app' folder and add the following lines to prevent the generation of x86 files:

   defaultConfig {
        ndk {
            abiFilters 'armeabi-v7a','arm64-v8a','x86_64'
        }
    }

This should help resolve the issue and allow you to open the app on the emulator without errors. It is important to remember that Flutter currently only supports the armeabi-v7a (ARM 32-bit), arm64-v8a (ARM 64-bit), and x86-64 (x86 64-bit) target architectures. Therefore, when editing the 'build.grandle' file, it is important to ensure that you are only including these architectures.