SolvedPerfect Swift compiler error

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

After I enter the following in Terminal:
git clone
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/ -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?

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!


  1. install DEVELOPMENT-SNAPSHOT-2016-06-20-a(the lastest),You could download in,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;

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:

Perfect Swift compiler error
most of people follow the tutorial : clone PerfectTemplate and swift build Hello Perfect team I trie...
vapor Vapor 3 async changes before alpha
disclaimer 1: I am ReactiveCocoa core member and being doing FRP since 2013 disclaimer 2: Being RxSw...
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 ...
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...
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 ...
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...
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 ...
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...
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...
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雪天的雪...
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...
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...
Alamofire “Use Legacy Swift Language Version” with pod 'Alamofire', '~> 4.0'
Have you tried this? I have to convert my project from X...
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...
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...
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...
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...
CocoaPods Intermittent CDN issues
The workaround to get working locally during this outage or CDN issue - guessing a DNS change or som...
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...
CocoaPods new Macbook M1 crash
As a temporary fix I've installed cocoapods using sudo arch -arch x86_64 gem install cocoapods then ...
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. ...
CocoaPods pod update error with CDN
And? How to fix? gem install concurrent-ruby or gem update concurrent-ruby. I've read and understood...
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...
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 ...
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...
capacitor iOS xcode Project - No such module found ‘Capacitor’
@vi354258 make sure you are opening the Xcode Workspace (App.xcworkspace instead of App.xcodeproj) ...
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 ...
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...
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...
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...
Alamofire Extra argument 'method' in call
I'm getting the same issue with the same error message (Extra argument 'method' in call) with correc...
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...
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...
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...
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...
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 ...
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...
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) ...
CocoaPods CDN: trunk Repo update failed - 2 error(s):
pod repo list 查看源列表 pod repo remove trunk 移除trunk源 只有移除掉问题才解决!!! 2019.11.07更 怕有人不懂,特意写了一篇文章 具体操作看下这篇...
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. ...
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....
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 ...
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...
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...
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 ...
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...
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...
Cache Support for Xcode 10.2 beta
With @olcayertas comment I found that this post install script in my podfile did the trick: ...