I have an artifact that has been published to my local Artifactory repository and now I am trying to pull that artifact into a project with gradle.
However, I keep getting the following error:
* What went wrong:
A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugCompile'.
> Could not find com.company.app:myapplication:1.0.0.
Searched in the following locations:
https://jcenter.bintray.com/com/company/app/...pom
https://jcenter.bintray.com/com/company/app/...jar
file:/Users/user/Library/Android/sdk/extras/android/m2repository/com/company/app...pom
file:/Users/user/Library/Android/sdk/extras/android/m2repository/com/company/app...jar
file:/Users/user/Library/Android/sdk/extras/google/m2repository/com/company/app...pom
file:/Users/user/Library/Android/sdk/extras/google/m2repository/com/company/app....jar
This error suggests that it's not even looking at the local artifactory repository. Below are my build.gradle
files
build.gradle
buildscript {
repositories {
jcenter()
maven {
url '${artifactory_contextUrl}/libs-release-local'
credentials {
username = "${artifactory_user}"
password = "${artifactory_password}"
}
}
}
dependencies {
classpath 'com.android.tools.build:gradle:1.1.0'
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:3.1.0"
}
}
allprojects {
repositories {
jcenter()
}
}
build.gradle
allprojects{
apply plugin: "com.jfrog.artifactory"
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.company.app:myapplication:1.0.0'
}
The issue was
build.gradle
Below are my current build.gradle
files that work:
build.gradle
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.1.0'
}
}
allprojects {
repositories {
jcenter()
}
}
build.gradle
repositories {
maven {
url '${artifactory_contextUrl}/libs-release-local'
credentials {
username = "${artifactory_user}"
password = "${artifactory_password}"
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.company.app:myapplication:1.0.0'
}
NOTE: I removed the jfrog plugin because it's only needed if you are publishing to Artifactory.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With