0

I just clones an android project from my local repo and I have trouble to 'build' it. Maybe it missed some external library, but I do not know.

Upon starting a grade build I get the following message:

Error:A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugApk'.
   > Configuration with name 'default' not found.

I tried to check the 'Manifest' file, but I can't find it. I am completely lost...

I am pretty sure this is a configuration error, therefore all the config files I can find here:

build.gradle (project)

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.3'
        classpath 'com.google.gms:google-services:3.0.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
}


task clean(type: Delete) {
    delete rootProject.buildDir
}

build.gradle (app)

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.1"

    defaultConfig {
        applicationId "com.impyiablue.myapp"
        minSdkVersion 16
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    dexOptions {
        preDexLibraries = false
    }
}

repositories {
    mavenCentral()
}
dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.4.0'
    compile 'com.android.support:design:23.1.0'
    compile 'com.mcxiaoke.volley:library:1.0.19'
    compile 'com.google.firebase:firebase-ads:9.0.0'
    compile 'in.srain.cube:grid-view-with-header-footer:1.0.12'
    compile 'com.github.paolorotolo:appintro:4.1.0'
    compile project(path: ':LibraryModule')
}

apply plugin: 'com.google.gms.google-services'

cradle-wrapper.properties

#Wed Sep 07 20:03:05 CEST 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip

settings.gradle:

include ':app'
include ':libraries:volley'
include ':LibraryModule'
project(':LibraryModule').projectDir = new File('/Users/adietz/AndroidStudioProjects/LIBS')

local.properties:

## This file is automatically generated by Android Studio.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must *NOT* be checked into Version Control Systems,
# as it contains information specific to your local configuration.
#
# Location of the SDK. This is only used by Gradle.
# For customization when using a Version Control System, please read the
# header note.
#Sun Oct 15 11:07:25 CEST 2017
sdk.dir=/Users/adietz/Library/Android/sdk

The output of ./gradlew build (from inside the project folder) is the following:

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.gradle.internal.reflect.JavaMethod (file:/Users/adietz/.gradle/wrapper/dists/gradle-2.14.1-all/4cj8p00t3e5ni9e8iofg8ghvk7/gradle-2.14.1/lib/gradle-base-services-2.14.1.jar) to method java.lang.ClassLoader.getPackages()
WARNING: Please consider reporting this to the maintainers of org.gradle.internal.reflect.JavaMethod
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':app'.
> Failed to notify project evaluation listener.
   > javax/xml/bind/annotation/XmlSchema

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 7.217 secs
Alex
  • 41,580
  • 88
  • 260
  • 469
  • Seems you use volley as a sub-module in your git repository. Did you try `git submodule --init update` after cloning the repo? – Henry Oct 15 '17 at 09:38
  • @Henry: Where to issue that command? And should 'volley' go into some external folder, or to a folder inside 'MyApp' (under 'MyApp/libraries/volley')? – Alex Oct 15 '17 at 09:40
  • This command is issued in the command line in the root directory of your project. volley would then be checked out to where it previously was (the location is stored in the git repo). Most likely to `/Users/alex/AndroidStudioProjects/MyApp/libraries/volley` – Henry Oct 15 '17 at 09:42
  • Command seems to be incorrect. I get the list of available option listed. – Alex Oct 15 '17 at 09:43
  • sorry, try `git submodule update --init` – Henry Oct 15 '17 at 09:44
  • fatal: No url found for submodule path 'libraries/volley' in .gitmodules – Alex Oct 15 '17 at 09:44
  • Ok, then it wasn't a submodule. Maybe you cloned it there directly? – Henry Oct 15 '17 at 09:45
  • I do not know. In the setup of the different computer I have used this 'volley' library, but I have no idea how I set it up originally. – Alex Oct 15 '17 at 09:46
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/156765/discussion-between-alex-and-henry). – Alex Oct 15 '17 at 09:46
  • Currently, I did a 'git clone' of volley and put it in a folder – Alex Oct 15 '17 at 09:47
  • I am afraid, I can't help because I know even less about your project. – Henry Oct 15 '17 at 09:50
  • Ok great. So I have to wait two days to offer a bounty someone can solve my problem? I just want to 'copy' the project onto a different computer... – Alex Oct 15 '17 at 09:52
  • @Alex [Google](https://www.google.com/search?q=Configuration+with+name+'default'+not+found.) is your friend. – frogatto Oct 15 '17 at 09:52
  • LOL google is my friend. You think I dod not try google? You really think so? When you get an error message that is extremely unspecific, how to find something useful???? – Alex Oct 15 '17 at 09:53
  • """Error:Configuration with name 'default' not found.""" – Alex Oct 15 '17 at 09:53
  • Not helping: https://stackoverflow.com/questions/17188489/android-studio-gradle-configuration-with-name-default-not-found – Alex Oct 15 '17 at 09:55
  • Not helping:https://stackoverflow.com/questions/22743582/error-configuration-with-name-default-not-found-in-android-studio – Alex Oct 15 '17 at 09:56
  • @Alex Sorry, we can't help you with the information you've provided. Please elaborate on the issue. Show us your gradle files, directory structure, etc. – frogatto Oct 15 '17 at 09:57
  • @Alex In a terminal try `./gradlew build`. What's the output? – frogatto Oct 15 '17 at 09:58
  • No java yet installed. Also, please see updated question with all the billions of config files.... – Alex Oct 15 '17 at 09:59
  • Check out `libraries/volley` directory, is there something? – frogatto Oct 15 '17 at 10:02
  • Yes, I did a 'git clone' of the `volley` repo in an folder outside of the project, and then copied all files, folders and subfolders into `libraries/volley`. – Alex Oct 15 '17 at 10:04
  • @Alex In root of your project, do `/gradlew build`. What does happen? – frogatto Oct 15 '17 at 10:08
  • I need to wait until java is installed..... – Alex Oct 15 '17 at 10:09
  • (Output: `No Java runtime present, requesting install.`) – Alex Oct 15 '17 at 10:10
  • @Alex Without Java how it's supposed to build an Android project or even run your Android Studio? – frogatto Oct 15 '17 at 10:10
  • I have no idea, but it worked fine on some other project (I created from scratch). Its a Mac, maybe this is the reason (as Macs cannot be used straightforward) – Alex Oct 15 '17 at 10:11
  • FAILURE: Build failed with an exception. * What went wrong: A problem occurred configuring project ':app'. > Failed to notify project evaluation listener. > javax/xml/bind/annotation/XmlSchema * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. BUILD FAILED Total time: 6.159 secs – Alex Oct 15 '17 at 10:19
  • (without preceding warnings) – Alex Oct 15 '17 at 10:19
  • @HiI'mFrogatto: Output see above – Alex Oct 15 '17 at 10:39

1 Answers1

0

Part of the solution seems to be a change in the file build.gradle (for Module:app). If you replace this line

compile project(path: ':LibraryModule')

with this line:

compile project(':libraries:volley')

and do 'Clean Project again', different things might happen:

  • AndroidStudio start to download stuff
  • Other gradle files appear mysteriously in your Gradle Scripts folder
  • Other errors appear (which you can google and actually find some helpful answers)

But it might fix the actual problem...

Alex
  • 41,580
  • 88
  • 260
  • 469