liyuanhust / flutter_simple_pdf_viewer

Apache License 2.0
5 stars 8 forks source link

Why is x86 abi filter needed? #6

Open nareddyt opened 3 years ago

nareddyt commented 3 years ago

README.md recommends configuring the following abiFilters:

 release {
            ndk {
                abiFilters "armeabi-v7a", "x86"
            }
        }

But why is x86 needed? According to the flutter documentation, x86 is not supported. https://flutter.dev/docs/deployment/android#what-are-the-supported-target-architectures

When building your application in release mode, Flutter apps can be compiled for armeabi-v7a (ARM 32-bit), arm64-v8a (ARM 64-bit), and x86-64 (x86 64-bit). Flutter does not currently support building for x86 Android (See Issue https://github.com/flutter/flutter/issues/9253).

Setting x86 tells Google Play Store that the flutter app supports this ABI, even though flutter does not. This results in the app crashing on open by x86 phones. Is it safe to remove this?

mrverdant13 commented 2 years ago

This is true.

As stated in the Flutter docs:

When building your application in release mode, Flutter apps can be compiled for armeabi-v7a (ARM 32-bit), arm64-v8a (ARM 64-bit), and x86-64 (x86 64-bit). Flutter does not currently support building for x86 Android.

Thus, the following filtering setup is the proper one:

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