I am building a Unity app on iOS with a companion Apple Watch App. I added a Watch App for for iOS app
target in the Xcode project generated by Unity. Both Unity iOS target and watchOS target worked perfectly in the past.
Today when I tried to build the app, I could still run the Unity iOS target but got the following error when trying to run the watchOS target.
ld: b(l) ARM64 branch out of range (154869072 max is +/-128MB): from +[UnityURLRequest requestForTask:] (0x00005D50) to __Unwind_Resume.stub@0x00000000 (0x093B7CA4) in '+[UnityURLRequest requestForTask:]' from /Users/yuchen/Library/Developer/Xcode/DerivedData/Unity-iPhone-gdwalbfioaucpucqjcrkcmzzwjkw/Build/Intermediates.noindex/Unity-iPhone.build/Debug-iphoneos/UnityFramework.build/Objects-normal/arm64/UnityWebRequest.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I am very confused with this error because it mentioned UnityFramework
. My watchOS target is empty with only 3 SwiftUI files. From my understanding, the watchOS target should have nothing to do with UnityFramework
even though they are in the same project.
I have found two similar questions:
https://stackoverflow.com/questions/27977253/arm64-branch-out-of-range
It seems that the reason is because the app is too big? (There was no error before since my project was not big enough?)
Does anyone know how to solve this problem?
Thank you very much.