> 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 を生成します。

背景については、APK 分割に関する Android のドキュメントを参照してください:\
<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="https://4053702943-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0KuRpRJHT65Q5KFpOJb4%2Fuploads%2FtkCgxqMeU3dNgUNRVn9i%2Fimage.png?alt=media&amp;token=666912a0-7a54-4859-b203-c2cd1b277192" 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>

app モジュールの build ファイルで:

* ABI 分割を有効にして、Gradle が ABI ごとに 1 つの APK を生成するようにします。
* 次のような APK 名を想定してください `appname-abi-buildType.apk` (たとえば、 `mpa-arm64-v8a-debug.apk`).
* 複数の APK を公開する場合は、一意の `versionCode` を Google Play にアップロードする前に、APK ごとに割り当ててください。\
  参照: <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.
