I have a Unity project which I have successfully built for Android without issue. When trying to build for iOS I am encountering an issue once the project is in Xcode.
Unity compiles without any errors and creates an Xcode project.
Upon opening the Xcode project I have NO simulators available. I can get these simulators by selecting ios in the Supported Platforms section, at which point simulators become available - originally Supported Platforms is set to iphoneos. This seems extremely odd behaviour to me, and suggests something larger going wrong.
After getting a simulator to select I get the following error when trying to compile/run/build:
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
The full error is available on Pastebin (too large to post directly on here):
https://pastebin.com/3fYR8fE3
I'm really at a loss on what I can do. I have tried a number of things, including:
Building from Unity as Debug and Release
Building from Unity with 'Symlink Unity Libraries' on and off
Building from Unity with .Net 3.5 and .Net 4.* flavours
Manually adding the libiconv.2.dylib file in the linked frameworks tab as the .tbd equivalent
Setting the target minimum version of iOS to 9.0 (negates the need for libiconv.2.dylib entirely)
I am using latest versions of everything:
Unity 2018.2.17f1
Xcode 10.1
It seems like you have the library il2cpp built for another architecture, have you tried to change your target's "Build Settings > Build Active Architectures Only" to "No"?
However I made some researches and it seems that Unity for iPhone doesn't deploy on simulator. It only works on device or in the Unity editor. Check this link out
Related
Having trouble building HERE SDK for iOS (Premium 3.19) for an ios-arm64-simulator. The error produced by Xcode 13 on an M1 pro processor is:
ld: building for iOS Simulator, but linking in dylib built for iOS, file 'Pods/HEREMaps/framework/NMAKit.xcframework/ios-arm64/NMAKit.framework/NMAKit'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
After some research and testing it looks like HERE SDK's XCFramework folder as well as the Cocoapod configuration only include ios-arm64 and ios-x86_64-simulator. It looks like the podspec is attempting to fix this by overriding the target app's iOS simulator excluded architectures (adding excluded architecture "arm64"). This likely works fine in cases where only Cocoapod sourced libraries that include x86_64 are used in the target app. However, it's a problem when using libraries from other sources where there is no roll back option to x86_64 simulators (e.g. Swift Package Manager).
Is there a way to use lipo to generate ios-arm64-simulator from the two existing framework builds? Or is this something where ios-arm64-simulator needs to be built as another configuration from the HERE SDK source?
Let me tell you that we have already located this situation in the SDK and our team in charge of the SDK is working very hard to provide a solution to this problem in the next release of HERE SDK Premium.
I have Unity3D project and I built it for iOS. If I run it using XCode's simulator it works fine. But if I want to compile it for "iOS Device" or for a physical device connected to my Mac, I get lots of errors and as a result I can't create an Archive.
For a testing purpose, I even created an empty Unity3D project, built it for iOS and still get the same errors, although this project does absolutely nothing.
The errors are the following:
ld: library not found for -liPhone-lib
clang: error: linker command failed with exit code 1 (use -v to see invocation)
And these are the settings I use:
Architectures: armv7, armv7s, arm64 (also tried removing arm64 without any positive result)
Base SDK: iOS 7.1
Build active: no
Supported platform: iOS
Valid arch: armv7, armv7s, arm64
I use XCode 5.1.1 and Unity 4.5.1 (previously even tried 4.3.2)
How can I build the project and create the Archive?
I've run into the same issue some time ago and it was fixed by replacing quotes under library search path:
replace
"$(SRCROOT)/Libraries"
with
$(SRCROOT)/Libraries
more: http://answers.unity3d.com/questions/538363/error-when-i-updated-to-xcode-5-to-get-import-to-i.html
I have been facing this lingering issue. When I try to Build the project by selecting iOS device in my Xcode it builds the code with out any error but when I trying the same with iOS simulator it shows me the following error.
ld: library not found for -lPods-ClientService
clang: error: linker command failed with exit code 1 (use -v to see invocation)
The issue is that you are trying to use a library that you created yourself or downloaded from a 3rd party with your product, and the linker either not find it, or it does not contain a valid slice for the architecture / platform that you are trying to link.
It is most likely that the library is just an arm library, without an intel slice.
If you are building it yourself, this may be because the library and your app are in two separate Xcode projects. If you integrate them into a single project, the build system should take care of making sure that the library gets built for the correct platform and architecture(s) when building your app.
I have created a custom Objective-C framework. I would like to import it into any given iOS project and use its provided functionality on both the iOS Simulator and an actual device. To import the framework, I link it using the Build Phases > Link Binary With Libraries setting in the app's target. I'm then able to import it into one of my classes with this statement:
#import <CustomFramework/CustomFramework.h>
I can instantiate my framework's classes just fine, but when I try to run my project on a device, I get the following error message:
dyld: Library not loaded: #rpath/CustomFramework.framework/CustomFramework
Referenced from: /var/mobile/Applications/A61E882D-481A-4C0B-B4FD-69F5D24968BF/TestApp.app/TestApp
Reason: image not found
And if I try to run it on the simulator, I get a different error message:
ld: warning: ignoring file /Users/user/Desktop/CustomFramework.framework/CustomFramework, missing required architecture i386 in file /Users/user/Desktop/CustomFramework.framework/CustomFramework (2 slices)
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_CustomFramework", referenced from:
objc-class-ref in AppDelegate.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
This occurs when I instantiate a class from the framework. If I import the framework but don't actually use it, my app builds successfully. It just errors whenever I instantiate a class from the framework for some reason.
To get the app to build on a device, I followed this SO answer. Instead of linking the framework, I added a new Copy Files phase in the target's Build Phases setting, set the Destination to Framework, and added my framework.
That works great; however, I'd like to test my app on the iOS Simulator as well. When I try to run my app on the simulator, I still get the "missing required architecture i386" error. I've tried the solutions proposed at just about every related SO topic I could find, and nothing has helped me resolve this issue.
Please note that I am trying to use my custom framework in a new Xcode project, so none of the app/build settings have been changed from their defaults.
How can I fix this error so that I can run my app on both the iOS Simulator and a device with my framework included in the project? Any insight would be greatly appreciated!
The issue was that the framework was not compiled for the iOS Simulator's architecture, which is i386. Xcode only compiles a framework for the target architecture, so if I built the framework for the iOS Simulator, it wouldn't work on a device, and if I built the framework for a device, it wouldn't work on the iOS Simulator.
I created my framework from scratch with help from this tutorial: http://www.raywenderlich.com/65964/create-a-framework-for-ios
The multi-architecture build script is what allowed my framework to run on both the iOS Simulator and a device.
I encountered this same problem with Xcode 7.1 when trying to build for the simulator.
Someone else said it worked for them under Xcode 8.2.1, so I tried building/running there and it worked. I didn't have to change targets or anything in my project.
So try upgrading your Xcode if you can, you will presumably get additional bug fixes as well.
I'm brand new to iOS development, and I've been given the task of updating a legacy app to iOS6. The app was built with Unity. In XCode 4.5, when I try to run the Unity-iPhone app on my device (iPhone 4), I get this error:
Xcode cannot run using the selected device.
Choose a destination with a supported architecture in order to run on this device.
I went to the build settings for the target, and noticed that armv6 was set for architectures and valid architectures. I changed both of these settings to be Standard(armv7, armv7s). When I tried to run the project, I got 104 compiler errors like this one:
Undefined symbols for architecture armv7:
"ForceInclude_BaseBehaviourManager()", referenced from:
RegisterManagerClasses() in RegisterClasses.o
So, it's not just a matter of importing the right frameworks into the project. These are all methods in one of the source files. How can they be undefined for armv7? Also, how would one solve this issue?
NOTE: For running app in device the device IOS version must match with the IOS DEPLOYEMENT TARGET
see below image:
Just change the IOS DEPLOYEMENT TARGET with Your Device IOS.
Select Project->Select Info(tab)->select the IOS deployment Target from the drop down box
ALSO NOTE :Xcode 4.5 (and later) does not support generating armv6 binaries.
I'm not sure what version of the Unity engine you are using, but does it support armv7?
Because if it does not, and it only supports armv6, then you will have to downgrade your Xcode version so that you use a compiler that compiles armv6 binaries, because Xcode 4.5 doesn't do this.
If you are using a version of Unity which supports armv7, then you need to set your minimum deployment version to iOS4.3
try architecture armv6 and armv7
clean the project
build again.