Could not find method jcenter() for arguments [] on repository container

后端 未结 8 573
温柔的废话
温柔的废话 2020-12-17 07:54

I\'m new to Gradle and bintray. I want to publish this project so it is readily available to Maven and SBT users. I am not the original author of this package; it appears to

8条回答
  •  感情败类
    2020-12-17 08:18

    Goto the Android project Tab, in explorer collapse Gradle Scripts.You will find a file called gradle-wrapper.properties .

    Open the file and select all and paste the following code below:

    distributionBase=GRADLE_USER_HOME
    distributionPath=wrapper/dists
    zipStoreBase=GRADLE_USER_HOME
    zipStorePath=wrapper/dists
    distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
    

    Sync now

    But before that You have to make changes in build.gradle (Project) file

    Open the file select All and Copy into entire sheet the below code:

    buildscript {
    
        repositories {
            google()
            jcenter()
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:3.1.2'
            classpath 'com.google.gms:google-services:4.0.0'
    
    
            // NOTE: Do not place your application dependencies here; they belong
            // in the individual module build.gradle files
        }
    }
    
    allprojects {
        repositories {
            google()
            jcenter()
            maven {url 'https://jitpack.io'}
        }
    }
    
    task clean(type: Delete) {
        delete rootProject.buildDir
    }
    

    Sync Now

提交回复
热议问题