SolvedPerfect Swift compiler error

Hello Perfect team,
I tried following the README Quick Start instructions.

After I enter the following in Terminal:
git clone https://github.com/PerfectlySoft/PerfectTemplate.git
cd PerfectTemplate
swift build

I get:
/Users/matthewtso/git/PerfectTemplate/Packages/PerfectThread-0.10.0/Sources/ThreadQueue.swift:210:97: error: cannot convert value of type 'UnsafeMutablePointer<Void>' (aka 'UnsafeMutablePointer<()>') to expected argument type 'UnsafeMutablePointer<_>'

/Users/matthewtso/git/PerfectTemplate/Packages/PerfectThread-0.10.0/Sources/ThreadQueue.swift:233:37: error: value of type 'Unmanaged<IsThisRequired>' has no member 'toOpaque'

error: exit(1): /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-build-tool -f /Users/matthewtso/git/PerfectTemplate/.build/debug.yaml

Checking my Swift version returns the following:
Apple Swift version 3.0 (swiftlang-800.0.30 clang-800.0.24)
Target: x86_64-apple-macosx10.9

I'm pretty new and not sure how to diagnose this, is there something I can try to fix this?
Thanks!

28 Answers

✔️Accepted Answer

most of people follow the tutorial :

  1. clone PerfectTemplate and swift build , It works!
  2. Enter swift package generate-xcodeproj in terminal and Open the generated file "PerfectTemplate.xcodeproj" by Xcode IDE ,Ensure that you have selected the executable target and selected it to run on "My Mac" ,It failed!

Solved:

  1. install DEVELOPMENT-SNAPSHOT-2016-06-20-a(the lastest),You could download in swift.org,or install swiftenv firstly,then enter swiftenv install DEVELOPMENT-SNAPSHOT-2016-06-20-a
  2. if you use swiftenv ,then enter swiftenv local DEVELOPMENT-SNAPSHOT-2016-06-20-a in terminal. otherwise just skip;
  3. Xcode -> Preference -> Components->DEVELOPMENT-SNAPSHOT-2016-06-20-a(Not Xcode 8.0);
    Or Xcode -> Toolchains -> DEVELOPMENT-SNAPSHOT-2016-06-20-a;
  4. Xcode -> Location -> Command Line Tools -> Xode8
  5. clean and build;

Note:
Apple official document point out:
Selecting a Swift toolchain affects the Xcode IDE only. To use the Swift toolchain with command-line tools, use xcrun --toolchain swift and xcodebuild -toolchain swift, or add the Swift toolchain to your path as follows:

$ export PATH=/Library/Developer/Toolchains/swift-latest.xctoolchain/usr/bin:"${PATH}"

Hope this could help you

Related Issues:

3
Perfect Swift compiler error
most of people follow the tutorial : clone PerfectTemplate and swift build Hello Perfect team I trie...
22
vapor Vapor 3 async changes before alpha
disclaimer 1: I am ReactiveCocoa core member and being doing FRP since 2013 disclaimer 2: Being RxSw...
765
655
CocoaPods [error report] pod install /w m1 macbook
do you have a MacBook Pro with a M1 processor? this fixed my issue: Report What did you do? Run pod ...
479
Carthage Carthage builds fail at xcrun lipo on Xcode 12 beta (3,4,5...)
Workaround that works with both Xcode 11 and 12 Works with all versions of Xcode 12 (except beta 1 a...
392
CocoaPods NoMethodError - undefined method `size' for nil:NilClass
Also faced with this issue Fixed by updating flutter and cocoa pods to the latest version and then ...
247
CocoaPods pod install has bug
Did you try: sudo arch -x86_64 gem install ffi And run: arch -x86_64 pod install instead of pod inst...
186
CocoaPods CocoaPods was not able to update the master repo
Looks like your specs repo was edited at some point and now git can't update it ...
182
CocoaPods CocoaPods compatibility with Apple DTK (Apple Silicon)
For anyone else struggling with this issue I just found a way to solve it In addition to running ter...
175
CocoaPods Build issue with Xcode 12.3 - file not found #include "ruby/config.h"
I just updated to Xcode 12.3 and I am hitting this issue Seems like Xcode 12.3 broke the system ruby...
169
CocoaPods Unzip fail when zip contains chinese char on macOS 10.13
Maybe replace unzip with ditto: I have a SDK and there is a folder named FaceDistortion_20171205雪天的雪...
163
CocoaPods None of your spec sources contain a spec satisfying the dependencies
Did you note this part of the error message: Note: as of CocoaPods 1.0 pod repo update does not happ...
145
CocoaPods pod install fails with json error on Mac OS X 10.15
I did rm -rf ~/.cocoapods/repos/trunk/ After that it worked again. I've read and understood the CONT...
140
Alamofire “Use Legacy Swift Language Version” with pod 'Alamofire', '~> 4.0'
Have you tried this? http://stackoverflow.com/a/38466703/1054550 I have to convert my project from X...
135
realm swift Realm/RLMArray.h file not found and Could not build Objective-C module 'Realm'
So I am a little ashamed that I didn't try this earlier but it appears that if I run Clean Build Fol...
126
capacitor FileReader API not firing
You can try this. Description of the problem: In my project I'm trying to read and convert a Blob do...
124
CocoaPods No such file or directory @ rb_sysopen -- AppCenter -- ReactNative
So I updated my appcenter dependencies from v2.4.0 to v2.5.0 and I'm having this issue again 🙄 Edit...
122
CocoaPods App Icons not included in build from Xcode 9
I have the same problem Report What did you do? Run project on device from Xcode 9 Beta 6 What did y...
113
CocoaPods Intermittent CDN issues
The workaround to get working locally during this outage or CDN issue - guessing a DNS change or som...
95
RxSwift What is the correct way to handle errors?
I got an answer from the conversation with @kzaher on Slack Hi I'm almost new to Rx and trying to un...
89
CocoaPods new Macbook M1 crash
As a temporary fix I've installed cocoapods using sudo arch -arch x86_64 gem install cocoapods then ...
83
CocoaPods Support multiple Swift versions on a per pod basis
this works: It's not pretty but will do until they update your pods to Swift 4. ...
80
CocoaPods pod update error with CDN
And? How to fix? gem install concurrent-ruby or gem update concurrent-ruby. I've read and understood...
79
toggldesktop Linux: Ubuntu 16.04 installs GStreamer 1.0 series, not 0.10 series, by default
And a quick workaround tested on my machine with Ubuntu 16.10: In Ubuntu 16.04 (xenial) the core des...
72
apollo tooling 2.12.3: Error: Cannot use GraphQLSchema "[object GraphQLSchema]" from another module or realm
If you are using npm: Copy the version of graphql from your node_modules/apollo/package.json For me ...
71
CocoaPods Failed to build gem native extension. Header file missing,
I had the same problem on macOS Mojave 10.14.16 A few threads eventually lead me here which solved i...
70
capacitor iOS xcode Project - No such module found ‘Capacitor’
@vi354258 make sure you are opening the Xcode Workspace (App.xcworkspace instead of App.xcodeproj) ...
66
CocoaLumberjack Xcode 9 beta 3 breaks the new os_log logger
Getting the following errors DDOSLogger.m: DDOSLogger.m:58:17: Static_assert failed format argument ...
65
Alamofire iOS 13.3.1 dyld: Library not loaded
Are you using a non-developer Apple ID to install the app to your phone? It looks like iOS 13.3.1 ha...
54
CocoaPods I can not install pod files.
Nope Just do: Install ffi sudo arch -x86_64 gem install ffi Re-install dependencies arch -x86_64 pod...
52
CocoaPods CocoaPods1.9.0 cannot install on Mojave10.14.6
This should be re-opened I can repro on a clean Mojave The workaround is to run sudo gem install coc...
51
Alamofire Extra argument 'method' in call
I'm getting the same issue with the same error message (Extra argument 'method' in call) with correc...
46
CocoaPods [Xcode 8 beta 2]: CopySwiftLibs for Pods framework fails with Mach-O header error
I've found a workaround Add the following lines to your Podfile: 🌈 I've read and understood the *CO...
45
CocoaPods FBSDKLoginKit can not find headers under 1.0.0
This appears to be some issue between CocoaPods and XCode I tried to reproduce the problem I was see...
43
Alamofire Sending GET with JSON in body gets Timeout error
I figured out my problem In my Router I had my GET requests using JSONEncoding: urlRequest = try JSO...
43
MessageKit Delete message by long press on cell ?
Okay so @JulienLevallois here is a working example Hi ! I want to delete message by long press gestu...
43
Moya Not able to get URLEncoding working correctly when there is "?" and the method is "POST"
try use this and url request will like this base_url/api/update-password?token=114149814189 ...
40
CocoaPods Podfile without use_frameworks! triggers "deployment target" warnings in Xcode 10
For those wanting a quick fix: edit: updated snippet now supports the new generate_multiple_pod_proj...
37
CocoaPods Resources installed using cocoapods not loaded for xctest bundle
For me I fixed it by setting Host Application to main target (In Test Target -> `General) ...
36
CocoaPods CDN: trunk Repo update failed - 2 error(s):
pod repo list 查看源列表 pod repo remove trunk 移除trunk源 只有移除掉问题才解决!!! 2019.11.07更 怕有人不懂,特意写了一篇文章 具体操作看下这篇...
36
CocoaPods [1.9.2] Error during pod install JSON::ParserError - 767: unexpected token
Running only sudo rm -rf ~/.cocoapods/repos and then pod install was enough for my case. ...
35
Alamofire Alamofire 4.3.0 setting timeout throws NSURLErrorDomain error
Hello I solved the problem with: I pupdated my question in StackOverflow I am using the version 4.3....
35
CocoaPods pod lib create fails: uninitialized constant Nanaimo::Reader::StringScanner (NameError)
gem uninstall nanaimo It will prompt you for which version to uninstall 👍 Before you start ...
35
CocoaPods pod install triggers pods to use Swift 4.2 in XCode 10
I was also facing the same problem and able to fix by adding swift_version in pre_install block Is t...
34
PromiseKit Problem with Archive with Xcode Version 7.3.1 (7D1014)
If you're using Cocoapods and not using anything in the subspec PromiseKit/Foundation a less hacky s...
33
apollo tooling Why does codegen:generate require query names to be unique?
This is now a closed issue so I'm not sure it is worth to comment it again It makes no sense ...
32
CocoaPods pod spec lint fails (Xcode 8 GM & Cocoapods 1.1.0.rc.1)
Got it working using the .swift-version file mentioned in #5841 For those who need help make a .swif...
32
CocoaPods undefined method `map' for nil:NilClass (NoMethodError) Did you mean? tap
ah gem update xcodeproj fixes the problem for me I've read and understood the CONTRIBUTING guideline...
32
Cache Support for Xcode 10.2 beta
With @olcayertas comment I found that this post install script in my podfile did the trick: ...