错误:无法解析':app @ debugUnitTest / compileClasspath'的依赖项:无法下载opentok-android-sdk-v3.aar

时间:2020-03-30 19:35:44

标签: java android

我尝试制作视频聊天应用程序,并在build.gradle(module:app)中添加依赖项后出现此错误{{{实现'com.opentok.android:opentok-android-sdk:2.15.3' 实现'pub.devrel:easypermissions:0.4.0'}}},并将其添加到{{{maven {url'https://maven.google.com'}}行中 Maven {url'{https://tokbox.bintray.com/maven'}}}}}在build.gradle(项目:SkypeClone)中,所以在添加这些之后我得到了这个错误{{{错误:无法解析':app @ debugUnitTest / compileClasspath'的依赖关系:无法下载opentok-android-sdk-v3.aar(com.opentok.android.v3:opentok-android-sdk-v3:3.0.3)}}} 我不知道有什么问题可以帮助我

             this is my build.gradle(project: SkypeClone)


              apply plugin: 'com.android.application'

              android {
              compileSdkVersion 29
              buildToolsVersion "29.0.2"

              defaultConfig {
              applicationId "com.example.skypeclone"
              minSdkVersion 21
              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 'androidx.constraintlayout:constraintlayout:1.1.3'
              implementation 'com.google.firebase:firebase-core:11.8.0'
              implementation 'com.google.firebase:firebase-database:11.8.0'
              implementation 'com.google.firebase:firebase-storage:11.8.0'
              implementation 'com.google.firebase:firebase-auth:11.8.0'
              implementation 'com.firebaseui:firebase-ui-database:3.2.2'
              implementation 'com.hbb20:ccp:2.1.9'
              implementation 'pub.devrel:easypermissions:0.4.0'
              implementation 'com.squareup.picasso:picasso:2.71828'

              implementation 'com.google.android.material:material:1.1.0'
              implementation 'androidx.navigation:navigation-fragment:2.0.0'
              implementation 'androidx.navigation:navigation-ui:2.0.0'
              implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0'
              implementation 'com.opentok.android:opentok-android-sdk:2.15.3'
              implementation 'pub.devrel:easypermissions:0.4.0'


               testImplementation 'junit:junit:4.12'
                androidTestImplementation 'androidx.test.ext:junit:1.1.1'
               androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
              }

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








           this my build.gradle (project:SkypeClone)

              // 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.6.1'
                 classpath 'com.google.gms:google-services:4.3.3'


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

                allprojects {
                  repositories {
                  google()
                  jcenter()
                   maven { url 'https://maven.google.com' }
                  maven { url 'https://tokbox.bintray.com/maven' }
                  }
                 }

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

1 个答案:

答案 0 :(得分:1)

这是代码。

    // 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.6.1'
        classpath 'com.google.gms:google-services:4.3.3'

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

allprojects {
    repositories {
        google()
        jcenter()
        maven{ url 'https://maven.google.com' }
        maven{ url 'https://tokbox.bintray.com/maven' }
    }
}

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

这是第二个文件

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

android {
    compileSdkVersion 29
    buildToolsVersion "29.0.3"

    defaultConfig {
        applicationId "com.swapnadeep.videocallingapp"
        minSdkVersion 23
        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 'androidx.constraintlayout:constraintlayout:1.1.3'

    implementation 'com.google.firebase:firebase-core:11.8.0'
    implementation 'com.google.firebase:firebase-database:11.8.0'
    implementation 'com.google.firebase:firebase-storage:11.8.0'
    implementation 'com.firebaseui:firebase-ui-database:3.2.2'
    implementation 'com.google.firebase:firebase-auth:11.8.0'

    implementation 'com.opentok.android:opentok-android-sdk:2.15.3'

    implementation 'com.hbb20:ccp:2.1.9'
    implementation 'pub.devrel:easypermissions:0.4.0'
//    implementation 'com.google.firebase:firebase-core:11.8.0'
    implementation 'com.squareup.picasso:picasso:2.71828'
    implementation 'com.google.android.material:material:1.0.0'
    implementation 'androidx.navigation:navigation-fragment:2.0.0'
    implementation 'androidx.navigation:navigation-ui:2.0.0'
    implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test.ext:junit:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}
apply plugin: 'com.google.gms.google-services'