エラー:競合する構成:ndkabiFiltersの「arm64-v8a」は分割時に存在できません...



Error Conflicting Configuration



Android official website 2019年8月1日以降、GooglePlayで公開されるアプリは64ビットアーキテクチャをサポートする必要があることに注意してください。 64ビットCPUは、ユーザーに高速で豊かなエクスペリエンスを提供できます。 64ビットアプリケーションバージョンを追加すると、パフォーマンスが向上し、将来のイノベーションの条件が作成されるだけでなく、64ビットアーキテクチャのみをサポートするデバイスの準備もできます。

による Android official website 設定のプロンプトは非常に簡単ですが、長い時間がかかりました。



この間違いをここに記録して、自分が再び間違いを犯さないようにします^ _ ^

最適化されたApKサイズのABIフィルターとAPK分割



遊びたいapk複数のアーキテクチャが含まれていますso library次の構成が必要です。

android { ... // Other configuration defaultConfig { ... // default allocation ndk { //Select the .so library corresponding to the cpu type to be added. abiFilters 'armeabi', 'armeabi-v7a' // You can also add // 'arm64-v8a', 64 bit ARM architecture,it can use v7 version // unless you are too much concerned about performance // mips,mips64, There are no devices with MIPS // x86_64, No android devices and anyway it can use X86 version // armeabi, very old architecture. Unsupported after Android 4.4 // 'x86', Intel based devices } } ... // Other configuration }

複数の異なるアーキテクチャを構築したいapkパッケージ、使用可能ABI分割には、次の構成が必要です。

android { ... // Other configuration splits { abi { reset()//Reset the ABI list to only contain an empty string (used with include can indicate which ABI to use, not which ABI to exclude) enable true // Set to true to enable the ABI split mechanism to generate different apk files according to the architecture when packaging universalApk false // If true, build support for all platform abi types, build a package containing so of multiple architectures (as long as there is any code in the code, it will be entered) include 'armeabi-v7a', 'armeabi' // Set all abi types to be supported, build multiple packages, each package contains only one architecture so exclude 'x86' // Set all abi types not to be supported } } }

この構成を行う方法はありませんapk必要な複数のアーキテクチャのみを含めてください〜!



エラー

2つを一緒に構成すると、次のエラーが報告されます。

ERROR: Conflicting configuration : 'arm64-v8a' in ndk abiFilters cannot be present when splits abi filters are set : armeabi

なぜならABI分割includeはい、ndk abiFilters相互に排他的な操作

総括する

  • 2つのメソッドが別々に構成されている場合に実行できます
  • 2つの方法は、エラーを報告せずに一緒に構成されます(ABI split note adjustment include)、ABI分割は有効になりません

記事はここで終了します。他に連絡が必要な場合は、メッセージを残すことができます。

著者の記事をもっと読みたい場合は、私をチェックしてください 個人ブログ そして公開番号:

画像