Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio: Error The filename, directory name, or volume label syntax is incorrect

I am using Windows 7 64bit and switched to the latest Android Studio and I am getting this error with:

Error:A problem occurred configuring project ':myproject'.
Could not normalize path for file 'C:\Users\me\Apps\Android\android\myproject\myproject:facebook-sdk\bolts-android-1.1.2.jar'.

Error The filename, directory name, or volume label syntax is incorrect

This occurred for versions
Android Studio: 1.0.1
Gradle: 2.2.1

like image 494
testsingh Avatar asked Jan 07 '15 22:01

testsingh


2 Answers

This issue will come if the syntax is mismatched. Please find below scenario,
I did one mistake in my build.gradle file

    compile files(':libs/lib_ivy_android')

and I modified later like below

    compile files(':libs/lib_ivy_android.jar')

then also I got same error I did some R&D about this then finally I modified like below then no error

    compile files('libs/lib_ivy_android.jar')

So this might be a solution for you.

like image 184
Murali Mohan Avatar answered Nov 05 '22 15:11

Murali Mohan


@ScottBarta and @KenWhite solved this in the comments (the : is invalid in a filename)

The problem is that the directory name is invalid, as @Scott indicated. Windows does not allow colons (:) in a filename, as that is the drive separator. C: is valid, myproject:facebook-sdk is not, as myproject: is not a valid drive letter.

Other invalid letters are

< (less than)
> (greater than)
: (colon)
" (double quote)
/ (forward slash)
\ (backslash)
| (vertical bar or pipe)
? (question mark)
* (asterisk)

As the OP said, just remove it:

removed it and now it started working for me.

like image 2
serv-inc Avatar answered Nov 05 '22 15:11

serv-inc