JustADev
JustADev

Reputation: 258

sourceSets Android Studio

I have a project on Android Studio which includes sourceSet in its gradle file, on Windows the project is working without issues, I pulled the code from our Git server to Mac OS X 10.10 and problems appear, the module "app" is read as files instead of project it will only work if I remove the "sourceSets" from build.gradle, but if I remove it my layouts will cause issues since my layout folder does have sub folders.

I'm using the latest Android Studio on both Windows and Mac (Android Studio v1.4 RC 1 and Gradle 1.3.0)

Please advise.

My build.gradle is:

apply plugin: 'com.android.application'

android {
compileSdkVersion 22
buildToolsVersion '23.0.1'
defaultConfig {
    applicationId "x.y"
    minSdkVersion 15
    targetSdkVersion 18
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}

sourceSets {
    main {
        manifest.srcFile '/src/main/AndroidManifest.xml'
        java.srcDirs = ['/src/main/java', '.apt_generated']
        aidl.srcDirs = ['/src/main/aidl', '.apt_generated']
        assets.srcDirs = ['/src/main/assets']
        res.srcDirs =
                [
                        '/src/main/res',
                        '/src/main/res/layout',
                        '/src/main/res/layout/cards',
                        '/src/main/res/layout/intro',
                        '/src/main/res/layout/customviews',
                        '/src/main/res/layout/droppy'
                ]
    }
}

packagingOptions {
    exclude 'META-INF/DEPENDENCIES.txt'
    exclude 'META-INF/LICENSE.txt'
    exclude 'META-INF/NOTICE.txt'
    exclude 'META-INF/NOTICE'
    exclude 'META-INF/LICENSE'
    exclude 'META-INF/DEPENDENCIES'
    exclude 'META-INF/notice.txt'
    exclude 'META-INF/license.txt'
    exclude 'META-INF/dependencies.txt'
    exclude 'META-INF/LGPL2.1'
}
productFlavors {
}
}


dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.0'
compile 'com.alibaba:fastjson:1.2.6'
compile 'com.marvinlabs:android-floatinglabel-widgets:1.6.1@aar'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.google.android.gms:play-services-gcm:7.+'
compile 'com.parse.bolts:bolts-android:1.2.0'
compile 'com.github.PhilJay:MPAndroidChart:v2.1.0'
compile 'com.prolificinteractive:material-calendarview:0.4.0'
compile 'com.android.support:cardview-v7:23.0.1'
compile 'com.github.PhilJay:MPAndroidChart:v2.1.0'
compile 'com.google.android.gms:play-services-maps:7.+'
compile 'uk.me.lewisdeane.ldialogs:ldialogs@aar'
compile 'com.squareup.okhttp:okhttp:2.4.0'
compile 'co.uk.rushorm:rushandroid:1.1.7'
// Check https://github.com/panwrona/DownloadProgressBar

//compile 'com.github.panwrona:DownloadProgressBar:1.1'

// Check https://github.com/TakeoffAndroid/MaterialDialogBottomSheet
compile project(':supertoasts')
compile project(':library')
compile project(':Droppy')
compile project(':tutorial_view')
compile project(':appintrolib')
compile project(':Slidr')
compile project(':circularprogressbutton')
compile project(':android_week_view')
compile 'com.google.guava:guava:19.0-rc1'

}

Upvotes: 4

Views: 4565

Answers (1)

Oleksandr
Oleksandr

Reputation: 6356

Try to add ../app before your paths, for example:

'/src/main/res' -> '../app/src/main/res'

Upvotes: 8

Related Questions