Closed38

もくまっち開発 Week 7

光岡 高宏光岡 高宏

rosetta をインストールしたか忘れたので、下記を実行しておく

$ sudo softwareupdate --install-rosetta --agree-to-license

なんか、成功したのか失敗したのかよくわからない出力が...

By using the agreetolicense option, you are agreeing that you have run this tool with the license only option and have read and agreed to the terms.
If you do not agree, press CTRL-C and cancel this process immediately.
2024-01-21 23:12:51.904 softwareupdate[13763:1742283] Package Authoring Error: 052-14625: Package reference com.apple.pkg.RosettaUpdateAuto is missing installKBytes attribute
Install of Rosetta 2 finished successfully
光岡 高宏光岡 高宏
$ sudo flutter build ios

   Woah! You appear to be trying to run flutter as root.
   We strongly recommend running the flutter tool without superuser privileges.
  /
📎
Building studio.protoout.miliconvalley.mochmatch for device (ios-release)...
Automatically signing iOS for device deployment using specified development team in Xcode project: 9Z99MR8XP3
Warning: CocoaPods is installed but broken. Skipping pod install.
  You appear to have CocoaPods installed but it is not working.
  This can happen if the version of Ruby that CocoaPods was installed with is different from the one being used to invoke it.
  This can usually be fixed by re-installing CocoaPods.
To re-install see https://guides.cocoapods.org/using/getting-started.html#installation for instructions.



CocoaPods not installed or not in valid state.
光岡 高宏光岡 高宏

CocoaPods が壊れてるって言われたので、一旦再インストールしてみる

brew reinstall ruby cocoapods
光岡 高宏光岡 高宏

再度ビルド

sudo flutter build ios
Password:
   Woah! You appear to be trying to run flutter as root.
   We strongly recommend running the flutter tool without superuser privileges.
  /
📎
Building studio.protoout.miliconvalley.mochmatch for device (ios-release)...
Automatically signing iOS for device deployment using specified development team in Xcode project: 9Z99MR8XP3
Warning: CocoaPods is installed but broken. Skipping pod install.
  You appear to have CocoaPods installed but it is not working.
  This can happen if the version of Ruby that CocoaPods was installed with is different from the one being used to invoke it.
  This can usually be fixed by re-installing CocoaPods.
To re-install see https://guides.cocoapods.org/using/getting-started.html#installation for instructions.



CocoaPods not installed or not in valid state.

結果かわらず。

光岡 高宏光岡 高宏

ログ出してみたら原因がわかった。

$ sudo flutter build ios --verbose
(略)
[ +354 ms] /opt/homebrew/Cellar/cocoapods/1.14.3_1/libexec/gems/claide-1.1.0/lib/claide/command.rb:439:in `help!': [!] You cannot run CocoaPods as root. (CLAide::Help)
(略)

CocoaPods は root 権限では実行できませんで、ということでした。
現状、僕の環境だとなぜか flutter コマンドが root で実行しないと書き込みエラーになるので詰んだ。

光岡 高宏光岡 高宏

選択肢は下記。

  • flutter コマンドをユーザー権限で実行できるように直す
  • GitHub Actions でのビルドに再チャレンジする
光岡 高宏光岡 高宏

おおおおおおおおおおおおおお
ビルド通ったあああああ

$ flutter build ios

Building studio.protoout.miliconvalley.mochmatch for device (ios-release)...
Automatically signing iOS for device deployment using specified development team in Xcode project: 9Z99MR8XP3
Running Xcode build...
 └─Compiling, linking and signing...                        47.3s
Xcode build done.                                           101.8s
Built /Users/nix/ghq/github.com/protoout/mochmatch/build/ios/iphoneos/Runner.app.
光岡 高宏光岡 高宏

もっとかかるかと思ってたけど今週のタスク完了!

  • iOS アプリのビルド
光岡 高宏光岡 高宏

タスク追加

  • iOS アプリのビルド
  • GitHub Actions でビルドできるようにする(iOS)
  • 写真の before/after 確認
光岡 高宏光岡 高宏

GitHub にコードをプッシュしたら JOB でエラー発生

Failed to build iOS app
Error (Xcode): No profiles for 'studio.protoout.miliconvalley.mochmatch' were found: Xcode couldn't find any iOS App Development provisioning profiles matching 'studio.protoout.miliconvalley.mochmatch'. Automatic signing is disabled and unable to generate a profile. To enable automatic signing, pass -allowProvisioningUpdates to xcodebuild.
/Users/runner/work/mochmatch/mochmatch/ios/Runner.xcodeproj


It appears that there was a problem signing your application prior to installation on the device.

Verify that the Bundle Identifier in your project is your signing id in Xcode
  open ios/Runner.xcworkspace

Also try selecting 'Product > Build' to fix the problem.
Encountered error while building for device.
光岡 高宏光岡 高宏

Xcode > Runnter > TARGETS/Runner > Signing & Capabilities > Signing > Automatically manage signingfalseに変更

光岡 高宏光岡 高宏
  • iOS アプリのビルド
  • GitHub Actions でビルドできるようにする(iOS)
  • HEIC 画像の変換 & アップロード
  • 写真の before/after 確認
光岡 高宏光岡 高宏
  • iOS アプリのビルド
  • GitHub Actions でビルドできるようにする(iOS)
  • HEIC 画像の変換 & アップロード
  • 写真の before/after 確認
光岡 高宏光岡 高宏

今週分のタスク完了 :)

あとは写真が横になってしまってるのを解決したら先週分も含めて完了できるぞ

光岡 高宏光岡 高宏

元画像を jpeg → webp に圧縮してるんだけど、その過程で横になってしまってるっぽい

光岡 高宏光岡 高宏

圧縮前は EXIF に画像方向の情報が入ってる

webp にもメタデータってあるのかな

光岡 高宏光岡 高宏

プレビューアプリで確認したら TIFF に回転情報が入ってた

TIFF っていうのもあるのか

光岡 高宏光岡 高宏

WebP にコンバートする前に、 EXIF から回転情報を基に画像を回転させておいてからコンバートする必要がありそう

光岡 高宏光岡 高宏

現状、 WebP ファイルでは回転情報が失われてしまってるので、一回 JPEG に戻す必要あるなぁ
最新データの取り込みといっしょに来週やろっと。

このスクラップは3ヶ月前にクローズされました