Apple Mach-O Linker error for only one device. Other phone works fine - objective-c

Xcode is giving me an error when I'm trying to test my app on my iPhone 5. It works perfectly on the iPhone 6 plus. Both are running the same OS and are registered to my developer account.
The specific error is: "can't link with a main executable file" from my derived data folder "for architecture armv7".
I tried updating the last version of X-Code 6, restarting, and cleaning the file with no success.
Any ideas?
Edit:
I found this suggestion: can't link with a main executable file.
When I selected a app name, I now get this error.

Related

Xamarin.iOS : Native Linking Error: Is there a limit on No. of files in IOS?

We are working on a large Xamarin.Forms project, the customer wanted Android release first, so we complete the entire Android project and delivered it, now when we have started working on IOS project, we are facing challenges as we keep adding more forms to the IOS project. Some of the errors are
Error # 1.
Native linking error: don't know how to convert instruction ec7acce4 referencing _mono_create_corlib_exception_0.island to thumb in
'# _object_System_Type_object_System_Globalization_CultureInfo'
from /#.iOS/1db41bf625bf2eb66083739a668e7273/obj/iPhone/Debug/mtouch-cache/#.dll.armv7.o for architecture armv7 iOS
Error # 2.
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
Since we were not making any headway, we started creating a new Solution in Xamarin.forms and started adding one Form in each Android and IOS, it worked fine until a specific number of files count, after that we started getting the same errors again in IOS.
the project works fine with about 867 files. (PCL - 638 files, ios - 107 files, Android - 122 files)
As soon as I add a new set of forms to PCL project, I get the above error #1, or Error # 2 in IOS project. The Android project works fine.
There is no sequence of the error, any of the above error just comes up, after I reduce the file count, the error is gone
Is there a limitation to the number of Forms in IOS? or Is there any limitation on the binary size. As per my understanding, IOS allows up to 100 MB in binaries. My current IOS binary is about 55 MB
I am stuck and not able to find any solution till now. Have already tried upgrading/downgrading Xamarin.forms versions, but no help, currently on Xamarin.forms 2.3.4.224
Xamrin.ios 10.3.1.8
Xamarin.Android 7.0.2.42
Xamarin 4.2.2.11
visual studio 2015 Professional
Also tried compiling and opening the project on MAC, visual studio 2017 Professional, getting same error
Also tried compiling on Xamarin studio on MAC, still getting same error.
It seems the native code Xamarin generates for one of your assemblies ends up hitting size limitations in the native (Mach-O) file format.
Solution:
One of the solution from similar cases is adding --mono:framework to the "Additional mtouch arguments" at iOS Platform->Properties->iOS Build.
Then the mono runtime will be included as a framework in the app, instead of linked statically into the main executable.
References:
https://bugzilla.xamarin.com/show_bug.cgi?id=51226
https://bugzilla.xamarin.com/show_bug.cgi?id=29615

how to fix 'MobileCoreServices/MobileCoreServices.h' file not found error in winobjc

I want to port my ios app to windows desktop app using winobjc.
I imported my xcode project using vsimporter.exe, and tried to build it.
But it displays error" 'MobileCoreServices/MobileCoreServices.h' file not found".
How to fix it?

Xcode 5.0.2 : Failed to Launch Cocoa Touch Tool...?

I've been trying to do some programming with Xcode 5, but I've been having some problems. I'm trying to create a new Objective-C Class from File > New File. I can create the class, but a few seconds after it's been created, Xcode crashes and gives me an error. I tried this 3 times, and got the same error. I put the error as well as my console log for it here:
Error: http://www.pastebin.com/PmdZaDag
Console Log: http://www.pastebin.com/5sCmcurW
I don't really know much about programming in Xcode, so I'm not sure what the problem is at all. Thanks!
Xcode 5.0.2
MacBook Pro Retina with OS X 10.10.1
The issue seems like in your Xcode 5.0.2. Tried with higher version or install the same version of Xcode again.
I got this problem too .
Here is my solution:
create a new .storyboard file
right click these two .storyboard file respectively Open As >> Source Code
According to the new .storyboard file , change the version and toolsVersion Tag

How to run unsigned cocoa app build on another mac?

OS X 10.9.4
X-Code 5.1.1
I don't have Mac Developer Program account.
I created app for OS X, builded unsigned .app. It runs perfectly and works on my Mac. When I copy application to another Mac with the same version of OS X, try to run but nothing leads. Application icon starts appear in Dock and immediately disappears without any message. Running in the console gives an error "LSOpenURLsWithRole () failed with error -10810", unfortunately -10,810 is an unknown error.
I tried the same thing with a empty application "HelloWorld", it did not run too. Install and run applications from unknown developers in security setting is turned on.
I tried build LASlider example-project (https://github.com/Doshipak/LADSlider), that I use in my project. When I run it on another mac, app crashes like HelloWorld & my project..
Does someone has similar problems?
What had happened: Safari download invalid *.app from Dropbox with empty app body, same thing happens if you try to transfer *.app with TeamViewer. But result file looks normal.
Decision: always pack *.app in archive.

Library not loaded

I added Social.framework in my application in the same way i use to add the other frame works. I have downloaded xcode 4.5 and iOS 6 . but my application crashes with follwing error only on device. It works fine on simulator.
dyld: Library not loaded: /System/Library/Frameworks/Social.framework/Social
Referenced from: /var/mobile/Applications/FC88291D-2052-45D6-A7BB-65CE340F07BF/Uploading Image.app/Uploading Image
Reason: image not found
I was getting this exact error. My app currently has a deployment target of 5.1. I wanted to add Facebook sharing. I found this old post, Conditionally including a library for different iOS SDK versions?. All I did was set "Social.framework" to 'optional' and it did the trick, then my app would run on ios 5.1 and ios 6.0. Of course you need to do checks at runtime for what OS the device is running otherwise you could run into a crash if you try to access social.framework in ios 5.1 or earlier. Hope that helps!
In Xcode go to targets, Go to build phase and search for Social frame work you will find that under "Link Binary with Libraries" section. There select social frame work and see there is an option on right hand side required/optional in that just change required to optional. Now you are able to run on all ios devices without any crashes.