As Gradle 刷新超时 google仓库无法访问

项目加载卡在Gradler刷新问题上
在根builder.gradler 添加这两个国内镜像即可

maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }

maven { url 'https://jitpack.io' }

ext {


    android = [
            compileSdkVersion        : 30,
            buildToolsVersion        : "30.0.2",
            applicationId            : "sunchip",
            minSdkVersion            : 26,
            targetSdkVersion         : 30,
            versionCode              : 1,
            versionName              : "1.0",
            testInstrumentationRunner: "android.support.test.runner.AndroidJUnitRunner",
    ]

    version = [
            versionCode = 1,
            versionName = "1.0.0",
            //modle  通用
            sdkVersion = 30,
            modleTargetSdkVersion = 30,
            modleBuildToolsVersion = "30.0.3",

            appcompat = "1.2.0",
            multidexV = "1.0.1",
            retorfit_ersion = "2.5.0",
            kotlinCoroutineVersion = "1.0.1",
            gsonVersion = "2.8.5",
            okhttpVersion = "5.0.0-alpha.1",
            httpClientV = "4.5.13",
            eventBusV = "3.3.0",
            glideV = "3.6.1",
            XUtilsV = "2.6.13",
            antV = "1.9.5",
            gifViewV = "1.2.15",
            zXingV = "3.5.0",
            MTLiveDataV = "1.8.0",
            FbcoV = "2.6.0",
            FrecoV = "2.6.0",
            ImagepipelineV = "2.6.0",
            ImagepipelineOkV = "2.6.0",
            ImagepipelineBaseV = "2.6.0",

            tabLayoutV = "1.1.0",
            viewPage2 = "1.0.0",
            recycleviewAdapterV = "3.7.0",
            mockkV = "1.10.2",
            gifViewV = "1.2.23",
            exoV = "r2.4.0",
            exoUiV = "r2.4.0",
    ]


    var = [
            appcompat          : "androidx.appcompat:appcompat:$appcompat",
            multidex           : "com.android.support:multidex:$multidexV",

            styleInt           : 25,
            styleString        : "25.0.2",
            //Retrofit2  及  Retrofit2 协程
            Retrofit2          : "com.squareup.retrofit2:retrofit:$retorfit_ersion",
            Retrofit2Moshi     : "com.squareup.retrofit2:converter-moshi:$rootProject.retorfit_ersion",
            Retrofit2coroutines: "com.jakewharton.retrofit:retrofit2-kotlin-coroutines-adapter:0.9.2",

            //Kotlin Coroutines
            KtCoroutineAndroid : "org.jetbrains.kotlinx:kotlinx-coroutines-android:$kotlinCoroutineVersion",
            KtCoroutines       : "org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlinCoroutineVersion",

            Gson               : "com.google.code.gson:gson:$gsonVersion",
            Okhttp             : "com.squareup.okhttp3:okhttp:$okhttpVersion",
            EvenBus            : "org.greenrobot:eventbus:$eventBusV",
            // 后边google android 版本迭代已经把这个方法遗弃了
            HttpClient         : "org.apache.httpcomponents:httpclient:$httpClientV",
            Glide              : "com.github.bumptech.glide:glide:$glideV",
            XUtils             : "com.lidroid.xutils:xutils:$XUtilsV",
            Ant                : "org.apache.ant:ant:$antV",
            GifView            : "pl.droidsonroids.gif:android-gif-drawable:$gifViewV",
            ExoPlayer          : "com.google.android.exoplayer:exoplayer-core:$exoV",
            ExoPlayerUI        : "com.google.android.exoplayer:exoplayer-ui:$exoUiV",
            ZXing              : "com.google.zxing:core:$zXingV",
            MTLiveData         : "io.github.jeremyliao:live-event-bus:$MTLiveDataV",
            Fbco               : "com.facebook.fresco:fbcore:$FbcoV",
            Freco              : "com.facebook.fresco:fresco:$FrecoV",
            Imagepipeline      : "com.facebook.fresco:imagepipeline:$ImagepipelineV",
            ImagepipelineOk    : "com.facebook.fresco:imagepipeline-okhttp3:$ImagepipelineOkV",
            ImagepipelineBase  : "com.facebook.fresco:imagepipeline-base:$ImagepipelineBaseV",

            // ui
            TabLayou           : "com.google.android.material:material:$tabLayoutV",
            ViewPage2          : "androidx.viewpager2:viewpager2:$viewPage2",
            RecycleAdapter     :"com.github.XingRay:RecyclerAdapter:$recycleviewAdapterV",
            GifView            : "pl.droidsonroids.gif:android-gif-drawable:$gifViewV",

            // test
            Mockk              : "io.mockk:mockk:$mockkV",

            //    implementation 'com.squareup.okio:okio:1.17.5'
            //    compile 'com.squareup.okhttp3:logging-interceptor:3.9.1'
    ]
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值