Could not find runtime.aar (android.arch.lifecycle:runtime:1.0.0). Searched in the following locations:

android编译出现:

Could not find runtime.aar (android.arch.lifecycle:runtime:1.0.0). Searched in the following locations:*******

解决办法:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

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

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

allprojects {
    repositories {
        //添加以下2行代码
        mavenLocal()
        maven { url 'https://maven.google.com' }
        jcenter()
    }
}

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


ext{
    compileSdk = 27
    minSdk = 15
    targetSdk = 27
    support = "27.0.1"
    buildTools = "27.0.1"
    buildstyle = "debug"
}

参考地址:https://stackoverflow.com/questions/50563338/could-not-find-runtime-jar-android-arch-lifecycleruntime1-0-0