There are two types of build errors that happen; they are yellow warnings and red alerts. You'll see the warnings and alerts in the left-hand column of the Xcode window.
Yellow warnings do not cause the build to fail, those are just warnings. Occasionally, a Loop version may have some minor discrepancies that cause a yellow alert...ignore those. Do not try to do anything to fix those...leave them alone.
Red error alerts will have to be resolved before you can successfully build the Loop app. The steps below explain how to resolve them based on the messages you are seeing.
Start with the obvious error causes⌁
Before you start trying to resolve your red errors...start with the most obvious things that can cause a red error message:
DO NOT USE BETA VERSIONS If you are using an iOS beta version or an Xcode beta version, your Loop will not build. If you have Xcode beta, uninstall it and get regular Xcode. If you have iOS beta on your iPhone, you will need to restore your iPhone entirely. You can restore to either (1) the last non-beta backup version you saved or (2) restore as a new iPhone (default settings). Yes, deleting iOS beta is a pain...so don't install it in the first place.
Did you check for Xcode updates? Cannot emphasize this one enough...you should check for Xcode updates (and install them) before building. Current version of Xcode is 11.3, make sure you have it!
Did you check your Apple developer account for new license agreement? Periodically, Apple will release a new developer license agreement that you need to sign before you can build new apps. You will get a build failure if there is a pending license agreement to sign. Login to your Apple developer account to check if there's a new license agreement.
Did you reboot your computer after updating Xcode? Yup...that was in the reminder on the page about updating your Loop app...did you ignore it? ;)
Did you get a fresh download of Loop code, don't just recycle an old download that you built with a long time ago? That old version may not be compatible with new iOS and new Xcode versions.
Are you are using a free developer account? Make sure you finished the removal of Siri and Push Notification capabilities.
Posting for help⌁
STOP!! Read this section! Important!
Before you post in Zulipchat or Looped Group asking for help with build errors, do your work first. The build errors listed below (and the obvious checks listed above) are very successful IF PEOPLE READ THIS PAGE. The volunteer group of people answering questions in Looped and Zulipchat would love to spend more time on improving Loop in other ways than answering build error questions that can be answered by using this page as a first step.
Therefore, first use the error topics (listed in sections below) to try to resolve your build error yourself. Then, if you need to post for help because this page did not fix your problem, you'll need to include information with the post so we (the troubleshooters) know you read this page and where you are in your troubleshooting attempts
Must include in your post
- The version of Xcode you are using
- The version of Loop you are building with
- The version of iOS on your Loop iPhone
- Specify if you are using a free or paid account, and if free...confirm you deleted Siri capabilities
- Confirm you are not using an Xcode beta or iOS beta version (so we don't have to ask, actually type "I am not using beta versions"...this will save a lot of time and hassle)
- Screenshots of your WHOLE Xcode window and/or Terminal window showing your error and any messages you've seen while working through the build errors/solutions.
- State which fixes from the below list that you have already tried AND post the screenshots of the results of those fix attempts.
Helpful tip: Shift-Command-4-spacebar will give you a screenshot tool that you can use to click on the Xcode window to grab a screenshot. The screenshot will save to your desktop so you can include it in your post. Phone photos of your computer screen won't likely be of sufficient clarity to read the needed information and often cuts off valuable information that we look for in the various parts of the Xcode window. Use the whole Xcode window's screenshot when posting for help.
Find your error message(s)⌁
To begin fixing the error, use the Report Navigator view to find your error message.
The key is to (1) READ THE ERROR MESSAGE and then (2) FIND YOUR MESSAGE IN ONE OF THE TOPICS BELOW.
Here's a super tip: Merely seeing the "exit code" in Xcode is not enough information to discern what error is causing your build to fail. Look at the detailed message to really help guide your search for the matching solution.
Notice how in the screenshots in the topics below, there are red circles highlighting certain error messages? Read your error messages similar to where those red circles are in the screenshots below. Once you find your error message (hint: not "exit code"), you can either:
Take the error message from your Xcode screen and use LoopDoc's search function to enter in some of that phrase to bring up the appropriate solution topic, or
Take the error message from your Xcode screen and read through EACH OF THE TOPICS BELOW. Check each of the red circles to see if you have a match. Kind of like a matching puzzle.
For example, if you see "Invalid active developer path (/Library/Developer/CommandLineTools)" in your error message, use the search tool in LoopDocs with simply "invalid active". You will get a couple of links and one is the Command Line Tools fix for that error message. Click on the link and you'll find your solution.
No such module 'LoopKit' or similar message⌁
If you see a Cartfile failure and several other red errors (in particular saying there is "no such module 'LoopKit'"), double click on the Cartfile error message. If it says that the build failed in one of the schemes, as shown in the screenshot below, then you need to open the Terminal app (remember it is located in your Applications folder under the Utilities group of applications). You will use the command
cd ~/downloads/loop-dev && carthage update. NOTE: YOU MAY HAVE TO CHANGE THE COMMAND SLIGHTLY. If your loop folder isn't named loop-dev and instead is loop-dev-2 or loop-master or some other folder name...change the command to match your folder's actual name.
Carthage update will take about 15-25 minutes to run successfully. A successful carthage update will look like the following:
Once carthage update has run successfully, you can return to Xcode and press the build button again. Your project should build successfully.
If your carthage update fails, try opening the Terminal app and running these commands to clear out your carthage cache and saved derived data in Xcode:
rm -rf ~/Library/Caches/org.carthage.CarthageKit and
rm -rf ~/Library/Developer/Xcode/DerivedData
After running those commands, retry the
cd ~/downloads/loop-master && carthage update (remembering to update the name of your Loop download folder, as needed).
Developer License Update⌁
Error message: "The Apple Developer Program License Agreement has been updated, In order to access certain membership resources, you must accept the latest license agreement."
Solution: You'll need to log onto your developer account at developer.apple.com and accept the latest license agreement.
Problems with Homebrew⌁
Error message: This one could be a variety of error messages, so there's not one in particular. You may see Command PhaseScriptExecution failed with a nonzero exit code, but that same message could apply to other sources of error. So look for more identifying information about the error code. If you see something about "unable to create /user/local/Homebrew/.git/index.lock: file exists" then you have a Homebrew problem, as shown in the red circle below.
Solution: You'll need to uninstall Homebrew and then resinstall. Two simple copy and paste commands in Terminal.
First you need to uninstal using this command in Terminal app:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
And then repeat the installation command from step 7 in the build process by using this command in Terminal app:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Now try building your Loop app again, you shouldn't have any problems.
Could not get a container directory URL⌁
Error message: "Could not get a container directory URL. Please ensure App Groups are set up correctly in entitlements."
To resolve this error, you will need to click on the Loop target's signing area and then the plus-sign in the App Groups area under the signing. Copy and paste the bundle indentifier into the new container that starts with
group. and then add
Group to the end of the name. Click OK to save.
The final App Group should now have a blue check box, the name should start with
group and end with
LoopGroup. See the screenshot as an example. Click the build button after your App Group is setup similarly and you should be good.
Missing Command Line Tools⌁
Error message: "Invalid active developer path (/Library/Developer/CommandLineTools)" or "unable to find utility "xcodebuild", not a developer tool or in PATH"
Solution: Go to your Xcode preferences and under the Locations tab, select "Xcode 11.3" in the dropdown menu for Command Line Tools.
Device Management could not launch Loop⌁
Error message: "Could not launch "Loop". Verify the Developer App certificate for your account is trusted on your device. Open Settings and navigate to General -> Device Management, then select your Developer App certificate to trust it."
Solution: If you get this message and are unable to find the Device Management option in your phone settings, then we need to do a little extra step to clear out some old info.
- Plug phone in and open Loop in Xcode
- Click the "Window" menu item in Xcode and then choose "Devices and Simulators"
- Right click your phone on the left and pick "Show Provisioning Profiles"
- Delete all of the items in the list that have Loop in the name
- Go to your four signing targets and change the signing team back to "None" for a quick bit, and then change back to your regular signing team name again.
- Rebuild Loop
That should clear out the old, unworking profiles and give you a successful build.
Pending Certificate Request⌁
Error message: "You already have a current iOS Development certificate or a pending certificate request."
Solution: This error message has just recently started to appear for some new Loop builders. To resolve the issue, please log in to your Developer account at developer.apple.com and then click on "Certificates, Identifiers & Profiles". Under that screen, you will see "Development" under the "Certificates" section in the column on the left. You will need to click on the certificates, and choose to "revoke" from the options that show after you click on the certificate. Confirm the warning message that will appear asking "Do you want to revoke the certificate?"
After you do that, return to Xcode and open up Xcode preferences. Under the Accounts section of Preferences, click on the minus sign to delete your Apple ID.
Re-enter your Apple ID (yes...add that account right back that you literally just deleted), return to your Loop's target signing areas in Xcode and your error message should have resolved itself now as a new certificate will have been issued and a provisioning profile should have been created automatically.
For double measure, you can verify that the iOS development certificates are all in good working order by clicking on your "Manage Certificates" in your Xcode Preferences, Accounts and viewing the iOS development Certificates. You should have one for your account that has a clean status similar to the screenshot below.
Command CodeSign failed⌁
Error message: "errSecInternalComponent, Command CodeSign failed with a nonzero exit code"
Solution: This error message is likely due to inadvertently saying "no" to allowing Keychain Access or changing your computer or AppleID password. Regardless, the solution is as follows:
- Close Xcode
- Open your Keychain Access application (found in Applications within the Utilities folder, similar to where Terminal app is found)
- In the upper left corner of keychain access, make sure you have the keychain
loginhighlighted and then right-click the lock next to the
login. Click the lock closed, and then click the lock to open it again. You will be prompted for a password. Enter your computer admin password. Close Keychain Access app.
- Open your Loop project again in Xcode.
- In the main Xcode menu (grey menu bar at the very top of your Apple display area), select the word
Productand then select the option for
Clean. (keyboard shortcut is shift-command-k)
- Now try rebuilding your Loop app. If you ever get prompted again to allow Xcode access to Keychain, make sure to Always Allow.
Unrecognized arguments: --cache-builds⌁
Error message: "Unrecognized arguments: --cache-builds"
Solution: Please open your Terminal app found in the Applications>>Utilities folder and then enter
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" Confirm installation by pressing enter, and then typing in your computer password. When the installation finishes, use the command
brew link --overwrite carthage. After those two steps, you can close out Terminal app, return to Xcode and press the build/play button again.
Abort with Payload⌁
Error message: "Abort with payload" Your app will only open briefly with a white screen and then close, if you build with this error.
Solution: This error message is caused by having Loop download folder in an iCloud mapped drive. Move your download folder back to the Downloads folder, then rebuild.
Apple Watch: Loop app not appearing⌁
Error: Apple watch app is not appearing.
Solution: Usually because you have not updated to watchOS prior to when you built Loop, or you didn't have your Apple watch paired at the time of building Loop. Don't forget to open the iPhone's Watch app, select My Watch tab on the bottom left, scroll all the way down, and click
Install for the Loop app listed at the very bottom under "available apps".
Apple Watch: Loop app not installing⌁
Error: The Loop app appears on the list of apps available to install on the watch, but when you press "install", and it goes through the animation of filling in the circle while it's installing, but then at the end it just toggles back to saying "INSTALL".
Solution: Plug your iPhone into the computer and start Xcode. On your watch, look for a prompt that says "Trust this computer". Scroll down on the watch face and select the "Trust" button.
Now we need to do one step before rebuilding Loop app again. Go to the top menu bar of Xcode and select "Clean Build Folder" from the Product menu option. Rebuild your Loop app.
For an unknown reason (developers are working on fixing it currently), if you do repeated builds in the same Loop project folder...the watch app can fail to install properly after the first build. Therefore, a simple "Clean Build Folder" will reset the folder back to new and you should be able to install the watch after that fresh build.
Sometimes, if the problem is really a bugger...you have to do a more painful troubleshooting. If you still can't get the Loop app to install on the watch after a "Clean Build Folder" attempt at rebuilding, we need to start at square one. Unpair your watch from the iPhone and setup as a brand new device. Yes, pain in the butt. But, usually wiping the watch, re-pairing fresh, and then building Loop again on the phone will fix the issue. Sorry, wish I had a shorter path to fixing that problem, but this is where the current state is.