Name:
interface
Value:
Amplify has re-imagined the way frontend developers build fullstack applications. Develop and deploy without the hassle.

プラットフォーム設定

iOS

iOSをターゲットにする場合、Amplifyには最小デプロイメントターゲット13.0以上およびXcode 15.0以上が必要です。以下の手順に従って、最小デプロイメントターゲットを更新してください。

ios/Podfileを開き、ターゲットiOSプラットフォームを13.0以上に更新します。

ios/Podfileが存在しない場合は、pubspec.yamlamplify_flutterを追加してpub getを実行してください。これでファイルが自動的に作成されます。

ios/Podfile
- # Uncomment this line to define a global platform for your project
- # platform :ios, '12.0'
+ platform :ios, '13.0'

Xcodeでプロジェクトを開き、Runner、Targets -> Runnerの順に選択し、「General」タブをクリックします。「Minimum Deployments」セクションで、iOSバージョンを13.0以上に更新します。

ランナー一般ウィンドウの最小デプロイメントセクションでiOSバージョンを13.0以上に設定

Runner、Project -> Runnerの順に選択し、「Build Settings」タブをクリックします。「iOS Deployment Target」を13.0以上に更新します。

ランナー情報ウィンドウのデプロイメントターゲットセクションでiOSバージョンを13.0以上に設定

Android

Amplify FlutterはAPIレベル24以上(Android 7.0以上)をサポートしており、Androidをターゲットにする場合、Gradle 8以上、Kotlin 1.9以上、Java 17以上が必要です。以下の手順に従って、アプリケーションでこれらの変更を適用してください。

以下の手順は、Flutter 3.16以降で作成されたFlutterアプリを対象としています。アプリがバージョン3.16より前に作成された場合は、以下の手順に従う前にこちらのガイドに従ってGradleの宣言的プラグインブロックに移行してください。

  1. android/settings.gradle.ktsを開き、Android GradleプラグインとKotlinのバージョンを更新します:
android/settings.gradle.kts
plugins {
id("dev.flutter.flutter-plugin-loader") version "1.0.0"
- id("com.android.application") version "8.7.0" apply false
- id("org.jetbrains.kotlin.android") version "1.8.22" apply false
+ id("com.android.application") version "8.12.1" apply false
+ id("org.jetbrains.kotlin.android") version "2.2.0" apply false
}
  1. android/gradle/wrapper/gradle-wrapper.propertiesを開き、Gradle distributionUrlを更新します。
android/gradle/wrapper/gradle-wrapper.properties
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-all.zip
  1. android/app/build.gradle.ktsを開き、Javaバージョンと最小AndroidSDKバージョンを更新します。
android/app/build.gradle.kts
android {
namespace = "com.example.myapp"
compileSdk = flutter.compileSdkVersion
ndkVersion = flutter.ndkVersion
compileOptions {
- sourceCompatibility = JavaVersion.VERSION_1_8
- targetCompatibility = JavaVersion.VERSION_1_8
+ sourceCompatibility = JavaVersion.VERSION_17
+ targetCompatibility = JavaVersion.VERSION_17
}
kotlinOptions {
- jvmTarget = JavaVersion.VERSION_11.toString()
+ jvmTarget = JavaVersion.VERSION_17.toString()
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId = "com.example.myapp"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
- minSdk = flutter.minSdkVersion
+ minSdk = 24
targetSdk = flutter.targetSdkVersion
versionCode = flutterVersionCode.toInteger()
versionName = flutterVersionName
}
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig = signingConfigs.debug
}
}
}
  1. android/settings.gradleを開き、Android GradleプラグインとKotlinのバージョンを更新します:
android/settings.gradle
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
- id "com.android.application" version "7.3.0" apply false
- id "org.jetbrains.kotlin.android" version "1.7.10" apply false
+ id "com.android.application" version "8.12.1" apply false
+ id "org.jetbrains.kotlin.android" version "2.2.0" apply false
}
  1. android/gradle/wrapper/gradle-wrapper.propertiesを開き、Gradle distributionUrlを更新します。
android/gradle/wrapper/gradle-wrapper.properties
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-7.0-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-all.zip
  1. android/app/build.gradleを開き、Javaバージョンと最小AndroidSDKバージョンを更新します。
android/app/build.gradle
android {
namespace = "com.example.myapp"
compileSdk = flutter.compileSdkVersion
ndkVersion = flutter.ndkVersion
compileOptions {
- sourceCompatibility = JavaVersion.VERSION_11
- targetCompatibility = JavaVersion.VERSION_11
+ sourceCompatibility = JavaVersion.VERSION_17
+ targetCompatibility = JavaVersion.VERSION_17
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId = "com.example.myapp"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
- minSdk = flutter.minSdkVersion
+ minSdk = 24
targetSdk = flutter.targetSdkVersion
versionCode = flutterVersionCode.toInteger()
versionName = flutterVersionName
}
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig = signingConfigs.debug
}
}
}

より高いバージョンのGradleまたはAndroid Gradleプラグインを使用したい場合は、こちらの互換性マトリックスを参照してください。

リリースビルドのネットワークパーミッション

Flutterアプリはデバッグモードではデフォルトでネットワークリクエストを作成するアクセス権を持っています。このパーミッションはリリースモードでビルドする場合に追加する必要があります。これを行うには、android/app/src/main/AndroidManifest.xmlを開き、以下の追加を行います。

android/app/src/main/AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.INTERNET"/>
...
</manifest>

Web

Webをターゲットにする場合、Amplify固有の要件やセットアップ手順はありません。Flutterがサポートするブラウザを使用する必要があります。詳細は以下のFlutterドキュメントを参照してください:

macOS

macOSをターゲットにする場合、Amplifyには最小デプロイメントターゲット10.15以上およびXcode 15.0以上が必要です。さらに、ネットワーク、キーチェーンのエンタイトルメント、およびコード署名を有効にする必要があります。

最小バージョンの更新

macos/Podfileを開き、ターゲットmacOSプラットフォームを10.15以上に更新します。

macos/Podfileが存在しない場合は、pubspec.yamlamplify_flutterを追加してpub getを実行してください。これでファイルが自動的に作成されます。

ios/Podfile
- platform :osx, '10.14'
+ platform :osx, '10.15'

Xcodeでプロジェクトを開き、Runner、Targets -> Runnerの順に選択し、「General」タブをクリックします。「Minimum Deployments」セクションで、macOSバージョンを10.15以上に更新します。

ランナー一般セクションの「Minimum Deployments」タブでmacOSバージョンを10.15以上に設定

Runner、Project -> Runnerの順に選択し、「Info」タブをクリックします。「macOS Deployment Target」を10.15以上に更新します。

ランナー情報セクションの「macOS Deployment Target」タブでmacOSバージョンを10.15以上に設定

ネットワーク呼び出しを有効にする

Xcodeでプロジェクトを開き、Runner、Targets -> Runnerの順に選択し、「Signing and Capabilities」タブをクリックします。「App Sandbox」の下で「Outgoing Connections (Client)」を選択します。

ランナーの署名と機能タブのアプリサンドボックスセクションで発信接続を選択

ネットワークエンタイトルメントの詳細については、Appleのドキュメントcom.apple.security.network.clientを参照してください。

キーチェーン共有を有効にする

この機能はAmplifyがmacOSでプラットフォームベストプラクティスとしてデータ保護キーチェーンを使用するため必須です。 macOSでのキーチェーンの動作方法とキーチェーン共有エンタイトルメントの詳細については、TN3137: macOSキーチェーンAPI及び実装を参照してください。

Xcodeでプロジェクトを開き、Runner、Targets -> Runnerの順に選択し、「Signing and Capabilities」タブをクリックします。

  1. 「+アイコン」をクリックします。

ランナータブの署名と機能セクションでプラスアイコンが囲まれている

  1. 後続のモーダルで「Keychain Sharing」を検索し、追加します。

キーチェーンを検索した後のキーチェーン共有検索結果

  1. 「Signing and Capabilities」の「Keychain Sharing」までスクロールダウンし、「+」アイコンをクリックします。デフォルトではバンドルIDが使用されます。

ランナーの署名と機能セクションのキーチェーン共有セクションで強調表示されたプラスアイコン

  1. 最後に、開発チームを追加して署名を有効にします。

ランナータブの署名と機能セクションで強調表示されたチームセレクタと開発署名有効ボタン

Windows

Windowsをターゲットにする場合、Amplify固有の要件やセットアップ手順はありません。FlutterがサポートするWindowsバージョンを使用する必要があります。詳細は以下のFlutterドキュメントを参照してください:

Linux

Amplify FlutterはLinuxをターゲットにする場合、libsecretライブラリに依存しています。

ローカル開発

Amplify Flutterに依存するアプリを実行およびデバッグするには、libsecret-1-devをインストールする必要があります。以下のコマンドを実行してlibsecret-1-devをインストールしてください。これによりlibglib2.0-devなどのlibsecret-1-devの依存関係もインストールされます。

以下のコマンドはUbuntu用です。他のLinuxディストリビューションではコマンドが異なる可能性があります。

sudo apt-get update
sudo apt-get install -y libsecret-1-dev

アプリをパッケージ化する

Snapcraftを使用してアプリをパッケージ化する場合、必要な依存関係をsnapcraft.yamlファイルに含めます。詳細については、Flutterのスナップストアへのリリースに関するドキュメントを参照してください。

parts:
my-app:
plugin: flutter
source: .
flutter-target: lib/main.dart
build-packages:
- libsecret-1-dev
stage-packages:
- libsecret-1-0