3 days ago I sent a letter in support, but the answer was never received. I have such a problem. There are several partial sass files that are imported into the main file. In 3 files, the option "Imported file" is in the options, and the main file is automatically compiled when changing in one of the imported files. In the options of a single file, I clicked the "Compile aniway" checkbox and the settings for the usual sass file were opened. But at the same time, the automatic compilation of the main file ceased to work when this partial file was modified. If I make changes, where the options are "Imported files", the autocompilation of the main file works successfully. I would like to clarify how I can return the "Imported file" option for the file that is not being tracked now by FileWatcher? Thank you.
I was having the same problem. I noticed that prepros is case sensitive to detect imported files, although it's case insensitive for compilation. So in main file, if a partial file is imported with incorrect case (in my case first letter was in capital instead of lower case), the file will compile, but partial file is not detected as imported.
For me, this happened when my import statements did not include the underscore. This would not trigger a recompile :
#import "./scss/variables";
should be :
#import "./scss/_variables";
Related
I have a stand alone SPM (local) in my project. When ever I add any new files to this package Xcode does not show the prompt to specify the name. Usually when adding files in a project it requests the location which allows to specify a name. But when adding in a SPM it straight away creates a file with File.swift always.
I don't mind renaming but its just that the header is also having a generic File.swift
//
// File.swift
//
//
// Created by McDuck, Scrooge on 02/06/89.
//
Any work arounds ?
I have tried on Xcode 13.4 as well
#user5381191 I had the same problem. I did some searching and found this answer.
The file you want to edit is located in:
/Applications/Xcode.app/Contents/Developer/Library/Xcode/Templates/File Templates/Source/Package Swift File.xctemplate. Edit the TemplateInfo.plist.
As a test I just copied the TemplateInfo.plist file from the Multiplatform/Source/Swift File.xctemplate and it worked. EDIT: For some reason it worked, and then stopped working?
Copy the suggested plist text from the link above into your template file and it works!
Once I did that, I get a new file type "Package Swift File" in the New File dialog.
Instead of the standard file dialog, it gives a dialog for entering the file name. Better than before!
Make sure to save your old template file before making your changes, just in case you need to revert.
It doesn't insert the package name in the header. That might be a nice thing to try and get working, but I'm happy with this for now.
Actually it works as promised (according to Apple guidelines).
In this scenario (as shown on demo) a menu command without ellipsis (...), so no dialog expected.
Once file created Xcode enters edit-name mode, so we can specify a file name which we need.
The file hat is different question and can be edited in templates if needed, or not. Usually depends on project and might even not include file name at all, but for default template - yes we need to change it to align.
Tested with Xcode 13.4
I'm trying to make a plugin that writes something to the .h file with a key command while you're coding in the .m file.
But if I've just made a change in the .h file and go to my .m file and use my plugin directly after, I get an error popup saying that Xcode has changes that is not on the disk yet, and then asks which version I want to use.
If I'm only coding in the .m file and adding the methods and properties to the .h file with my plugin it works fine, it's only when I've just made some changes myself to the .h file and go back to the .m file and use my plugin that I get an error.
So my question is, is it possible to force Xcode to save your code, so you're sure it matches up before you make any changes to what is already on the hard disk?
I just hit a brick wall with xCode not wanting to parse my Info.plist file. I've replaced the file several times with older (identical) versions of the file that I had previously backed up, and I'm still getting the same error.
Here is the complete error message:
couldn't parse contents of '/Users/...Info.plist': The data couldn’t be read because it isn’t in the correct format.
I'm clueless on this one. I'm using xCode 5.0.1, Mavericks
This is one of the best way to detect on which line the error is occurring.
Just go the directory where the plist file is present then write this command on terminal->
plutil filename.plist
Another cause of this issue can be from attempting to put URLs (really just slashes etc.) in your app-Info.plist.
Get around it by simply raising the -traditional flag inside of the Info.plist Other Preprocessor Flags option in your project build settings.
I think you have used source-control tools, you can use basic text-edit tool without Xcode to open this plist, command + F to find "<<<<<" or ">>>>>", then you will probably find error string such as:
<<<<<<< .mine
>>>>>>> .r605
select the correct string, and delete the other one, error is resolve!
Looks like replacing the file with a backup, then deleting the derived data for the project in Organizer was the cure. Hope this helps someone else later on.
I personally ruined the file when git merge raised conflicts. .plist is an XML file and git conflict added <<<< and >>>> in there to tag the differences.
Find the .plist file in Finder (in one of your project's folders). Open it in a text editor, find the lines that don't look like proper XML, remove them and be sure to remove the duplicate XML line/node (due to pre and post git recorded changes).
This may also simply happen because you have moved the Info.plist file into a new folder, or removed it from a folder (basically, if its path changed).
Go to Build Settings and search for "Info.plist file". Edit the value. For instance, if you have moved your plist file from the main folder to a subfolder called Resources, you will have to do the following change:
Before:
TargetName/Info.plist
After:
TargetName/Resources/Info.plist
When building for iOS, the Info.plist may be corrupted whenever Default Orientation is set to Auto Rotation. The Info.plist file is created properly on the first build, but subsequent builds results in...
<key>UIInterfaceOrientation</key>
<string></string>
</string>
... at this point Xcode fails to build the project.
I was having the same error, and realized the issue was that I had a URL (e.g. http://example.com/something) as a value in my Info.plist, and I just switched on pre-processing for it (without the -traditional flag). Apparently Xcode will treat the // as a comment marker, and omit the rest of the line.
A work-around I found is to embrace the pre-processor, like so:
http:/${}/example.com/something, which breaks up the // by putting an empty string substation in the middle so it doesn't look like a comment to Xcode, but after pre-processing it's back to a normal URL.
This error comes whenever Xcode preprocessor is not able to parse the info.plist file.
So to find out the error in the specific line do the following steps :
Open your project.xcworkspace in Xcode
Go to the project's navigator
Inside your project click on the info file, if an error exists then it will popup the dialog with the line number where the error exists
You can see the below image of the popup dialog for reference, which is in my case was showing the error on line 35
Hope this will help you or somebody else. Thanks!
Happy Coding :-)
So I've written code in OpenCV which contains 2 header files using Code::Blocks. When I compile the files, there are no errors except two "undefined reference..." errors which occur because I have used functions that I have declared in the header files. I assumed that code blocks automatically linked the header files? I have used the "#include.." to include the header files at the top of the programs so not sure what the problem could be. Anyone have any idea? Thanks.
I was having a similar problem, but happened upon a solution
Click the "Project" tab, it's in the top right side.
Within the "Project" tab click the "Add Files..." option.
Highlight your Header file and any other files associated with your header file, like if you put your header files definitions in a .cpp file.
Compile and Run.
Hopefully this helps, it worked for me but our issues could be different.
I'm writing an app for the iOS in XCode 4 and stumbled upon an issue with #import statement.
All my source files are organized in folders, every folder is mapped to the group or subgroup in XCode. Consider the following:
ProjectFolder
-SubFolderA
--FileA.h
-SubFolderB
--FileB.m
Usually, if I want to import FileA into FileB, I write #import "FileA.h", and it works perfectly. But sometimes I have to write relative path, like #import "../SubFolderA/FileA.h" . What should I do to be always able to write only name of the file?
This behavior seems undetermined to me.
PS: I don't want to keep all this mess in one root folder.
PS#2: Yes, I know how the 'folder' differs from 'group'. I've created folders on the early stage of the project, dragged them from Finder to XCode and mapped them to groups. And everything worked just fine - I was able to import headers using only filenames.
Search "Scan All Source Files for Includes" in your project's and target's build settings and change the value from "NO" to "Yes". It will solve this issue.
You can always set the "Header Search Paths" under build options to specify which directories to search in. Don't confuse folders and groups though. They are completely independent. In particular groups are simply a convenience that allow you to organize your files within Xcode.
XCode is very much like iTunes in some respects, it wants to manage your files and hide them from you. When you create a group in XCode it's appearance is that of a 'folder' but if you go into the actual project folder you'll still see files everywhere.