Sometimes when I reopen an existing Swift UI project in Xcode 12, the component preview pane fails to display previews of components and displays the following error message instead:
NoBuildableEntriesError: active scheme does not build this file
Select a scheme that builds a target which contains the current file,
or add this file to a target that is built by the current scheme.
How can I resolve this and prevent it from happening again?
In particular, how can I:
"select a scheme that builds a target which contains the current file", and/or
"add this file to a target that is built by the current scheme."
Below is the Scheme it is at the very top of Xcode you can click it to change it.
And the membership is in the file inspector. Just click the Target you want.
My CustomPicker.swift files does NOT belong to StackOverflow14-Multi (macOS)
Related
Ever since I upgraded to Xcode 12, I cannot add custom plist files that I drag into Xcode to product targets. This is for a macOS command line terminal application. When I click on the plist file in the navigator and view it in the file inspector, the product is unchecked in the target membership window and I cannot check it (won't allow me); the product, however, is not greyed out. For command line terminal applications, is there an alternate way around this?
You cannot check and uncheck the checkbox in the Target Membership in the File inspector, because this is not a bundle — it's a command-line tool, not an application. But you can include a resource manually in the Copy Files build phase, though of course in that case you must specify where it is to be copied to at install time.
My Mac app has two Targets. When I attempt to Archive the second Target, Xcode always uses the configuration info for the first Target (Bundle ID, Version, and Build) even though I have selected the second Target.
By configuration I mean the "General" options displayed when clicking on the project name in the Project Navigator.
I was using the wrong scheme (whatever that is). To set the right scheme, use the Scheme menu (just to the right of the square Stop button on Xcode's menu bar).
So, the question describes itself.
I want to edit the log after each build to cut out swift 3 ugly warnings like Result of call to '...' is unused
In Xcode > Preferences > Locations you can define (or automatically accept the default path ~/Library/Developer/Xcode/DerivedData/) the location of the 'DerivedData' folder which is where the build logs are stored.
Go there and tap the -> arrow to see the folder organization. Apple introduces unique folder name extensions which would have to be determined and built into any script that would analyze or process the log.
You could always go to your target settings and set the "Inhibit All Warnings" checkbox to ON.
As for editing the transcript directly, I suspect this is something you can't easily do, as build transcripts can be exported (hold down the control key while clicking on a build log in the Report Navigator in the left side of the Xcode project window) and I think they must be stored in some Apple System Log-like binary format.
Setting up an Xcode project for testing with Calabash. How can I remove the -cal target completely. There is already a -cal target in the repository that is quite old. I would like to set up fresh but it seems to create another -cal target when I run setup. Any thoughts? Xcode 6.
The -cal schemes appear in 2 separate locations in Xcode. The first location is to the right of the build button. Click on the -cal scheme then go to Manage schemes and delete it from there. To get the second location, click on the Show Project Navigator and then choose the name of the -cal scheme you used in the left pane (there should also be one called Pods that is automatically generated). Then look under Targets in the Build Settings pane and you will be able to delete the second -cal scheme.
I'm using XCode and Appcode for developing.
In Appcode, accidentally I deleted the .app file from the Products folder.
After that I can build the project successfully in both IDE, but can't run on simulator or device, when the build finished, nothing happening.
The .app file created on the derived data directory fine, like earlier so that's not the problem.
If I check the debug scheme in XCode, on the Executable list None is chosen, if I browse the generated app in the derived data directory and set that, then works fine, run on simulator and device too, but the app file not shown in the Products folder and after a restart, XCode set the Executables back to None, which is annoying.
How can I set back the .app file to show in the Products directory in XCode and work like earlier?
I was able to delete the "product" file in my own test project by going to the Project Settings and then clicking on the app under "Targets" and touching the "Delete" key.
To create a new Target, go back to Project Settings and click the "Add Target" button.
Normally, this means you need to reset all of your settings, but if you have the original target's Info.plist (settings) file around, you may be able to pick up some of your previous target's settings from there.
I also faced the same issue.
If we are building for the SIMULATOR - then the Target file still "not-included". Change from the top build actions for - ProjectName>iOS Device (instead of the ios Simulator) then the project target file gets generated and is included in the project folder hierarchy.
There is no need to run - just rebuild and that should do the trick