0

To start things off, yes I know there are multiple other threads with the same title addressing the same error, however after 3 full work days, I haven't been able to fix this error.

Project Structure: BaseDir/ -build.gradle

+App/
   + LibProject1/
      -build.gradle
   -build.gradle
   -settings.gradle
   -(code/src/etc..)
+LibProject2/
  -build.gradle
+LibProject3/
  -build.gradle

BaseDir/build.gradle:

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
    jcenter()
}
dependencies {
    classpath 'com.android.tools.build:gradle:1.5.0'
}
}

allprojects {
repositories {
    jcenter()
}
}

Settings.gradle:

include: ":App:LibProject1"
include: ":LibProject2"
include: ":Libproject3"

App/build.gradle:

    buildscript {
repositories {
    jcenter()
}
dependencies {
    classpath 'com.android.tools.build:gradle:1.5.0'
}
     }

    allprojects {
        repositories {
            jcenter()
        }
    }

    apply plugin: 'com.android.application'

    dependencies {
        compile fileTree(dir: 'libs', include: '*.jar')
        compile project(":Copy:CordovaLib")
        compile project(':LogManagerAndroidProject')
        compile project(':XBDSInterfaces')
    }

android {
compileSdkVersion 19
buildToolsVersion "19.1.0"

defaultConfig {
    minSdkVersion 14
    targetSdkVersion 19
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        minifyEnabled false

    }
}

sourceSets {
    main {
        manifest.srcFile 'AndroidManifest.xml'
        java.srcDirs = ['src']
        resources.srcDirs = ['src']
        aidl.srcDirs = ['src']
        renderscript.srcDirs = ['src']
        res.srcDirs = ['res']
        assets.srcDirs = ['assets']
    }

    // Move the tests to tests/java, tests/res, etc...
    instrumentTest.setRoot('tests')

    // Move the build types to build-types/<type>
    // For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
    // This moves them out of them default location under src/<type>/... which would
    // conflict with src/ being used by the main source set.
    // Adding new build types or product flavors should be accompanied
    // by a similar customization.
    debug.setRoot('build-types/debug')
    release.setRoot('build-types/release')
}
}

Library1,2,3/build.gradle:

    buildscript {
repositories {
    jcenter()
}
dependencies {
    classpath 'com.android.tools.build:gradle:1.5.0'
}
}

apply plugin: 'com.android.library'

android{
compileSdkVersion 19
buildToolsVersion "19.1.0"

defaultConfig {
    minSdkVersion 14
    targetSdkVersion 19
}

sourceSets {
    main {
        manifest.srcFile 'AndroidManifest.xml'
        java.srcDirs = ['src']
        resources.srcDirs = ['src']
        aidl.srcDirs = ['src']
        renderscript.srcDirs = ['src']
        res.srcDirs = ['res']
        assets.srcDirs = ['assets']
    }
}

}

*forgive the weird format in posting, I haven't gotten the hang of properly posting code blocks.

The error I'm getting is happening in all of my libraries. I've reorganized which libraries get compiled first in the app/build.gradle file, and it never passes the first compile project line. Which ever libproject is first to get compiled, throws the Cannot evaluate module : defualt not found error.

All the other threads have told me to:

1) Make sure your library folder has a build.gradle file

2) Have a defaultConfig in your build.gradle file

3) Make sure your include statements are correct in your settings.gradle file

and more of the same.

I've made sure all my gradle files are correct, checked spellng, etc.. Not sure what to make of this, the error is the most un-verbose notification I've come across in a while, any help would be majorly appreciated!!

Ryan Stush
  • 15
  • 1
  • 8
  • In which module you have this issue? – Gabriele Mariotti Mar 03 '16 at 16:04
  • It's happening in which ever library is first to get compiled in my app/build.gradle file. I've added that info to the question, thanks for pointing that out. – Ryan Stush Mar 03 '16 at 16:09
  • But the app/build.gradla seems to be the root level file in your case – Gabriele Mariotti Mar 03 '16 at 16:13
  • This is a single app in a multiproject build, I'm just trying to get this app to build individually. There are 6 more apps within a containing project that I need to break off and have individual builds for. – Ryan Stush Mar 03 '16 at 16:21
  • I think that it is the issue. In a project you have always a build.gradle in the root folder. Then any module has the own build.gradle – Gabriele Mariotti Mar 03 '16 at 16:25
  • Agreed, however, I have that build.gradle in the root dir. I've updated the question with the root build.gradle – Ryan Stush Mar 03 '16 at 16:30
  • Check the Settings.gradle in the root folder (not inside app folder) – Gabriele Mariotti Mar 03 '16 at 16:33
  • It's the same as the one posted, albeit more projects and their dependencies. Am I referencing these libraries properly? in the posted settings.gradle? Do double vs. single quotes matter? – Ryan Stush Mar 03 '16 at 16:37
  • It can't be the same in my opinion, since the folder hierarchy can't be the same. Please write all the folder structure since BaseDir – Gabriele Mariotti Mar 03 '16 at 16:40
  • @GabrieleMariotti I found your answer here: http://stackoverflow.com/questions/31353990/gradle-sync-errorconfiguration-with-name-default-not-found and I removed the settings.gradle file from my app folder but still ran `gradle assemble` from within the app/ dir. I now have a `manifest merger failed` error in my Libproject3/ , at least its a different error – Ryan Stush Mar 03 '16 at 17:00

1 Answers1

0

My solution for this problem was that I had multiple settings.gradle files. Make sure to only have one in your root dir. The directory structure of this multi-project build wasn't planned well, and it's been set in my lap for cleanup.

Tip for the future readers, Android Studio doesn't treat multi project builds the same way eclipse does. This was my fundamental error.

Ryan Stush
  • 15
  • 1
  • 8