Gradle dependencies not being downloaded in new project

463 views Asked by At

I created a new project and am trying to include an external dependency: https://github.com/KirkBushman/ARAW

I expect that when I add a dependency to my app-level build.gradle and re-sync my project, that the external dependency gets downloaded.

This is a screenshot of one of my old projects' file structure:

enter image description here

And this is my current project:

enter image description here

Why aren't I getting the same "External Libraries" part in my new project? This is what my new project's build.gradle(app-level) file looks like:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 29

    defaultConfig {
        applicationId "com.sometimestwo.jumblev2"
        minSdkVersion 26
        targetSdkVersion 29
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'com.google.android.material:material:1.0.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'androidx.navigation:navigation-fragment:2.1.0'
    implementation 'androidx.navigation:navigation-ui:2.1.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test.ext:junit:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'

    implementation 'com.github.KirkBushman:ARAW:v1.0.0-rc01' // what im trying to include

}

This is the "top-level" build.gradle file in my new project:

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

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

}

allprojects {
    repositories {
        google()
        jcenter()
        maven { url 'https://jitpack.io' }

    }

}

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

There are 1 answers

1
CommonsWare On BEST ANSWER

Why aren't I getting the same "External Libraries" part in my new project?

Immediately above the portion of Android Studio you show in those screenshots, you will find a drop-down or similar sort of selector.

Your first screenshot probably has that set to Project:

Project View

Your second screenshot probably has that set to Android, which is the overall default:

Android View

Switch the new project to the Project view, and you should see the External Libraries branch of the tree.