Xcode Builds Fail Due to Null Framework References in xcodeproj File

  • Issue category: Unity Build / Xcode Project File
  • Device type & OS version: iOS 11+
  • Host machine & OS version: Windows 10 21H2 (for Unity build) / Mac Monterey 12.4 (for Xcode build)
  • Issue Environment : Unity / Xcode
  • Xcode version: 13.4.1
  • ARDK version: 2.1.0
  • Unity version: 2021.3.6f1

Hello! I’m building out my first project on Unity/Lightship/iOS (the ball tutorial) with no successful builds so far. When attempting to build in Xcode I receive the following two errors, with what I believe is the failed ld command.

ld: framework not found null
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Framework not found null

Ld /Users/rthur/Library/Developer/Xcode/DerivedData/Unity-iPhone-dqrrkphwiuenotcejoykrbfmgcuv/Build/Products/ReleaseForRunning-iphoneos/UnityFramework.framework/UnityFramework normal (in target 'UnityFramework' from project 'Unity-iPhone')
    cd /Volumes/EX-01/Builds_TemplateDemo5
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -target arm64-apple-ios11.0 -dynamiclib -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.5.sdk -L/Users/rthur/Library/Developer/Xcode/DerivedData/Unity-iPhone-dqrrkphwiuenotcejoykrbfmgcuv/Build/Products/ReleaseForRunning-iphoneos -L/Volumes/EX-01/Builds_TemplateDemo5/Libraries -F/Users/rthur/Library/Developer/Xcode/DerivedData/Unity-iPhone-dqrrkphwiuenotcejoykrbfmgcuv/Build/Products/ReleaseForRunning-iphoneos -F/Volumes/EX-01/Builds_TemplateDemo5/Frameworks/ARDK/Plugins/unity_exports/ardk_client_platform/Plugins/iOS -filelist /Users/rthur/Library/Developer/Xcode/DerivedData/Unity-iPhone-dqrrkphwiuenotcejoykrbfmgcuv/Build/Intermediates.noindex/Unity-iPhone.build/ReleaseForRunning-iphoneos/UnityFramework.build/Objects-normal/arm64/UnityFramework.LinkFileList -install_name @rpath/UnityFramework.framework/UnityFramework -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -map -Xlinker /Users/rthur/Library/Developer/Xcode/DerivedData/Unity-iPhone-dqrrkphwiuenotcejoykrbfmgcuv/Build/Intermediates.noindex/Unity-iPhone.build/ReleaseForRunning-iphoneos/UnityFramework.build/UnityFramework-LinkMap-normal-arm64.txt -dead_strip -Xlinker -object_path_lto -Xlinker /Users/rthur/Library/Developer/Xcode/DerivedData/Unity-iPhone-dqrrkphwiuenotcejoykrbfmgcuv/Build/Intermediates.noindex/Unity-iPhone.build/ReleaseForRunning-iphoneos/UnityFramework.build/Objects-normal/arm64/UnityFramework_lto.o -fembed-bitcode-marker -stdlib=libc++ -fobjc-arc -fobjc-link-runtime -weak_framework CoreMotion -weak-lSystem -liPhone-lib -framework Metal -framework Security -framework MediaToolbox -framework CoreText -framework AudioToolbox -weak_framework AVFoundation -framework AVKit -framework CFNetwork -framework CoreGraphics -framework CoreMedia -weak_framework CoreMotion -framework CoreVideo -framework Foundation -framework OpenAL -framework QuartzCore -framework SystemConfiguration -framework UIKit -liconv.2 -lil2cpp /Volumes/EX-01/Builds_TemplateDemo5/Libraries/baselib.a -framework infinitam -framework ardk_client_platform -framework null -framework CoreLocation -weak_framework GameController -weak_framework UserNotifications -Xlinker -dependency_info -Xlinker /Users/rthur/Library/Developer/Xcode/DerivedData/Unity-iPhone-dqrrkphwiuenotcejoykrbfmgcuv/Build/Intermediates.noindex/Unity-iPhone.build/ReleaseForRunning-iphoneos/UnityFramework.build/Objects-normal/arm64/UnityFramework_dependency_info.dat -o /Users/rthur/Library/Developer/Xcode/DerivedData/Unity-iPhone-dqrrkphwiuenotcejoykrbfmgcuv/Build/Products/ReleaseForRunning-iphoneos/UnityFramework.framework/UnityFramework

From what I’ve found, this null framework reference stems from an error in the Unity-iPhone.xcodeproj\project.pbxproj file. So I took a look in there an did find several references to a “null.framework” that doesn’t exist (as far as I know):

line 149		7FF5444A90061A16DCED3C2A /* null.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1C8E42729FAC82007752925E /* null.framework */; };
line 424		1C8E42729FAC82007752925E /* null.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = null.framework; path = System/Library/Frameworks/null.framework; sourceTree = SDKROOT; };
line 809				7FF5444A90061A16DCED3C2A /* null.framework in Frameworks */,
line 883				1C8E42729FAC82007752925E /* null.framework */,

And this is where the trail went cold. My best guess is that this is some sort of misconfiguration in my Unity build, but I haven’t found any further information on what it might be. Any insights as to what might be causing these null framework references to be generated would be much appreciated!

1 Like

Hi @KingRthur
In your Xcode file navigator, find the folder named Frameworks, above which you can see a red color. This means you have to manually select your framework folder. Press it and select the “Frameworks/ARDK” folder from the Inspector menu. Maybe you can solve the problem with this solution.

Hello KingRthur,

Just to clarify, are you creating your Unity project on a Windows machine and then trying to build it from a Mac? If so, this could be causing some discrepancies when building. When building to iOS, it’s recommended to create your project on a Mac.

Could you please try creating the project on your Mac and building it from there?

If this was not the issue and @Naveen’s advice did not work, could you please clarify the steps you took to create your build so we can continue troubleshooting? Thank you!

Having the same issue, same error on build.
ld: framework not found null

Hello @Spatializes,

To better help troubleshoot the issue, could you please provide the following information?

  • What is your device type and OS version?
  • What is your host machine and OS version?
  • What version of XCode are you using?
  • What are your Unity and ARDK versions?

If you could provide the steps that you took to build your project, that would also be helpful. Thank you!

The build actually works locally in Unity / Xcode on my mac, even with the null framework. I guess Xcode ignores it. It fails though in my Github Actions CI pipeline with Game-CI (Deploy to the App Store | GameCI). Unity Build is on ubuntu-latest (Ubuntu 20.04.4 LTS). Fastlane deploy is from macOS-latest (macOS 11.6.7 20G630). Xcode_13.2.1. Unity 2021.3.1f1. ARDK 1.3.1.

Framework list showing the ‘null’ framework. Can be deleted but just gets regenerated each build:

The build has succeeded! I did need to point the Frameworks/ARDK folder in the project navigator to the right folder on disk. I also deleted the null.framework entry from the project (thanks to @Spatializes for that idea).

After resolving those initial framework issues, I ran into an error regarding bitcode in the infinitam framework, but disabling bitcode in Build Settings seems to have solved that without problems.

Thanks for the help everyone! Future builds will show whether the null framework keeps coming back, but my issues seem to be taken care of for now :+1:

Hello @Spatializes,

Thank you for the information!

Please note that while we don’t officially support Linux, here are a couple things you can try.

At the bottom of the Building ARDK Apps for iOS page, there is a section that explains how to fix errors with frameworks not being found. Could you please try the steps there and let me know if that solved your issue?

Also, adding to KingRthur’s most recent post, this community post also explains how to disable Bitcode should that also end up causing you trouble.

Please let me know if the above helped get rid of the error. Thank you!