【AR】Unityからビルドしたものをxcodeからipadへインストールする際のエラーの解決
解決したいこと
【AR】Unityからビルドしたものをxcodeからipadへインストールする際のエラーの解決
GoogleのGeospatial APIを利用したARアプリを作成しています。
AR EXtensions等必要なパッケージをインポートして設定し、ひとまず実機でAPIが作動しているか確認しようとしています。
Unity上ではエラーなしでビルドできるのですが、それをipadへビルドする際にxcode上に以下のようなエラーが出て困っています。
Unity上での作業で参考にしている記事は以下のものです。
・Google Geospatial APIで位置情報による3D都市モデルのARを作成する
https://www.mlit.go.jp/plateau/learning/tpc14-3/
・ARCore Geospatial API x Unityハンズオン by AR Fukuoka
https://www.docswell.com/s/Tks_Yoshinaga/Z86Q2K-geospatial-api#p1
発生している問題・エラー
Xcode上で以下のエラーが出てBuild Failedと表示されます。
Framework not found ARCoreBase.xcframework
linker command failed with exit code 1 (use -v to see invocation)
使用している環境
・Unity 2021.3.27f1
・Xcode:Version 14.3.1 (14E300c)
・Mac mini(M2Pro) OS:Ventura 13.4.1
自分で試したこと
1
バージョンの確認、必要なものの確認
Unityのバージョンについて2022.3.1f1でも行ってみましたが、同様のエラーとなりました。
また、必要なパッケージについても再度確認し、アップデート等行いました。
2
https://twitter.com/qualityb_masaru/status/1650892259678896130
↑この方が同じエラーの解決について言及していましたので、
ARCoreiOSGeospatialDependencies.xml
<dependencies>
<iosPods>
<iosPod name="ARCore/Geospatial" version="~> 1.37.0" minTargetSdk="11.0">
</iosPod>
</iosPods>
</dependencies>
ARCoreiOSDependencies.xml
<dependencies>
<iosPods>
<iosPod name="ARCore/GARSession" version="~> 1.37.0" minTargetSdk="11.0">
</iosPod>
</iosPods>
</dependencies>
の2つのファイルを削除し、ビルドすることで内容を更新しました。
(自分で見たかぎり、内容は変わってないようです)
3
ターミナルにて、podに関してもインストールしてみました。
% cd /Users/*/build/Unity-iPhone.xcworkspace
% pod install
[in /Users/*/build]
Analyzing dependencies
Downloading dependencies
Generating Pods project
Integrating client project
Pod installation complete! There are 2 dependencies from the Podfile and 11 total pods installed.
4
Unity-iPhone.xcworkspaceを開いてビルドする。
5
XcodeのTargets>UnityFramework>Frameworks and Librariesに手動で生成されていたARCoreBase.xcframeworkを追加しました。
(*/Build/Pods/ARCore/Base/Framework/ARCoreBase.xcframeworkのファイルだと思われます。)
追記
podfile内にARCore/Baseの記述がありません。
自分でvimで付け足して良いものなのか、Unity上で何かが足りないのか。
Unityには3Dプロジェクトで始めて、ARFoundation、ARCore Extensions、ARkit Pluginをインポートし、ARCore ExtensionsのGeospatial Sampleも同時にインポートしました。
ヒエラルキーにはAsset>Samples>ARCore Extensions>1.37.0>Geospatial Sample>Secen内にあるGeospatialを使用しています。
生成されているPodfileにARCoreBaseに関する記述がありません。
source 'https://cdn.cocoapods.org/'
platform :ios, '12.0'
target 'UnityFramework' do
pod 'ARCore/GARSession', '~> 1.37.0'
pod 'ARCore/Geospatial', '~> 1.37.0'
end
target 'Unity-iPhone' do
end
use_frameworks! :linkage => :static