TAKOYAKING’s blog 一覧

TAKOYAKING’s blog

たこ焼き系

Unity: Unity EditorでFirebase RealtimeDatabaseを使うと「Could not initialize persistence: Unable to find app data directory」が出る

環境

現象

再生するとクラッシュします。

原因

必要なフォルダがなぜか作成されていないのが原因です。

解決

Could not initialize persistence: Unable to find app data directory

直し方はここに書いてありました。
Firebase Database 6.16.0 crashes Unity Editor on Install and on Play (with easy fix) · Issue #807 · firebase/quickstart-unity · GitHub

mkdir ~/Library/Application\ Support/[package name]

※ パッケージ名はcom.sample.name みたいなものです。

感想

結構はまりました・・・

Unity: UniversalRPを入れてままにしておいたら勝手に?マテリアルがSprite Lit Defaultに変更された

universalRPを入れるとunityをバージョンアップした時に勝手にマテリアルがSprite Lit Defaultに変更されて、真っ黒になります。
f:id:TAKOYAKING:20200903101059p:plain
元々はSprites-Defaultマテリアルだったのになぜか勝手に変更されてしまいました。
universalRPは開発していた時に脇道にそれて遊び始めた時に入れっぱなしにしていたものでしたので、忘れないように削除しておきます。

推測の再現方法

psbファイルを使っていると起こるようです。

環境

  • unity 2020.1.1f
  • universalRP 8.2.0

対応

  • UniversalRPをpackage managerから削除
  • 対象のpsbファイルをreimportする
  • そのpsbファイルに関係するprefabをreimportする

Unity: 「Missing Project ID」ダイアログが表示される

【Unity】「Missing Project ID」のメッセージが出る場合の対処法 - Qiita
ビルドするときに「Missing Project ID」ダイアログが表示される時は↑の記事にあるように
右上にある雲の形をした「Manage service」ボタンを押して、unlinkしてからlinkすれば良いみたいです。

ただ、unlinkするボタンが自分の場合は潰れていて押せなくなっていました。
そういう時はUnityを再起動すればunlinkボタンが押せるようになりました。

fastlane: no implicit conversion of nil into String (TypeError)

18: from /Users/sample/.rbenv/versions/2.6.5/bin/fastlane:23:in `<main>'
17: from /Users/sample/.rbenv/versions/2.6.5/bin/fastlane:23:in `load'
16: from /Users/sample/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/fastlane-2.157.2/bin/fastlane:23:in `<top (required)>'
15: from /Users/sample/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/fastlane-2.157.2/fastlane/lib/fastlane/cli_tools_distributor.rb:111:in `take_off'
14: from /Users/sample/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/fastlane-2.157.2/deliver/lib/deliver/commands_generator.rb:17:in `start'
13: from /Users/sample/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/fastlane-2.157.2/deliver/lib/deliver/commands_generator.rb:186:in `run'
12: from /Users/sample/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/commander-fastlane-4.4.6/lib/commander/delegates.rb:15:in `run!'
11: from /Users/sample/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/fastlane-2.157.2/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:76:in `run!'
10: from /Users/sample/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/commander-fastlane-4.4.6/lib/commander/runner.rb:476:in `run_active_command'
 9: from /Users/sample/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/commander-fastlane-4.4.6/lib/commander/command.rb:153:in `run'
 8: from /Users/sample/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/commander-fastlane-4.4.6/lib/commander/command.rb:178:in `call'
 7: from /Users/sample/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/fastlane-2.157.2/deliver/lib/deliver/commands_generator.rb:118:in `block (2 levels) in run'
 6: from /Users/sample/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/fastlane-2.157.2/deliver/lib/deliver/setup.rb:21:in `run'
 5: from /Users/sample/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/fastlane-2.157.2/deliver/lib/deliver/setup.rb:46:in `generate_deliver_file'
 4: from /Users/sample/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/fastlane-2.157.2/spaceship/lib/spaceship/connect_api/models/app.rb:191:in `get_latest_app_store_version'
 3: from /Users/sample/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/fastlane-2.157.2/spaceship/lib/spaceship/connect_api/models/app.rb:191:in `sort_by'
 2: from /Users/sample/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/fastlane-2.157.2/spaceship/lib/spaceship/connect_api/models/app.rb:191:in `each'
 1: from /Users/sample/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/fastlane-2.157.2/spaceship/lib/spaceship/connect_api/models/app.rb:191:in `block in get_latest_app_store_version'
/Users/sample/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/fastlane-2.157.2/spaceship/lib/spaceship/connect_api/models/app.rb:191:in `parse': no implicit conversion of nil into String (TypeError)
18: from /Users/sample/.rbenv/versions/2.6.5/bin/fastlane:23:in `<main>'
17: from /Users/sample/.rbenv/versions/2.6.5/bin/fastlane:23:in `load'
16: from /Users/sample/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/fastlane-2.157.2/bin/fastlane:23:in `<top (required)>'
15: from /Users/sample/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/fastlane-2.157.2/fastlane/lib/fastlane/cli_tools_distributor.rb:111:in `take_off'
14: from /Users/sample/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/fastlane-2.157.2/deliver/lib/deliver/commands_generator.rb:17:in `start'
13: from /Users/sample/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/fastlane-2.157.2/deliver/lib/deliver/commands_generator.rb:186:in `run'
12: from /Users/sample/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/commander-fastlane-4.4.6/lib/commander/delegates.rb:15:in `run!'
11: from /Users/sample/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/fastlane-2.157.2/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:76:in `run!'
10: from /Users/sample/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/commander-fastlane-4.4.6/lib/commander/runner.rb:476:in `run_active_command'
 9: from /Users/sample/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/commander-fastlane-4.4.6/lib/commander/command.rb:153:in `run'
 8: from /Users/sample/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/commander-fastlane-4.4.6/lib/commander/command.rb:178:in `call'
 7: from /Users/sample/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/fastlane-2.157.2/deliver/lib/deliver/commands_generator.rb:118:in `block (2 levels) in run'
 6: from /Users/sample/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/fastlane-2.157.2/deliver/lib/deliver/setup.rb:21:in `run'
 5: from /Users/sample/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/fastlane-2.157.2/deliver/lib/deliver/setup.rb:46:in `generate_deliver_file'
 4: from /Users/sample/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/fastlane-2.157.2/spaceship/lib/spaceship/connect_api/models/app.rb:191:in `get_latest_app_store_version'
 3: from /Users/sample/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/fastlane-2.157.2/spaceship/lib/spaceship/connect_api/models/app.rb:191:in `sort_by'
 2: from /Users/sample/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/fastlane-2.157.2/spaceship/lib/spaceship/connect_api/models/app.rb:191:in `each'
 1: from /Users/sample/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/fastlane-2.157.2/spaceship/lib/spaceship/connect_api/models/app.rb:191:in `block in get_latest_app_store_version'
/Users/sample/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/fastlane-2.157.2/spaceship/lib/spaceship/connect_api/models/app.rb:191:in `parse': [!] no implicit conversion of nil into String (TypeError)
fastlane deliver init

をしようとすると↑のようなエラーが出ました。

iTunesConnectに「提出準備中」の申請ページが無いとダメなようです。
ただ

fastlane deliver download_screenshots --use_live_version

「--use_live_version」をつけてあげるとスクショに関しては「配信準備完了」となっていても取得できるようです。metadataはつけてもダメでした。

なのでmetadataに関しては一旦iTunes Connect側で「提出準備中」のページを作る必要があるみたいです。

ruby: gnoring json-1.8.6 because its extensions are not built. Try: gem pristine json --version 1.8.6

Ignoring json-1.8.6 because its extensions are not built. Try: gem pristine json --version 1.8.6
Ignoring json-1.8.6 because its extensions are not built. Try: gem pristine json --version 1.8.6
Ignoring json-1.8.6 because its extensions are not built. Try: gem pristine json --version 1.8.6
Ignoring json-1.8.6 because its extensions are not built. Try: gem pristine json --version 1.8.6
Ignoring json-1.8.6 because its extensions are not built. Try: gem pristine json --version 1.8.6
Ignoring json-1.8.6 because its extensions are not built. Try: gem pristine json --version 1.8.6
Ignoring json-1.8.6 because its extensions are not built. Try: gem pristine json --version 1.8.6
Ignoring json-1.8.6 because its extensions are not built. Try: gem pristine json --version 1.8.6

fastlaneを実行すると大量にこのメッセージが出るようになりました。
メッセージの通り以下のコマンドを打つと修復されました。

gem pristine json --version 1.8.6

fastlane: iOS App Store" profile

有効なプロビジョニングプロファイルが無いことで表示されるようです。(期限切れなど)

Looks like no provisioning profile mapping was provided

なども表示されました。

Xcode Project - fastlane docs
fastlaneの公式Docによると自動サインインはオフになっているようです。
なので、provisioningProfilesを指定してあげるか、自動更新フラグをつけてあげる必要があります。

ProvisioningProfileを指定する方法
build_app(
    export_method: "app-store",
    export_options: {
      provisioningProfiles: { 
        "com.example.bundleid" => "abc-abc-abc.mobileprovision",
      }
    }
  )
自動サインイン
build_app(export_xcargs: "-allowProvisioningUpdates")

Provisioning Profilesの中身が見たい

Provisioning Profilesは以下に.mobileprovisionという拡張子で保存されています。
~/Library/MobileDevice/Provisioning\ Profiles/
対象のファイルをクイックルック(スペースキーを押す)と中身が簡易的に見れます。
これで削除したものも確認できるかと思います。

Google Play Consoleで「新しいリリースを作成」ボタンが非活性で作成できない

f:id:TAKOYAKING:20200901120917p:plain

なぜでしょうか?
先ほどまでできていたのでできるはずですができません。

解決

新しいレイアウトになり、一旦リリーを作成すると「リリース」タブに表示されます。
なので「リリースダッシュボード」から「リリース」タブへ移動して、既存のものを編集するか、または、破棄することで右上の「新しいリリースを作成」が活性になります
f:id:TAKOYAKING:20200901122118p:plain

感想

まだ新しいレイアウトに慣れていないから、戸惑いました。