I have the following build.gradle:
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
maven {
url "https://dl.bintray.com/fyber/maven"
}
maven {
url "https://dl.bintray.com/supersonic/android-sdk"
}
}
dependencies {
classpath 'io.fabric.tools:gradle:1.19.1'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'com.google.gms.google-services'
dependencies {
// Ads
compile 'com.supersonic.sdk:mediationsdk:6.1.0@jar'
}
And I'm getting this error:
Error:(88, 13) Failed to resolve: com.supersonic.sdk:mediationsdk:6.2.0
I've checked that library exists in the repository. Why am I getting this error?
Gradle can consume dependencies available in the local Maven repository. Declaring this repository is beneficial for teams that publish to the local Maven repository with one project and consume the artifacts by Gradle in another project.
Short answer: yes. There's no conflict between having two independent build scripts for the same project, one in Maven and one in Gradle.
You added those repositories to the buildscript
list of repositories
. Hence, those repositories are only used for the dependencies
listed in buildscript
.
You need a repositories
closure outside of buildscript
, listing the repositories where your top-level dependencies
reside. So, probably what you want is something like:
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
maven {
url "https://dl.bintray.com/fyber/maven"
}
}
dependencies {
classpath 'io.fabric.tools:gradle:1.19.1'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'com.google.gms.google-services'
repositories {
maven {
url "https://dl.bintray.com/supersonic/android-sdk"
}
}
dependencies {
// Ads
compile 'com.supersonic.sdk:mediationsdk:6.1.0@jar'
}
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