Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unexpected char '\' build.gradle

I had recently imported my Eclipse project into Studio. I exported it via gradle export from Eclipse. After importing I am getting this error.

Error:(16, 0) Cause: startup failed:
build file 'D:\Android\Projects\MainDIr\Project\build.gradle': 16: unexpected char: '\' @ line 16, column 34.
               java.srcDirs = ['libs\ormlite-android','libs\ormlite-core','src']
                                    ^

1 error

4 lines in my build.gradle is marked as red. These are referencing to libs folder libraries path. All my libraries are being imported successfully.

main {
            manifest.srcFile 'AndroidManifest.xml'
            java.srcDirs = ['libs\ormlite-android','libs\ormlite-core','src']
            resources.srcDirs = ['libs\ormlite-android','libs\ormlite-core','src']
            aidl.srcDirs = ['libs\ormlite-android','libs\ormlite-core','src']
            renderscript.srcDirs = ['libs\ormlite-android','libs\ormlite-core','src']
            res.srcDirs = ['res']
            assets.srcDirs = ['assets']
        }
like image 645
Googler Avatar asked Jan 02 '17 09:01

Googler


1 Answers

unexpected char '\'

Add / instead of \ . Then Clean-Rebuild and RUN .

Example

 aidl.srcDirs =  ['libs/ormlite-android','libs/ormlite-core','src']
like image 198
IntelliJ Amiya Avatar answered Sep 18 '22 00:09

IntelliJ Amiya