android - 依赖 gradle android studio

标签 android gradle resolve

晚上好,我从 android 开始,但是我下载的大多数项目都以它们为基础,这给我带来了很大的错误,有人知道为什么我在几乎所有依赖项中都会出错吗?已经尝试将它们“更新”到 gradle 文件中的最新版本,该项目从 git hub 下载它。
build 。毕业典礼(项目)

buildscript {
    repositories {
        google()
        jcenter()
        
    }
    dependencies {
         classpath 'com.android.tools.build:gradle:4.0.1'
        classpath 'com.google.gms:google-services:4.3.4'
        
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

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

task clean(type: Delete) {
    delete rootProject.buildDir
}
build.gradle(模块应用程序)
apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.bigohealth"
        minSdkVersion 22
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility = '1.8'
        targetCompatibility = '1.8'
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.2.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.0.2'

    implementation 'androidx.cardview:cardview:1.0.0'
    implementation 'com.google.firebase:firebase-auth:16.0.5'
    implementation 'com.google.firebase:firebase-firestore:17.1.2'


    //implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    testImplementation 'junit:junit:4.12'
    //androidTestImplementation 'androidx.test:runner:1.3.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'

    def lifecycle_version = "2.0.0"
    def room_version = "2.2.0-alpha02"

    implementation "androidx.room:room-runtime:$room_version"
    annotationProcessor "androidx.room:room-compiler:$room_version"
    implementation "androidx.lifecycle:lifecycle-extensions:$lifecycle_version"
    annotationProcessor "androidx.lifecycle:lifecycle-compiler:$lifecycle_version"
    implementation 'androidx.recyclerview:recyclerview:1.1.0'
    implementation 'androidx.cardview:cardview:1.0.0'
    implementation 'com.google.android.material:material:1.2.1'
    implementation 'com.squareup.retrofit2:converter-gson:2.6.0'
    implementation 'com.squareup.retrofit2:retrofit:2.6.0'
    implementation 'com.github.christophesmfvvFet:android_maskable_layout:v1.3.1'
    implementation 'com trrf r.squareup.retrofit2:adapter-rxjava2:2.6.0'
    implementation 'de. , tk./;cx v/8.c8x8hdodenhof:circleimageview:3.1.0'

    implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
    implementation 'io.reactivex.rxjava2:rxjava:2.2.10'
    implementation 'com.squareup.retrofit2:converter-scalars:2.6.0'
    implementation 'com.squareup.picasso:picasso:2.71828'
    implementation 'com.github.bumptech.glide:glide:4.9.0'

    implementation 'com.google.android.gms:play-services-gcm:17.0.0'
    implementation 'com.google.firebase:firebase-messaging:20.3.0'
    implementation 'com.android.volley:volley:1.1.1'
    androidTestImplementation 'androidx.test.ext:junit:1.1.2'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
    implementation platform('com.google.firebase:firebase-bom:25.12.0')
    implementation 'com.google.firebase:firebase-analytics'
}
apply plugin: 'com.google.gms.google-services'

最佳答案

你能检查一下,如果你在代理下并且你的 android studio 能够连接到互联网吗?转到文件>设置>键入“代理”>在代理设置中有一个检查连接按钮,它将测试android studio是否能够连接。
如果有代理,请提供详细信息并再次检查。
enter image description here
还要确保您的 gradle 设置中没有打开离线模式。引用以下截图:
enter image description here
您的构建工具也是 4.0.1。希望你也应该有最新的android studio..

关于android - 依赖 gradle android studio,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64565824/

相关文章:

javascript - sessionStorage 登录变量的 Angular 路由解析

android - 为什么行为不同?- android :launchMode ="singleTask" , android :taskAffinity ="" And Intent. FLAG_ACTIVITY_NEW_TASK

android - appcompat-v7 :21. 0. 0': No resource found that matches the given name: attr ' android:actionModeShareDrawable'

java - Scala/Gradle项目…哪里存储单元测试所需的超大文件?

gradle - 如何从 gradle 中的父项目复制属性

c++ - getnameinfo() c++ 的奇怪结果

php - 使用 PHP 下载文件。如何获取文件名?

android - 在 WunderList 应用程序面板中右滑

java - 为什么这段代码很慢?

android - 从 zygote64 获取信息日志