swift sodlib tool error happened when create a new target of Application Extension - swift

my container App is written by objective-c,then I used Xcode8 beta3 to create a new target of Application Extension which used swift ,when I build my project ,I got the error:
Effective srcDirs: {(
<DVTFilePath:0x7fdca8e8fb40:'/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator'>,
<DVTFilePath:0x7fdcbdfc31f0:'/Applications/Xcode-beta.app/Contents/Developer/Toolchains/Swift_2.3.xctoolchain/usr/lib/swift/iphonesimulator'>
)}
this error happened like in the progress of copying Swift standard libraries into xxx.app.
how can I fix this ,hope some one can help me

Related

Swift Vapor project not compiling due to strange errors in swift-nio

I can't get my Swift Vapor project to compile (which was running fine before), because nio produces strange errors all of a sudden:
Also, swift package update produces this:
.build/checkouts/swift-nio: error: Couldn’t check out revision ‘546610d52b19be3e19935e0880bb06b9c03f5cef’
I already cleaned, deleted derived data and rebuilt....any ideas?
Besides cleaning & re-building the project, you can try deleting the following files / directories:
/.build
/.swiftpm
/Package.resolved
Then, run swift package update and try to build the project again.

Mac: Bundle not found in embedded Helper app

I have a Swift Package with shared code.
With Xcode's SPM added to my Xcode project.
Works great in the main app.
Doesn't work in the helper app when exported. Running the helper app in Xcode itself works fine. But when running as an exported and signed app it doesn't work.
This error message was found in console:
Fatal error: unable to find bundle named MySwiftPackageName: file MySwiftPackageName/resource_bundle_accessor.swift, line 27
I double checked, the package is really added at
Build Phase -> Link Binary With Libraries
When I inspect the exported main app and helper app I found the package in the main resources folder but not in the helper app resources folder.
How can I fix this?
In the Swift Package Manager the use of Bundle changes a bit, when you compile the source or open up Xcode a autogenerated code is available to you, which is Bundle.module.
The Bundle.module code is fairly simple and should resolve the issue, it is used like this.
SwiftUI
Image("ImageName", bundle: Bundle.module)
UIKit
UIImage(named: "ImageName", in: .module, with: nil)

Swift Package Manager (package successfully added, but Module not found)

I'm new in Swift. I want to create iOS app that can connect to PostgreSQL database. First I found library https://github.com/vapor/postgresql.git that should be added to my project via Swift Package Manager. Using tutorial I added required library to my project successfully (File -> Swift Packages -> Add Package Dependency):
list of added packages from SPM
But when I try to import this module into my view controller, Xcode shows error that module is not found:
not found
I tried several times to rebuild my project, created new project just for testing this issue. Also I found information about build phases and added this lib as a dependency:
build phases
But I still get error: "No such module PostgreSQL".
Can anyone help me?
I found solution by myself. I compiled C static library "libpq" (can be found in PostgreSQL sources) and added it to my swift project. Included this library by adding special bridging header file. Finally I got what I wanted.
P.S. If someone what to repeat, he or she should know: static C library must be compiled for iOS device architecture (and also in iOS simulator architecture which differs from iOS device arch.).

Early grey environment setup

I'm trying to get Earlgrey setup on my computer by following the steps for Cocoapod installation as described here
After performing all the steps I keep on getting compilation error during build
EarlGrey.swift:17:27: Use of undeclared type 'EarlGreyImpl'
There are 13 such compilation errors all related to unresolved identifier.
I re-tried the steps multiple times with same results. My folder structure matches with what is shown in the instructions.
Any suggestions where should i look further to get this resolved.
For reference i'm using this swift project as base for writing test cases.
So the issue was related to BridgingHeader.h file setting in
test target -> build Setting -> Swift compiler -Code generation -> Objective-C bridging Header
I copied the file from demo project, but did not specify it in the above setting. Once specified there, the compilation errors was gone.
Try importing EarlGrey using #import <EarlGrey/EarlGrey.h> instead of #import EarlGrey;

Foundation framework. No NSString.h file

I'm getting a few errors just after I updated my working copy via SVN.
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSCharacterSet.h:8:0 /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSCharacterSet.h:8:32: error: Foundation/NSString.h: No such file or directory
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSCharacterSet.h:45:0 /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSCharacterSet.h:45: error: expected ')' before 'unichar'
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSPathUtilities.h:10:0 /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSPathUtilities.h:10: error: cannot find interface declaration for 'NSString'
All that errors tell that compiler is unable to find NSString.h file in Foundation framework and I have opened the Foundation framework in Xcode/Frameworks/Foundation.framework/Headers and noticed that there is no NSString header file there. Could anyone tell me what happened? I tried to delete the framework and add it again but it failed to. Still I don't have NSString header file.
try installing XCode again. Older SDK versions are no longer supported. Choose SDK 4.2 instead and compile it again. (I have copied the SDK 4.0 for backward compatibility but it is not shown in targets and project settings)
I had this problem in a project started in XCode 3 and now compiled in XCode 4, where the line
-#include <Foundation/NSString.h>
was flagged as no such file. I fixed it by re-adding the framework - although it was already appearing in my project (from when I had added it in XCode 3) using this approach:
How to "add existing frameworks" in Xcode 4?
I noticed the list seen by using this method did not include the Foundation framework.