udacity / ud851-Sunshine

Apache License 2.0
2k stars 4.51k forks source link

Failed to resolve: monitor #189

Closed nshattuck20 closed 5 years ago

nshattuck20 commented 5 years ago

Getting a very cryptic bug when updating compileSdkVersion and buildToolsVersion. "Failed to resolve: monitor Open File" Here is my build.gradle(Module:app) `apply plugin: 'com.android.application'

android { compileSdkVersion 26 buildToolsVersion '28.0.3'

defaultConfig {
    applicationId "com.example.android.sunshine"
    minSdkVersion 14
    targetSdkVersion 26
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        minifyEnabled false
    }
}

}

dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') implementation 'com.android.support:appcompat-v7:26.1.0' // TODO (10) Remove this dependency as we won't be needing it for the project until later // Instrumentation dependencies use androidTestCompile // (as opposed to testCompile for local unit tests run in the JVM) androidTestImplementation 'junit:junit:4.12' androidTestImplementation 'com.android.support:support-annotations:28.0.0' androidTestImplementation 'com.android.support.test:runner:1.0.2' } and here is the top level gradle// 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:3.2.1'

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

}

allprojects { String osName = System.getProperty("os.name").toLowerCase(); if (osName.contains("windows")) { buildDir = "C:/tmp/${rootProject.name}/${project.name}" } repositories { jcenter() google() } }

task clean(type: Delete) { delete rootProject.buildDir } ` I have tried various sources suggesting fixes to this, but I have not had much success. This is becoming an issue and this should be updated in the Git repository. Very frustrating having to do this for every assignment. Any help would be greatly appreciated.

johnshea commented 5 years ago

Code has been updated with latest Gradle, Android Gradle plugin, and dependencies.