2021年11月03日

[iOS] モバイル用AWSのSDKがバージョン2.19.1より上げられないときの対応

■ 注意 ■ 2021年11月18日追記
iOS版はうまくいったけど、Android版はビルドできませんでした。
理由はSDKの更新が止まっていたから!
AWSのUnity用SDKはプラグインという形での公開はとっくにやめていて、.NETのSDKの方だけ更新されているようです。
詳しくは、後日に記事にします。



iOS版100マス計算でAWSの
・Lambda
・DynamoDB
を使っています。

前回の件があって、最新のSDKに切り替えようとしたところ、2.19.1より上げられない事態になりました。

CocoaPodsの中身:

source 'https://github.com/CocoaPods/Specs.git'

platform :ios, '11.0'
use_frameworks!

target :'[PJ名]' do
pod 'AWSCognito'
pod 'AWSCognitoIdentityProvider'
pod 'AWSDynamoDB'
pod 'AWSLambda'
end


バージョンを上げられるか調べてみたところ。

$ pod outdated
...
Analyzing dependencies
The color indicates what happens when you run `pod update`
- Will be updated to the newest version
- Will be updated, but not to the newest version because of specified version in Podfile
- Will not be updated because of specified version in Podfile

The following pod updates are available:
- AWSCognitoIdentityProvider 2.19.1 -> 2.19.1 (latest version 2.26.3)
- AWSCognitoIdentityProviderASF 2.19.1 -> 2.19.1 (latest version 2.26.3)
- AWSCore 2.19.1 -> 2.19.1 (latest version 2.26.3)
- AWSDynamoDB 2.19.1 -> 2.19.1 (latest version 2.26.3)
- AWSLambda 2.19.1 -> 2.19.1 (latest version 2.26.3)

↓スクショ
スクリーンショット 20211103_1.png


最新版が2.26.3なのに、上げられない。

調べたところ、CocoaPodsの「Cognito」を「AWSMobileClient」にすることで対処できた。

参考:
https://cocoapods.org/pods/AWSLambda
https://github.com/aws-amplify/aws-sdk-ios

補足:
AWSMobileClientのpod installがSWIFT_VERSIONのエラーで止まるときの対応
https://qiita.com/akira-greennote/items/462fe5d4c381c1aba6ee

CocoaPodsで変更した箇所:

target :'AWSTest2021' do
pod 'AWSMobileClient'
pod 'AWSDynamoDB'
pod 'AWSLambda'
end

すると、2.26.3に上げられるようになった。
$ pod outdated
...
Analyzing dependencies
The color indicates what happens when you run `pod update`
- Will be updated to the newest version
- Will be updated, but not to the newest version because of specified version in Podfile
- Will not be updated because of specified version in Podfile

The following pod updates are available:
- AWSCognitoIdentityProvider 2.19.1 -> 2.26.3 (latest version 2.26.3)
- AWSCognitoIdentityProviderASF 2.19.1 -> 2.26.3 (latest version 2.26.3)
- AWSCore 2.19.1 -> 2.26.3 (latest version 2.26.3)
- AWSDynamoDB 2.19.1 -> 2.26.3 (latest version 2.26.3)
- AWSLambda 2.19.1 -> 2.26.3 (latest version 2.26.3)

↓スクショ
スクリーンショット 20211103_2.png


対応した内容はシンプルなものの、調べるのに時間がかかった。
なんとか対応できてよかったー。

↓無事、インストールできた
スクリーンショット 20211031_1.png

posted by be-style at 15:50| Comment(0) | iOS
この記事へのコメント
コメントを書く
お名前:

メールアドレス:

ホームページアドレス:

コメント: [必須入力]

※ブログオーナーが承認したコメントのみ表示されます。