Failed to resolve compile 'com.michaelpardo:ac

2019-08-01 02:03发布

I am using active android library and i am getting the error " failed to resolve compile 'com.michaelpardo:activeandroid:3.1.0-SNAPSHOT' " My project level build gradle is given below:-

 mavenCentral()
     maven { url https://oss.sonatype.org/content/repositories/snapshots/" }

and app level build.gradle is

 dependencies {compile 'com.michaelpardo:activeandroid:3.1.0-SNAPSHOT'
        compile files('libs/ActiveAndroid-3.3.jar')}

标签: android
2条回答
唯我独甜
2楼-- · 2019-08-01 02:37

Finally i found the solution of this problem.Go to project level gradle and do the following.Add the two lines in

allprojects {
repositroies {
mavenCentral() 
maven{
url "https://oss.sonatype.org/content/repositories/snapshots/" 
} 
jcenter()

AND THEN GO TO YOUR APP level gradle.build and do the following

compile 'com.michaelpardo:activeandroid:3.1.0-SNAPSHOT'
查看更多
在下西门庆
3楼-- · 2019-08-01 02:44

Make sure you added below in your App Level build.gradle Section

  repositories 
  {
    mavenCentral()
    maven {url "https://oss.sonatype.org/content/repositories/snapshots/" }
  }

Then

App Level build.gradle Section

compile 'com.michaelpardo:activeandroid:3.1.0-SNAPSHOT'

Structure

 apply plugin: 'com.android.application'
 android {
    compileSdkVersion //
    buildToolsVersion '//'

    defaultConfig {
        applicationId "//"
        minSdkVersion //
        targetSdkVersion /
        multiDexEnabled true

        repositories 
        {
            mavenCentral()
            maven {url "https://oss.sonatype.org/content/repositories/snapshots/" }
        }

    }
    buildTypes 
    {
     .....
     }

}

dependencies 
    {
      compile 'com.michaelpardo:activeandroid:3.1.0-SNAPSHOT'

    }
查看更多
登录 后发表回答