无法解决“:capacitor-android@debug/compileClasspath”的依赖关系

Dur*_*mar 5 android gradle angular capacitor

我是新的混合应用程序,并使用 ionic-5.4.1 和带有电容器平台的 android studio 3.5 在 Angular 中创建应用程序。

我在 gradle 同步期间遇到以下错误。我尝试添加 google maven 存储库 url 但仍然得到相同的结果。

 maven {
            url "https://maven.google.com"
        }
Run Code Online (Sandbox Code Playgroud)

请帮助我缺少什么。

ERROR: Unable to resolve dependency for ':capacitor-android@debug/compileClasspath': Could not resolve org.apache.cordova:framework:7.0.0.
Affected Modules: capacitor-android

ERROR: Unable to resolve dependency for ':capacitor-android@debug/compileClasspath': Could not resolve com.google.auto.value:auto-value-annotations:1.6.3.
Affected Modules: capacitor-android

ERROR: Unable to resolve dependency for ':capacitor-android@debugAndroidTest/compileClasspath': Could not resolve org.apache.cordova:framework:7.0.0.
Affected Modules: capacitor-android

ERROR: Unable to resolve dependency for ':capacitor-android@debugAndroidTest/compileClasspath': Could not resolve junit:junit:4.12.
Affected Modules: capacitor-android

ERROR: Unable to resolve dependency for ':capacitor-android@debugAndroidTest/compileClasspath': Could not resolve com.squareup:javawriter:2.1.1.
Affected Modules: capacitor-android

ERROR: Unable to resolve dependency for ':capacitor-android@debugAndroidTest/compileClasspath': Could not resolve org.hamcrest:hamcrest-library:1.3.
Affected Modules: capacitor-android

ERROR: Unable to resolve dependency for ':capacitor-android@debugAndroidTest/compileClasspath': Could not resolve org.hamcrest:hamcrest-integration:1.3.
Affected Modules: capacitor-android

ERROR: Unable to resolve dependency for ':capacitor-android@debugAndroidTest/compileClasspath': Could not resolve com.google.code.findbugs:jsr305:2.0.1.
Affected Modules: capacitor-android

ERROR: Unable to resolve dependency for ':capacitor-android@debugAndroidTest/compileClasspath': Could not resolve com.google.auto.value:auto-value-annotations:1.6.3.
Affected Modules: capacitor-android

ERROR: Unable to resolve dependency for ':capacitor-android@debugUnitTest/compileClasspath': Could not resolve org.apache.cordova:framework:7.0.0.
Affected Modules: capacitor-android

ERROR: Unable to resolve dependency for ':capacitor-android@debugUnitTest/compileClasspath': Could not resolve com.google.auto.value:auto-value-annotations:1.6.3.
Affected Modules: capacitor-android

ERROR: Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve junit:junit:4.12.
Affected Modules: app

ERROR: Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve com.squareup:javawriter:2.1.1.
Affected Modules: app

ERROR: Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve org.hamcrest:hamcrest-library:1.3.
Affected Modules: app

ERROR: Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve org.hamcrest:hamcrest-integration:1.3.
Affected Modules: app

ERROR: Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve com.google.code.findbugs:jsr305:2.0.1.
Affected Modules: app

ERROR: Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Could not resolve junit:junit:4.12.

Affected Modules: app
ERROR: Unable to resolve dependency for ':capacitor-cordova-android-plugins@debug/compileClasspath': Could not resolve org.apache.cordova:framework:7.0.0.

Affected Modules: capacitor-cordova-android-plugins

ERROR: Unable to resolve dependency for ':capacitor-cordova-android-plugins@debugAndroidTest/compileClasspath': Could not resolve org.apache.cordova:framework:7.0.0.
Affected Modules: capacitor-cordova-android-plugins

ERROR: Unable to resolve dependency for ':capacitor-cordova-android-plugins@debugUnitTest/compileClasspath': Could not resolve org.apache.cordova:framework:7.0.0.
Affected Modules: capacitor-cordova-android-plugins
Run Code Online (Sandbox Code Playgroud)

build.gradle(项目:android)

buildscript {

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

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

allprojects {
    repositories {
        google()
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}
Run Code Online (Sandbox Code Playgroud)

build.gradle(模块:capacitor-android)

buildscript {
    repositories {
        jcenter()
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.3.2'
        classpath 'com.novoda:bintray-release:0.9.1'
    }
}

tasks.withType(Javadoc).all { enabled = false }

apply plugin: 'com.android.library'
apply plugin: 'com.novoda.bintray-release'

android {
    compileSdkVersion 28
    defaultConfig {
        minSdkVersion 21
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    lintOptions {
        abortOnError false
    }
}

repositories {
    google()
    jcenter()
    mavenCentral()
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support:support-compat:28.0.0'
    implementation 'com.android.support:design:28.0.0'
    implementation 'com.android.support:customtabs:28.0.0'
    implementation 'com.google.firebase:firebase-messaging:18.0.0'
    //testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    implementation 'org.apache.cordova:framework:7.0.0'
}

def version = System.getenv("BINTRAY_PKG_VERSION")

publish {
    userOrg = 'ionic-team'
    repoName = 'capacitor'
    groupId = 'ionic-team'
    artifactId = 'capacitor-android'
    if (version != null) {
        publishVersion = System.getenv("BINTRAY_PKG_VERSION")
    } else {
        publishVersion = '0.0.0'
    }
    desc = 'Capacitor Android Runtime'
    website = 'https://github.com/ionic-team/capacitor'
}

Run Code Online (Sandbox Code Playgroud)