0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

[Unity] duplicate symbol for architecture arm64

Posted at

経緯

Unityで作ってるアプリをXcodeでビルドしようとしたらエラーが。
何かが重複して存在しているっぽい。

エラー内容
duplicate symbol '_requestIDFA' in:
    /Users/hoge/Library/Developer/Xcode/DerivedData/Unity-iPhone-cwyshjudtfdtzegrxrvyryduqogv/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/UnityFramework.build/Objects-normal/arm64/RequestAttDialog-5e6bdc01a9588a8b4d1572842eba3a98.o
    /Users/hoge/Library/Developer/Xcode/DerivedData/Unity-iPhone-cwyshjudtfdtzegrxrvyryduqogv/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/UnityFramework.build/Objects-normal/arm64/RequestAttDialog-ff0606b37cf49ec30d45e70892504c3f.o
ld: 1 duplicate symbol for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

解決方法

エラーを見たら簡単でした。

duplicate symbol '_requestIDFA' in:...

とあるように、
ファイル名から何から全く同じ.mmファイルが複数存在し、そのファイルの中で定義されているrequestIDFA() が重複していた。
なので重複している関数が書かれているファイルの片方を削除することで解決

環境

macOS Monterey
Unity 2020.3.34f1

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?