Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Build validation failed for sketch 'ABC': Illegal characters in path - Solution (Read 183 times)
TheOzMan
Newbies
*
Offline


Posts: 3
Joined: Jan 5th, 2025
Build validation failed for sketch 'ABC': Illegal characters in path - Solution
Jan 7th, 2025 at 8:43am
Print Post  
Hello All,

I'm posting this for anyone else that comes across this so they don't have to spend days trying to debug it.

The full error is:
Build validation failed for sketch 'ABC': Illegal characters in path. Ide=Arduino 1.6/1.8

If you get this when trying to just save a file in a project (any file), or trying to compile doesn't even really start and returns this error straight way, I have a possible cause for you.

For me, I had two double quotes around an include.
include "ir.h""    instead of    include "ir.h"

Yes it messed up code everywhere, but this was really time consuming to find. There are some old threads about looking at the Arduino IDE configured path, I looked at that, some registry keys, I looked at that, resetting the environment, recreating the project, generating debug files... I did a lot to try and find this.

So, if you get this error, check all your includes don't have an extra double quote as the error message doesn't help you find this at all.

Learn from my pain... Enjoy.
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2564
Joined: Feb 13th, 2019
Re: Build validation failed for sketch 'ABC': Illegal characters in path - Solution
Reply #1 - Jan 7th, 2025 at 9:30am
Print Post  
Thanks for the report and detail around this, we will look at adding further resiliency in this area and improved logging.

If you can attach a full build log for your project with the settings enabled as shown at the top of the page it will help us to further target the issue.
« Last Edit: Jan 7th, 2025 at 11:20am by Simon@Visual Micro »  
Back to top
IP Logged
 
TheOzMan
Newbies
*
Offline


Posts: 3
Joined: Jan 5th, 2025
Re: Build validation failed for sketch 'ABC': Illegal characters in path - Solution
Reply #2 - Jan 7th, 2025 at 9:43pm
Print Post  
Hello,

It's pretty easy to duplicate. Just add an addtional " to an include:
#include "ir.h""
and it'll break.

Nothing complains about the extra double quote.
Just an error saving, and an instance fail when trying to compile.
Included build info as requested.
Everything is default. I'm not using any specical compilier flags etc.


Example, build instance fail:
System.ArgumentException: Illegal characters in path.
   at System.IO.Path.CheckInvalidPathChars(String path, Boolean checkAdditional)
   at System.IO.Path.InternalCombine(String path1, String path2)
   at System.IO.FileSystemEnumerableIterator`1.GetFullSearchString(String fullPath, String searchPattern)
   at System.IO.FileSystemEnumerableIterator`1..ctor(String path, String originalUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler`1 resultHandler, Boolean checkHost)
   at System.IO.DirectoryInfo.InternalGetFiles(String searchPattern, SearchOption searchOption)
   at Visual.Micro.MiroAppAPI.SketchLibrary.ContainsHeader(String headerName)
   at Visual.Micro.MiroAppAPI.MCUTargetPlatform.getImportedLibsOfSketch(List`1 importedSketchHeaders, Boolean canCache, SketchLibraryListUnSorted local_library_lookup_list)
   at Visual.Micro.MiroAppAPI.MCUTargetPlatform.getImportedLibsOfSketch(List`1 importedSketchHeaders)
   at Visual.Micro.MiroAppAPI.SketchBuilder.preprocess(String buildPath, PdePreprocessor preprocessor, Boolean PreProcessOnly)
   at Visual.Micro.MiroAppAPI.SketchBuilder.preprocess(String buildPath, Boolean PreProcessOnly)
   at Visual.Micro.MiroAppAPI.SketchBuilder._build(String lbuildPath, Boolean verbose, Boolean PreProcessOnly)
   at Visual.Micro.MiroAppAPI.SketchBuilder._build(Boolean verbose)
   at Visual.Micro.MiroAppAPI.SketchBuilder.build(Boolean verbose)
   at Visual.Micro.Visual.Studio.Arduino.AddInApp._CompileDo(Object oProject, Boolean IsDebugStartCommand, Boolean isRebuild, Boolean UseGdbIfAvailable)
   at Visual.Micro.Visual.Studio.Arduino.AddInApp.CompileDo(Object oProject, Boolean IsDebugStartCommand, Boolean isRebuild, Boolean UseGdbIfAvailable)
   at Visual.Micro.Visual.Studio.Arduino.AddInApp.OnBeforeCommandEvent(String sGuid, Int32 ID, Object CustomIn, Object CustomOut, Boolean& CancelDefault)
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2564
Joined: Feb 13th, 2019
Re: Build validation failed for sketch 'ABC': Illegal characters in path - Solution
Reply #3 - Jan 8th, 2025 at 12:50pm
Print Post  
Thanks for the detail and the log file, we can now reproduce the error with the Serial Debugger enabled.

We will improve the message to show the included file which causes the error to be thrown, and will update this thread when the version is available for download.
  
Back to top
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2564
Joined: Feb 13th, 2019
Re: Build validation failed for sketch 'ABC': Illegal characters in path - Solution
Reply #4 - Jan 20th, 2025 at 6:06pm
Print Post  
We have improved the error message to show the #include which is at fault when this error occurs in the latest version (25.0120.0), which can be installed from the top of the below board:
https://www.visualmicro.com/forums/YaBB.pl?board=VS_ARDUINO_EXT_RELEASES
  
Back to top
IP Logged
 
TheOzMan
Newbies
*
Offline


Posts: 3
Joined: Jan 5th, 2025
Re: Build validation failed for sketch 'ABC': Illegal characters in path - Solution
Reply #5 - Jan 20th, 2025 at 10:44pm
Print Post  
Smiley

Thanks.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint