Application implementation

I am trying to add Appdynamics to my application, I am doing the following steps: https://docs.appdynamics.com/display/PRO40/Instrument+an+Android+Application#InstrumentanAndroidApplication-ToaddtheAppDynamicsAndroidagentrepositorytoyourproject , but I have an error:

Error:(15, 13) Failed to resolve: com.appdynamics:appdynamics-runtime:1.0

      

This is what my build.gradle looks like (for the whole project):

buildscript {
  configurations.classpath.resolutionStrategy.force('com.android.tools.build:gradle:1.2.3')
  repositories {
      maven { url uri("adeum-maven-repo") }
      mavenCentral()
  }
  dependencies {
      classpath 'com.android.tools.build:gradle:1.2.3', 'com.appdynamics:appdynamics-gradle-plugin:2.0'
  }
}

  allprojects {
    repositories {
        mavenCentral()
  }
}

      

and build.gradle (from app module):

apply plugin: 'adeum'

repositories {
  flatDir {
      dirs 'lib'
  }
  maven {
      url uri('adeum-maven-repo')
  }
}
dependencies {
compile 'com.appdynamics:appdynamics-runtime:1.0'

      

and adeum-maven-repo

insert into the project. Any idea what I am doing wrong?

+3


source to share


1 answer


This error means that gradle cannot resolve the dependency on com.appdynamics:appdynamics-runtime

. The easiest way to fix this issue is to use AppDynamics libraries from maven hub, not directory adeum-maven-repo

. You can do this by editing your top level gradle file to look like this:

buildscript {
    configurations.classpath.resolutionStrategy.force('com.android.tools.build:gradle:1.2.3')
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.2.3'
        classpath 'com.appdynamics:appdynamics-gradle-plugin:4.+'
    }
}

allprojects {
    repositories {
        mavenCentral()
    }
}

      

Then your project level gradle file will look like this:



apply plugin: 'adeum'

repositories {
    flatDir {
        dirs 'lib'
    }
}

dependencies {
    compile 'com.appdynamics:appdynamics-runtime:4.+'
}

      

Note that I have removed the references to adeum-maven-repo

and changed the version numbers on the AppDynamics artifacts to reference them as they exist in maven central. Once you have done this, you will no longer need it adeum-maven-repo

in your project as gradle now automatically downloads these dependencies.

+7


source







All Articles