> For the complete documentation index, see [llms.txt](https://docs.payments.thalescloud.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.payments.thalescloud.io/nfc-wallet-sdk-android/ja/get-started/configuration/1.-binary-integration/build-multiple-apks.md).

# 複数のAPKをビルドする

## 概要

APKのサイズを削減するには、CPUアーキテクチャ（ABI）ごとに1つのAPKを生成します。

背景情報については、AndroidのAPKスプリットに関するドキュメントを参照してください：\
<https://developer.android.com/build/configure-apk-splits>

NFC Wallet SDKは以下のABIをサポートしています：

* `armeabi-v7a` （32ビット）
* `arm64-v8a` （64ビット）

ABIスプリットを有効にすると、Gradleは各ABIごとに1つのAPKを生成します。 **デジタルウォレットアプリケーション**.

次の図は、32ビットおよび64ビットアーキテクチャ向けのAPKビルドを示しています。

<figure><img src="/files/34a33a07896a917c01ad27963b857dcaca0513ad" alt="Overview of splits for architecture"><figcaption><p>アーキテクチャのスプリットの概要</p></figcaption></figure>

{% hint style="info" %}

## サイズに関する考慮事項 <a href="#size-considerationbr" id="size-considerationbr"></a>

SDKのAARには、ネイティブの `.so` すべてのサポートされているABI向けのライブラリが含まれます。

* ユニバーサルAARのサイズ = size(`armeabi-v7a` `.so`) + size(`arm64-v8a` `.so`)
* ABIスプリットを使用すると、生成される各APKには1つの `.so`
* 32ビットAPKのサイズ ≈ size(`armeabi-v7a` `.so`) + その他のアプリケーションコンポーネント
  {% endhint %}

## 複数APKのビルドを構成する <a href="#configure-split" id="configure-split"></a>

アプリモジュールのビルドファイルで：

* ABIスプリットを有効にして、Gradleが各ABIごとに1つのAPKを生成するようにします。
* 次のようなAPK名が生成されます： `appname-abi-buildType.apk` （例えば、 `mpa-arm64-v8a-debug.apk`).
* 複数のAPKを公開する場合は、アップロード前に各APKに固有の `versionCode` を割り当ててください。\
  参照： <https://developer.android.com/studio/build/configure-apk-splits#configure-APK-versions>

{% tabs %}
{% tab title="Groovy (build.gradle)" %}
{% code title="app/build.gradle" %}

```groovy
android {
    splits {
        // ABIごとに1つのAPKを生成します。
        abi {
            enable true
            reset()
            include "armeabi-v7a", "arm64-v8a"

            // すべてのABIを含むユニバーサルAPKを生成しないでください。
            universalApk false
        }
    }
}
```

{% endcode %}
{% endtab %}

{% tab title="Kotlin (build.gradle.kts)" %}
{% code title="app/build.gradle.kts" %}

```kotlin
android {
    splits {
        abi {
            isEnable = true
            reset()
            include("armeabi-v7a", "arm64-v8a")
            isUniversalApk = false
        }
    }
}
```

{% endcode %}
{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.payments.thalescloud.io/nfc-wallet-sdk-android/ja/get-started/configuration/1.-binary-integration/build-multiple-apks.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
