概要
久しぶりにiOS(と言うかiPad)アプリを作ろうと思ったら環境構築が色々大変だったので、調べたことを残しておく。
公開するつもりがなかったので、エラーメッセージとかちゃんと残してなかった。失敗した。
GitHub
iOSアプリ開発における環境構築とセットアップ手順.md · GitHub
https://gist.github.com/kino-puehddby/015ecdee0320e25d81f7e2a27dd5847e
Xcodeでgit機能を使う(プロジェクトの作成からgithubにpushするまで) - Qiita
https://qiita.com/sakamotoyuya/items/fd6c30e672860ba89759
GitHubにPushができない
xcode - xcodeでGitHubにPushしたいのですが、No remotes availableとなっています。 - スタック・オーバーフロー
https://ja.stackoverflow.com/questions/39810/xcode%E3%81%A7github%E3%81%ABpush%E3%81%97%E3%81%9F%E3%81%84%E3%81%AE%E3%81%A7%E3%81%99%E3%81%8C-no-remotes-available%E3%81%A8%E3%81%AA%E3%81%A3%E3%81%A6%E3%81%84%E3%81%BE%E3%81%99
個人アクセストークンを使用する - GitHub Docs https://docs.github.com/ja/github/authenticating-to-github/keeping-your-account-and-data-secure/creating-a-personal-access-token
GitHubへの接続がうまくいかない
GitHubで作成して、既存のリポジトリに接続してみた
→ プッシュで権限がないエラー
SSH keyを入れてみる
Generating a new SSH key and adding it to the ssh-agent - GitHub Docs https://docs.github.com/en/github/authenticating-to-github/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent
Adding a new SSH key to your GitHub account - GitHub Docs https://docs.github.com/en/github/authenticating-to-github/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account
GitHubで説明されてるEd25519はXcodeでサポートされてない?なんかエラーになった。id_rsaで作って、~/.ssh/configのid_rsaを普通のやつに置き換えた。
id_rsaで作ったものならGitHub上で作ったリポジトリをcloneできた。ので、そこに別で作ったswiftプロジェクトをコピペした。
pushしようとしたらエラーになった。
「remote: error: GH007: Your push would publish a private email address.」
githubのpush時のprivate email関係のエラーを解消する方法
https://zenn.dev/kaluna_hart/articles/github-email-error
何故か「git push」だと成功するけど「git push origin master」だと失敗すると思ったら、masterからmainに変わってるんだった。
git push時のerror: src refspec master does not match anyについて - deepblue
https://deepblue-ts.co.jp/git/git-push-error/
CocoaPods
【Swift】CocoaPods導入手順 - Qiita
https://qiita.com/ShinokiRyosei/items/3090290cb72434852460
CocoaPodsの導入と利用 - Qiita
https://qiita.com/fksk/items/9e5fdc201af4f03f2dec
※「pod init」コマンドはプロジェクトフォルダ(xcodeprojファイルがある場所)で。
Chartライブラリ
これは自分が作るアプリに入れたいライブラリなので、普通はいらないやつ
SwiftUIでChartライブラリを使ってみた。 | RE:ENGINES
https://re-engines.com/2020/07/27/swift_ui_chart/
※iOSのターゲットバージョンとかも指定した
「framework not found Charts」というビルドエラーが発生するように。
[XCode][Cocoapods]ビルドエラー時の対処法 - Qiita https://qiita.com/nakamurau1@github/items/e4a810e21e626cf6f09a
試したけど直らず
今後は生成されたxcworkspaceを開いて編集していかなければならない
これを忘れていて、普通に今までのプロジェクトを開いてたからだった。
ビルドしてみると、それでも「framework not found Charts」というビルドエラーが発生する。なんか触ってると、ターゲットをiOS12にするよとか、何回か聞かれて承認してたらビルドが通った。
これでようやく開発環境が作れた気がする。