Xcode5: Failed to register "/System/Library/CoreServices/CoreTypes.bundle/Contents/Library/MobileDevices.bundle - ios

My library has some type converters. I'm registering some OSX and iOS type converters, like so:
When I compile for iOS, I'm getting some errors related to not being able to find UIKit. Here's how I compile for iOS:
xcodebuild -destination OS=${module.sdk.version},name=iPhone -workspace ${workspace} -scheme '${library.ios.scheme}'
The ${} tokens are patched in by my build system.
When building I get:
__build.library.ios.simulator:
[exec] Details: Failed to register "/System/Library/CoreServices/CoreTypes.bundle/Contents/Library/MobileDevices.bundle" with Launch Services, error code: -10811.
[exec] Function: __RegisterUTIsIfNeeded_block_invoke
[exec] Thread: <NSThread: 0x7faca140e5c0>{name = (null), num = 1}
[exec] Please file a bug at http://bugreport.apple.com with this warning message and any useful information you can
How can I fix this?

This appears to be an compiler bug, and there's not much that can be done about it.
Here is oficial answer on JetBrains Tracker:
Anton Makeev 17 Sep 2013, 19:36
build error doesn't affect compilation results - it's just a log message from xcodebuild.
Simulator should work correctly after you run it at least once in Xcode 5.
and:
We will handle this output in AppCode (show it as a warning, not a n error) but we recommend filing the error to Apple as the message suggests - unfortunately we can't fix it (only hide)
and:
Build error won't go away until we implement 'hide-it-fix' or until Apple fixes it. It is harmless, though and doesn't affect build result.

Related

IPA Processing Failed: Could not resolve #executable_path

I am stuck with this error when exporting IPA.
I did refer similar questions and none of them worked for me.
I am migrating my project from carthage to SPM, most of the frameworks which I use support SPM and only two had XCFrameworks.
Have added XCFrameworks with Embed & Sign, and earlier I used to have the simulator architectures removal script, with XCFrameworks I have removed that from my build phase step now.
When looked in the standard log I could not spot any error when searched with "fail"
Is there anything in the standard log which would indicate an error which I should be looking for ?
EDIT: Before you close as Duplicate of How to fix "IPA processing failed" error in xcode 11?
Please check this is for Xcode 12 with SPM & XCFrameworks !
The only errors I can spot in the logs are below:
2021-02-10 09:37:47 +0000 Scanning IPA...
2021-02-10 09:37:50 +0000 warning: Failed to resolve rpath for **SDK: Could not resolve #executable_path for #executable_path/Frameworks from **SDK
2021-02-10 09:37:50 +0000 warning: Failed to resolve rpath for ***: Could not resolve #executable_path for #executable_path/Frameworks from ***
But when I compared with the logs from another project with similar set up, I can see the same set of "warnings" and I am able to generate IPA on the another project.

iOS/macOS app distribution failed while using framework after upgrading Xcode12 and macOS BigSur

We are unable to distribute our sample app which uses our framework as well as our users can't.
While archiving and distributing to AppStore, the app is rejected with the following message:
Invalid Bundle - One or more dynamic libraries that are referenced by your app are not present in the dylib search path. If your app contains bitcode, bitcode processing may have failed. Because of these errors, this build of your app will not be able to be submitted for review or placed on the App Store.
The framework contain the bitcode, or at least there's a BITCODE_GENERATION_MODE = bitcode build setting in our .xcconfig, which basically means, the Xcode will add -fembed-bitcode build flag to any clang invocation.
From here, we've started testing using Ad-Hoc builds, to speed up our trial and error attempts, which also fails while Rebuild from bitcode option is selected. Organiser shows the popup with the following contents:
ipatool failed with an exception: #<CmdSpec::NonZeroExitException: $ /Applications/Xcode.app/Contents/Developer/usr/bin/python3 /Applications/Xcode.app/Contents/Developer/usr/bin/bitcode-build-tool -v -t /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin --sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.2.sdk -o /var/folders/vz/b0jj0dms4014y5htfv93svfc0000gn/T/ipatool20201130-52097-13rj9hy/thinned-out/arm64/Payload/iosTest.app/Frameworks/SciChart.framework/SciChart --generate-dsym /var/folders/vz/b0jj0dms4014y5htfv93svfc0000gn/T/ipatool20201130-52097-13rj9hy/thinned-out/arm64/Payload/iosTest.app/Frameworks/SciChart.framework/SciChart.dSYM --strip-swift-symbols /var/folders/vz/b0jj0dms4014y5htfv93svfc0000gn/T/ipatool20201130-52097-13rj9hy/thinned-in/arm64/Payload/iosTest.app/Frameworks/SciChart.framework/SciChart
Status: pid 52150 exit 1
Stdout:
SDK path: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/
Logs provided isn't very informative, here is the snippet from IDEDistributionPipeline.log
-= Output =-
ld: warning: -sdk_version and -platform_version are not compatible, ignoring -sdk_version
Undefined symbols for architecture arm64:
"___llvm_profile_runtime", referenced from:
__hidden#25821_ in 0832.o
__hidden#25821_ in 0833.o
__hidden#25821_ in 0834.o
__hidden#25821_ in 0835.o
__hid
2020-11-30 16:19:17 +0000 den#25821_ in 0836.o
__hidden#25821_ in 0837.o
__hidden#25821_ in 0838.o
...
ld: symbol(s) not found for architecture arm64
Exited with 1z
Failed to compile bundle: /var/folders/vz/b0jj0dms4014y5htfv93svfc0000gn/T/SciChart6aun_sfs/SciChart.arm64.xar
Stderr:
from /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:2808:in `block in CompileOrStripBitcodeInBundle'
from /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:2747:in `each'
from /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:2747:in `CompileOrStripBitcodeInBundle'
from /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:3016:in `block in ProcessIPA'
from /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:2978:in `each'
from /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:2978:in `ProcessIPA'
from /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:3928:in `<main>'
2020-11-30 16:19:17 +0000 /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool exited with 1
which after bunch of warnings shows the actual error at the end of file (I can't include full log, since it's too much of a raw text):
code = 1061;
description = "ipatool failed with an exception: #<CmdSpec::NonZeroExitException: ...
info = {
};
level = ERROR;
type = exception;
Not sure what to to do with this, I've tried different build settings options, nothing helped... Already contacted apple, but no feedback yet, and knowing them, we can wait far too long...
The strange part here, is if we include our .framework directly as a source code and then archive the app - everything works as expected. If we include it as XCFramework or just .framework, which is pre-built - it fails as described above.
I might miss something simple or obvious here, so please let me know if somebody have some insights on that matter.
Some system info:
macOS BigSur 11.0.1
XCode Version 12.2 (12B45b)
We've tried different combinations of macOS and Xcode, e.g.:
Catalina with Xcode 12
BigSur with Xcode 11
etc.
Any help is greatly appreciated.
Thanks.
Long story short, there were LLVM instrumentation included, which prevents AppStore processing. I've written a whole blog post about it here - https://blog.scichart.com/xcframework-xcode-12-and-bigsur-issues/
To sum up, here is a few required steps to make sure while creating XCFramework for distribution:
Using archive builds is a MUST, release build isn't enough
BUILD_LIBRARY_FOR_DISTRIBUTION must be set to YES
SKIP_INSTALL must be set to NO
GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = NO to turn off GCC instrumentation and remove them from the binary
CLANG_ENABLE_CODE_COVERAGE = NO to turn off code coverage tools from the binary
Having all of the above helped to solve our preparing and distribution problem and hopefully save you some time if you happened to face same issues as we did.

Can not make script 'run-sonar-swift' works

I am trying to run sonar swift.
I have already sonarQube with the plugin and I can access it locally using this url http://localhost:9000 . I have installed all prerequisites that you can find here :
https://github.com/Backelite/sonar-swift
But I can't figure out what is this error when i launch run-sonar-swift.sh.
If anyone can bring me the light I would be very grateful.
Here the logs when I run in terminal command ./run-sonar-swift.sh -v :
MacBook-Air:streamus-phoenix-ios oboujaouane$ ./run-sonar-swift.sh -v
Running run-sonar-swift.sh...
Project count is [1]
Xcode project file is: Streamus.xcodeproj
Xcode workspace file is: Streamus.xcworkspace
Xcode application scheme is: Streamus Alpha
Destination simulator is: platform=iOS Simulator,name=iPhone 6,OS=11.3
Excluded paths from coverage are: .Tests.
Creating directory sonar-reports/
Running tests
+ xcodebuild clean build test -workspace Streamus.xcworkspace -scheme 'Streamus Alpha' -configuration Debug -enableCodeCoverage YES -destination 'platform=iOS Simulator,name=iPhone 6,OS=11.3' -destination-timeout 60
2018-05-12 10:34:14.031 xcodebuild[32149:775290] IDETestOperationsObserverDebug: Writing diagnostic log for test session to:
/var/folders/9v/vdbbf4j96hxgcxmtpntznytr0000gn/T/com.apple.dt.XCTest/IDETestRunSession-9A7EF764-6391-4C7D-9F34-066A9DFEC5E9/StreamusUITests-87E838E0-4F8F-4C19-B2AC-C2C0A274E8EC/Session-StreamusUITests-2018-05-12_103414-jhm3wz.log
2018-05-12 10:34:14.032 xcodebuild[32149:769805] [MT] IDETestOperationsObserverDebug: (98FB295E-FE60-46AA-8589-015B0DD2E617) Beginning test session StreamusUITests-98FB295E-FE60-46AA-8589-015B0DD2E617 at 2018-05-12 10:34:14.031 with Xcode 9E145 on target {
SimDevice: iPhone 6 (672DE879-E48B-45DA-BFD9-D0412F51A706, iOS 11.3, Booted)
} (11.3 (15E217))
2018-05-12 10:34:14.061 xcodebuild[32149:769805] [MT] IDETestOperationsObserverDebug: (458F86F6-1492-40F1-9F72-A88FC23BD985) Beginning test session StreamusTests-458F86F6-1492-40F1-9F72-A88FC23BD985 at
2018-05-12 10:34:14.061 with Xcode 9E145 on target {
SimDevice: iPhone 6 (672DE879-E48B-45DA-BFD9-D0412F51A706, iOS 11.3, Booted)
} (11.3 (15E217))
2018-05-12 10:34:14.061 xcodebuild[32149:770075] IDETestOperationsObserverDebug: Writing diagnostic log for test session to:
/var/folders/9v/vdbbf4j96hxgcxmtpntznytr0000gn/T/com.apple.dt.XCTest/IDETestRunSession-9A7EF764-6391-4C7D-9F34-066A9DFEC5E9/StreamusTests-4F203461-1372-49B7-A806-F130F168079E/Session-StreamusTests-2018-05-12_103414-MfIreE.log
2018-05-12 10:34:30.016 xcodebuild[32149:769805]
Error Domain=IDETestOperationsObserverErrorDomain Code=14 "Test operation was canceled. If you believe this error represents a bug, please attach the log file at /var/folders/9v/vdbbf4j96hxgcxmtpntznytr0000gn/T/com.apple.dt.XCTest/IDETestRunSession-9A7EF764-6391-4C7D-9F34-066A9DFEC5E9/StreamusUITests-87E838E0-4F8F-4C19-B2AC-C2C0A274E8EC/Session-StreamusUITests-2018-05-12_103414-jhm3wz.log"
UserInfo={NSLocalizedDescription=Test operation was canceled. If you believe this error represents a bug, please attach the log file at /var/folders/9v/vdbbf4j96hxgcxmtpntznytr0000gn/T/com.apple.dt.XCTest/IDETestRunSession-9A7EF764-6391-4C7D-9F34-066A9DFEC5E9/StreamusUITests-87E838E0-4F8F-4C19-B2AC-C2C0A274E8EC/Session-StreamusUITests-2018-05-12_103414-jhm3wz.log}
2018-05-12 10:34:30.016 xcodebuild[32149:769805] Error Domain=IDETestOperationsObserverErrorDomain Code=14 "Test operation was canceled. If you believe this error represents a bug, please attach the log file at /var/folders/9v/vdbbf4j96hxgcxmtpntznytr0000gn/T/com.apple.dt.XCTest/IDETestRunSession-9A7EF764-6391-4C7D-9F34-066A9DFEC5E9/StreamusTests-4F203461-1372-49B7-A806-F130F168079E/Session-StreamusTests-2018-05-12_103414-MfIreE.log" UserInfo={NSLocalizedDescription=Test operation was canceled. If you believe this error represents a bug, please attach the log file at /var/folders/9v/vdbbf4j96hxgcxmtpntznytr0000gn/T/com.apple.dt.XCTest/IDETestRunSession-9A7EF764-6391-4C7D-9F34-066A9DFEC5E9/StreamusTests-4F203461-1372-49B7-A806-F130F168079E/Session-StreamusTests-2018-05-12_103414-MfIreE.log}
Testing failed:
Linker command failed with exit code 1 (use -v to see invocation)
** TEST FAILED **
The following build commands failed:
Ld /Users/oboujaouane/Library/Developer/Xcode/DerivedData/Streamus-gwtdwpbaxrfgafdtejzjtpxyhhhq/Build/Intermediates.noindex/Streamus.build/Alpha-iphonesimulator/StreamusTests.build/Objects-normal/x86_64/StreamusTests normal x86_64
Ld /Users/oboujaouane/Library/Developer/Xcode/DerivedData/Streamus-gwtdwpbaxrfgafdtejzjtpxyhhhq/Build/Intermediates.noindex/Streamus.build/Alpha-iphonesimulator/StreamusTests.build/Objects-normal/i386/StreamusTests normal i386
(2 failures)
returnValue=65
set +x
ERROR - Command 'xcodebuild clean build test -workspace Streamus.xcworkspace -scheme Streamus Alpha -configuration Debug -enableCodeCoverage YES -destination platform=iOS Simulator,name=iPhone 6,OS=11.3 -destination-timeout 60' failed with error code: 65
In advance thank you,
It seems that error was due to provisioning profile. When I added my Provisioning Profile and try it again the problem was resolved.
Then I had another problem with MessageKit:“Segmentation fault: 11”
It was a CocoaPods Podfile config issue.
So I had to switch compilation mode for Debug from "Single File" to "Whole Module” by click on Pods in Xcode project navigator then select MessageKit in targets of pods then Builds settings tab then in searcher tap ‘compilation mode’ and switch “Single File” to “Whole Module” and re-run script run-sonar-swift.sh

⚠️ each time you make a pod install / update or something that can change pods you have to switch compilation mode for Debug from "Single File" to "Whole Module” for the pod which give you an error when you launch run-sonar.swift.sh with -v for verbose.
After that it was not yet the end of my problems! In fact I had a last problem which was an error with SwipeCellKit pod:
“No such module SwipeCellKit”.
To resolve this problem follow instructions given here https://stackoverflow.com/a/37732248/6188918
Then I tried again and the rest of the script started (SwiftLint, Tailor & Lizard) and I thought this time it was finally good but an error occurred once again a new error message at the end of the script concerning Lizard which was:
ERROR: Error during SonarQube Scanner execution
ERROR: File
MyprojectName/Domains/Repositories/Local/cacheManager.swift can't be
indexed twice. Please check that inclusion/exclusion patterns produce
disjoint sets for main and test files
ERROR: Re-run SonarQube Scanner using the -X switch to enable full
debug logging.
To resolve this inclusion/exclusion I followed the answer given here:
https://stackoverflow.com/a/40150551/6188918
by adding these to line in sonar-project.properties file below sonar.swift.excludedPathsFromCoverage line:
sonar.test.inclusions=**/*Test*/**
sonar.exclusions=**/*Test*/**
I tried again but with parameter -notailor(run script and skip Tailor):
./run-sonar-swift.sh -notailor -v
just to save a little time because tailor take time
And after launch the script... Boom a new error... But it was a known issue:
Error: Caused by: org.sonar.api.measures.PersistenceMode
And the issue is explained here https://github.com/Backelite/sonar-swift/issues/118
So I downloaded this .jar file “backelite-sonar-swift-plugin-0.4-sonar-7-quick-fix.jar” found here https://github.com/Hugal31/sonar-swift/releases/tag/0.4-sonar-7-quick-fix and replace it in plugins of my local SonarQube and try again.
…and this time after an umpteenth launch I finally saw the light 🤪💡
Hope this answer will help and if you have a question don’t hesitate.


Good luck & have fun :)
PS: You’ll find here some options to run script with parameters:
./run-sonar-swift.sh -noswiftlint -v (run script with verbose option and skip SwiftLint)
./run-sonar-swift.sh -notailor -v (run script with verbose option and skip Tailor)
./run-sonar-swift.sh -nounittests -v (if your project does not have scheme configured to be tested launch with this parameter)
If you want more info check in run-sonar-swift.sh script and check around lines 125 ## COMMAND LINE OPTIONS
PS2: I have also opened an issue in sonar-swift GitHub if it can help: https://github.com/Backelite/sonar-swift/issues/138
I had an extra issue with oclint: oclint: Not enough positional command line arguments specified!. So I had to modify the run-sonar-swift.sh script a little bit in order to get it working: https://gist.github.com/Edudjr/79a2379842357c33709aecf040d9ae77#file-run-sonar-swift-sh
And this is a model of my sonar-project.properties: https://gist.github.com/Edudjr/db51907068ea76b116d11d9a9b13f05f#file-sonar-project-properties

Xcodebuild: Failed to load Addressbook

When I used carthage, build always faild, So I search carthage github issues, I found it seems to be xcodebuild error, Even though, I input xcodebuild -list it will throw error
~$ > xcodebuild -list
2016-03-02 10:40:17.413 xcodebuild[17993:2398778] ### Failed to load Addressbook class CNContactNameFormatter
Information about project "ReactiveCocoa":
Targets:
ReactiveCocoa-Mac
ReactiveCocoa-MacTests
ReactiveCocoa-iOS
I have no idea about this, Please help me!
The error Failed to load Addressbook class CNContactNameFormatter is emitted from xcodebuild even when everything succeeds.
You can ignore it. Would be nice to find a way to squelch it.

Shenzen ios build giving error

I'm getting the following error when running the Shenzen (https://github.com/nomad/shenzhen) utility. I am using Xcode 6 beta 4 trying to build an ios app. Any thoughts?
ipa build
Select a scheme:
1. FieldApp-LOCAL
2. FieldApp-RELEASE
? 2
xcodebuild FieldApp.xcworkspace
2014-07-28 09:00:43.703 xcodebuild[35326:1912070] [MT] DVTAssertions: Warning in /SourceCache/IDEFrameworks/IDEFrameworks-6244.6/IDEFoundation/SourceControl/Model/IDESourceControlManager.m:432
Details: Error Domain=com.apple.dt.IDESourceControlErrorDomain Code=-1 "Missing extension: public.vcs.subversion" UserInfo=0x7fb4a2cb14a0 {NSLocalizedDescription=Missing extension: public.vcs.subversion}
Object: <IDESourceControlManager: 0x7fb4a072c9e0>
Method: -loadRepositories
Thread: <NSThread: 0x7fb4a0605350>{number = 1, name = main}
Please file a bug at http://bugreport.apple.com with this warning message and any useful information you can provide.
** ARCHIVE FAILED **
The following build commands failed:
DataModelVersionCompile /Users/seanzehnder/Library/Developer/Xcode/DerivedData/FieldApp-heytvqitcxovbbegdtzbrxjofaty/Build/Intermediates/ArchiveIntermediates/FieldApp-RELEASE/InstallationBuildProductsLocation/Applications/Visit\ Tracker.app/FieldApp.momd DataModel/FieldApp.xcdatamodeld
DataModelVersionCompile /Users/seanzehnder/Library/Developer/Xcode/DerivedData/FieldApp-heytvqitcxovbbegdtzbrxjofaty/Build/Intermediates/ArchiveIntermediates/FieldApp-RELEASE/InstallationBuildProductsLocation/Applications/Visit\ Tracker.app/FieldApp.momd DataModel/FieldApp.xcdatamodeld
(2 failures)
First get it running and test it in XCode, then check the log for any errors.
Then you can try building it.
It may be that you haven't got the audio listener properly set up!
It could also be that you built it in xcode 4 so Xcode 6 would show lots of errors, Path errors etc. It is likely that there is a compatibility issue :)

Resources