Gradle dollar sign error

Sorry for my English.

I am trying to create a new project in Android Studio with Gradle support, but I cannot build my project correctly. 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 the name of the computer on the network.

I see that Gradle does not understand the literal dollar sign $ in the following expression: "/ LOGGER-2 / c $ / Program Files / ...". How can i solve the problem?

+6
source share
1 answer

$ in a two-cylinder string literal has special meaning in Groovy - it is used to interpolate String. If you need the $ literal, use either a single-quoted string literal (for example, 'foo$bar' ), or exit $ with \ (for example, "foo\$bar" ).

+9
source

All Articles