Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gradle error with a dollar sign

Sorry for my english.

I'm trying to create a new project in the Android Studio with Gradle support, but I can't correctly build my project. There is a code:

Gradle 'SportManager' project refresh failed:
     Cause: startup failed:
     initialization script 'C:\Users\ponomarev\AppData\Local\Temp\ijinit6732759991667918700.gradle': 33: illegal string body character after dollar sign;
     solution: either escape a literal dollar sign "\$5" or bracket the value expression "${5}" @ line 33, column 20.
     String[] paths = ["/LOGGER-2/c$/Program Files/android-studio/plugins/gradle/lib/gradle-tooling-extension.jar","/LOGGER-2/c$/Program Files/android-studio/plugins/gradle/lib/gradle-tooling-extension-v1.9.jar","/LOGGER-2/c$/Program Files/android-studio/plugins/gradle/lib/gradle-tooling-extension-v1.11.jar","/LOGGER-2/c$/Program Files/android-studio/plugins/gradle/lib/gradle-tooling-extension-v1.12.jar"]
     ^
     1 error

'LOGGER-2' is computer's name in the network.

I see that Gradle don't understand literal dollar sign $ in the following expression: "/LOGGER-2/c$/Program Files/...". How I can fix it issue?

like image 724
Andrew Avatar asked Apr 14 '14 13:04

Andrew


1 Answers

$ in a double-quoted String literal has a special meaning in Groovy - it's used for String interpolation. If you want a literal $, either use a single-quoted String literal (e.g. 'foo$bar'), or escape the $ with \ (e.g. "foo\$bar").

like image 185
Peter Niederwieser Avatar answered Oct 17 '22 04:10

Peter Niederwieser