Error if try build app on apple silicon, m1 - swift

have problem with my project when trying to build my app on M1 Pro Mac. If I want to build it on simulator, It's works when I added arm64 x86-64 to Excluded arch in build settings to Debug. But sometimes I need to build app on my device iPhone. And it works only if I delete this strokes in build settings. Could someone help with it? I need some settings to work both on device and simulator without adding/deleting Excluded arch build settings every time when I need it.
Xcode shows errors something like that :
"Could not find module 'Moya' for target 'arm64-apple-ios-simulator'; found: x86_64-apple-ios-simulator" and not only for Moya.

Related

Xcode SDK Version Issue

I'm having a bit of an issue with distributing an app via the latest version of Xcode (Version 10.1 (10B61)). Every time I try to upload it to the App Store via organizer, I get this error after uploading:
WARNING ITMS-90725: "SDK Version Issue. This app was built with the iOS 12.0 SDK. Starting March 2019, all iOS apps submitted to the App Store must be built with the iOS 12.1 SDK or later, included in Xcode 10.1 or later."
Previous answers to this question said that it was just a warning and that I should still be able to upload my app, but it is now March and I am still getting the error even on 10.1. iTunesConnect will not let me select these builds and I get emails about the validation failure.
Further details:
-The app is an iMessage extension, and uses exactly 1 framework from Carthage, which is up to date with the latest framework version and Carthage version.
-My project and Message extension targets Swift Language Version build setting is Swift 4.2.
-My deployment target is iOS 11.0, but the issue persists after selecting iOS 12.1.
-The app compiles and runs fine on my physical device running iOS 12.1.
-The issue persists after a build folder clean.
-The issue persists after reinstalling Xcode.
If anyone has any suggestions as to how I can verify my app is compiling with the latest SDK please let me know.
Whether the app runs on given iOS version, has no relevance to which SDK are you really using. The definitive SDK version used for building is found in the app's Info.plist.
after Archiving, Show the xcarchive in Finder.
right-click, Show Package Contents.
open Products/Applications/YourApp.app
right-click, Show Package Contents.
copy the Info.plist to some place where you can run terminal commands on it
/usr/libexec/PlistBuddy -c "print :DTSDKBuild" Info.plist
You would expect it to show "16B91" for SDK 12.1. If it's something else (SDK 12.0 would be "16A366"), here are some ideas:
inspect the Carthage dependency. Are you really building it locally or downloading a prebuilt binary? If in doubt, force local building with --no-use-binaries. Remove whole Carthage folder (Checkouts as well as Build) and start from scratch.
rm -rf ~/Library/Developer/Xcode/DerivedData instead of just "build folder clean"
Verify MacOS System Report section Software/Developer for the actual SDK versions that MacOS thinks that you have
xcode-select -p to verify that you are really using the Xcode instance that you would like to
If all looks correct on your side, fill Technical Support Incident. Report the exact rejected build which you uploaded already. That should speed up the support reaction.
I filled out a bug report with Apple because I was experiencing the exact same issue and none of the above solutions worked. They made a change on their backend and now everything is back to proper working order.
If you haven't tried in awhile, make another attempt and I'm betting that it'll work this time.
I was having the same problem. My app was compiled in Xcode 10.1 but I was still getting the SDK warning. I was able to resolve it by doing the following. I'm not sure if all these steps are necessary. I didn't try validating between steps.
I upgraded macOS to Mojave (10.14.3). I had been running High Sierra.
Delete Xcode from applications folder
Reinstall Xcode from the app store
Open my project and run Project->Clean Build folder
Archive and upload and no more warnings

Jailcoder how to

I just tried to get my own app on my iPhone without a developer account. The following are steps I did:
I patched Xcode and my project (Currency.xcodeproj) with JailCoder
I want to build the project with "iOS device" in Xcode. But I got a error message like "no device found". So I ran it in the emulator and I got the currency.app-file in /Users/Dogan/Library/Developer/Xcode/DerivedData/Currency-gjxrulouxbmjslbzslsplyehgfgm/Build/Products/Debug-iphonesimulator
SSH to iPhone in /var/mobile/Applications
Creating a new folder named FADE9826-4878-4458-B5BE-90AD4EB60FDF (I have to take a valid UDID. Have I use to specific tools to create a UDID? I have the UDID from an other example). I also created a directory in this folder with the name "Documents".
chown -R mobile FADE9826-4878-4458-B5BE-90AD4EB60FDF
scp -r Currency.app root#IP-ADRESS-OF-IPHONE:/var/mobile/Applications/FADE9826-4878-4458-B5BE-90AD4EB60FDF/
Restarting Springboard in SSH with "killall SpringBoard"
I got the app, but it doesn't work. Every time on click, it crashes and kicks me to the home screen. Had I missed something?
You missed that simulator builds don't work on iPhones, because they are built for the wrong CPU type. Simulator builds are Intel x86 apps, and the iPhone has an ARM CPU.
There might be other problems (I don't know how jailcoder works) but there's no way you're getting the simulator build running on the phone.
After downloading Jailcoder and going through the guided patch of Xcode and then patching your project, if your device is plugged into your computer, select the target type (where you can select simulator, iOS Device, etc.) and there should be a listing of your device's name.

Xcode can not run the project on selected device

I got the project from my team and i am working on it when ever i restart the system my Xcode not runs the project, but i am able to run other projects easily .... after i run the project with the changes i do it shows me
"Cannot run on the selected destination- The selected destination does not support the architecture for which the selected software is build. Switch to a destination that supports that architecture in order to run the selected software."
And if i run the original project it runs fine then i have to again copy and paste the codes that i did in the project after that it runs fine, but when i open my Mac the next day it does not runs and again i have to start from the original project, What is happening i don't know why after Restarting or Shut Down the project does not runs.
I am using Xcode 4.5.2 on iMac 21.5-inch - Software OS X 10.8.2 (12C60)(Mountain Loin)
Processor 2.5 Ghz Intel Core i5, Memory 4 GB 1333 MHz DDR3.
Project target is iOS SDK 6.0 (on iOS 6 simulator).
Does Not runs on Simulator and on Device also.
Sometimes just runs on the simulator but not on Device.
I have tried :
Restarting the Mac.
Cleared Derived Data.
Reinstalling Xcode.
But still can't figure out .. Nothing helps .. plz Help me on this ...
I think that if the project finds some cache memory problem then after restarting the system it some times start working fine or in case of same project with different destination with some minute changes you are running then it some times hanged in the device or simulator for that we have to need to switch off the device and restart again then after it start working fine. And if the project code is in iOS 5.0 and the IPod/IPhone device os is 6.0 then it does not show in the device section for running. For that first you have to run the device to the xcode with ios 6.0 and then it start working fine . But here, you have to notice that for each and every time after switch off you have to run the device first with xcode 6.0. But in your case some build target problem which is not clear to me . So , if you provide the details of bug then it will be easy for understand.
Check under Build Settings > Architectures and set Architectures to Standard (armv7) or ${ARCHS_STANDARD_32_BIT} for all your profiles.
Set Base SDK to Latest iOS().
Set Build Active Architecture Only to NO for all profiles.
Set Valid Architectures to armv6 armv7 for all profiles. You may have to add either depending on what is already available.
I have solve the problem using the below steps.
Close the Xcode
Delete the application from device
Restart the device
then re-run the application
it working fine..

iPhone app builds to simulator, won't build to device

Update 2
One of my other targets builds fine to device... looking at the difference in dependencies now.
================
Update
I have now installed new Xcode on a different computer, and I get the same result.
================
I have an app that builds OK to the simulator, but when I build to any device, it fails, and gives no errors.
When I look at the Log Navigator, I see this message:
Build operation failed without specifying any errors. Individual build tasks may have failed for unknown reasons. Some of these (up to 12) may be listed below.
That is the only error I see. I just installed XCode on this new computer, and it is XCode 4.5, including the iOS6 SDK. My partner is able to build the app just fine to the same devices, but she is on an older version of XCode, without iOS6.
You need to have iOS6 installed on your device to put apps in it. Do you have iOS6 GM on your device?
Make sure your device is on the latest version of iOS i.e iOS6.
I needed to update multiple frameworks I depended on.
I was still on Xcode 4.5.2 when I got this error. Two computer restarts fixed my problem.

Sometimes Xcode appears to ignore target build settings?

I've created a iPhone static library project with two targets like this
Project
--> Library (Device) target
--> Library (simulator) target
The device target has the SDK set to the device so it produces an armv6/7 library and the simulator target is set to the simulator SDK so it produces an i386 library.
The issue I'm having is that the SDK settings on the targets keep getting overridden by the XCode active target setting. i.e. if I build the device target, but the XCode window is showing the active SDK as being the simlulator, XCode will build a simulator library instead of a device library, ignoring the settings of the target. Although it will put it into the *-iphoneos/ directory in the build directories!
I originally had the same issue with another static library project, and after a lot of playing around got everything to work correctly. i.e. The targets ignore the XCode active SDK because they have their own specifications of what to build.
The problem is that I don't know what made it work in that project and I have not been able to reproduce the issue in it either.
Does anyone have any ideas as to what is going on?
ciao
Derek
OK, I think I've figured it out.
Set the project SDK to the general setting, ie. Simulator SDK so that you get the APIs and libraries correct during coding.
Set each target to the SKD it needs to build. ie. device SDK or simulator SDK.
Leave XCodes SDK set to current SDK, effectively telling it to not override the targets.