heihei blog

Blog icon by Unsplash https://unsplash.com/@virussinside

Twilio Video Androidサンプルを動かすまでの雑メモ

f:id:shoheikawano:20200903224648p:plain

Twilio Video Androidサンプルを動かす

TwilioのVideo Androidサンプルを動かす際にハマったことなどの雑メモです。 もう数ヶ月前のものなのですが、一応残しておこうとおもい記載。

主に以下のリンクを参考にしました。以下、雑メモです。

github.com

twilioコマンドを実行できるように、依存周りをbrew経由でインストール

brew tap twilio/brew && brew install twilio
brew upgrade twilio

loginを実行する

twilio login

SIDなどもろもろ

? The Account SID for your Twilio Account or Subaccount: ? Your Twilio Auth Token for your Twilio Account or Subaccount: [hidden] ? Shorthand identifier for your profile:

Created API Key XXX and stored the secret in your keychain. See: https://www.twilio.com/console/runtime/api-keys/XXX
twilio-cli configuration saved to "XXX"
twilio plugins:install @twilio-labs/plugin-rtc

warning @twilio-labs/plugin-rtc > @twilio-labs/serverless-api > @types/form-data@2.5.0: This is a stub types definition. form-data provides its own type definitions, so you do not need this installed. warning "@twilio-labs/plugin-rtc > @oclif/command@1.5.19" has unmet peer dependency "@oclif/plugin-help@^2". Installing plugin @twilio-labs/plugin-rtc... installed v0.1.4

twilio rtc:apps:video:deploy --authentication passcode

↑のコマンドを実行したところ、以下のエラーとともに失敗した

Something went wrong GotError [HTTPError]: Response code 409 (CONFLICT)

原因を調べてみると以下のようなissueが

github.com

たまにCLIプラグインが変な状態になることがあるから、トラブルシュートしてとのこと ↓

github.com

twilio plugins:update to update the rtc plugin to the latest version.
twilio rtc:apps:video:delete to delete any existing video apps.

上記2つを実行した上で、再度こちらを実行した

twilio rtc:apps:video:deploy --authentication passcode

今度は成功し、パスコードを無事に取得完了。

deploying app... done
Passcode: XXX
Expires: Sun Apr 19 2020 00:29:11 GMT+0900

こちらの記載をみると、パスコードの有効期限は一週間。以下のコマンドで新しいpasscodeを再生成できるとのこと。

The passcode will expire after one week. To generate a new passcode, run twilio rtc:apps:video:deploy --authentication passcode --override.

開発者が誰でもビルド可能な Community のFlavorでアプリをビルド。

.gradlew assembleCommunityDebug

Android OS Pie搭載のPixel 3 XLにインストールしようとしたら、以下のエラーが

adb: failed to install app/build/outputs/apk/community/debug/app-community-debug.apk: 
Failure [INSTALL_FAILED_NO_MATCHING_ABIS: Failed to extract native libraries, res=-113]

ABIの設定を行うために、以下を参考に設定してビルドし直す

github.com

adb install app/build/outputs/apk/community/debug/app-community-arm64-v8a-debug.apk

でインストール完了。