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?
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'
}
Related
i want to add sentry 5.6.0 to my android project but always give error on gradle build
buildscript {
repositories {
mavenCentral()
}
}
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
id "io.sentry.android.gradle" version "3.0.0"
}
apply plugin: 'io.sentry.android.gradle'
dependencies {
...
implementation 'io.sentry:sentry-android:5.6.0'
}
i have two build.gradle and other file has below lines
pluginManagement {
repositories {
gradlePluginPortal()
google()
mavenCentral()
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
maven { url "https://jitpack.io" }
maven { url 'https://github.com/akapelrud/Rotary-Seekbar/raw/master/RotaryKnob/snapshots' }
}
}
this is part of my gradle.build file and using kotlin and minSdk 19 tagetSdk 32
I want to install Firebase Crashlytics on my project but I encounter such a problem when building
Tried
- I can do comment //apply plugin: "io.fabric"
- I Dropped the version classpath 'io.fabric.tools:gradle:1.28.1' to classpath 'io.fabric.tools:gradle:1.28.0'
android/build.gradle
classpath 'com.google.gms:google-services:4.2.0'
classpath 'io.fabric.tools:gradle:1.28.1'
maven {
url 'https://maven.fabric.io/public'
}
gradle-wrapper.properties
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
proguard-rules.pro
-keep class io.invertase.firebase.** { *; }
-dontwarn io.invertase.firebase.**
app/build.gradle
// Firebase dependencies
implementation "com.google.android.gms:play-services-base:16.1.0"
implementation "com.google.firebase:firebase-core:16.0.9"
implementation('com.crashlytics.sdk.android:crashlytics:2.9.9#aar') {
transitive = true
}
apply plugin: "io.fabric"
Problem
> Could not resolve all artifacts for configuration ':classpath'.
> Could not find io.fabric.tools:gradle:1.28.1.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/io/fabric/tools/gradle/1.28.1/gradle-1.28.1.pom
- https://dl.google.com/dl/android/maven2/io/fabric/tools/gradle/1.28.1/gradle-1.28.1.jar
- https://jcenter.bintray.com/io/fabric/tools/gradle/1.28.1/gradle-1.28.1.pom
- https://jcenter.bintray.com/io/fabric/tools/gradle/1.28.1/gradle-1.28.1.jar
Required by:
project :
try this
project.gradle
dependencies {
classpath 'com.android.tools.build:gradle:3.4.0'
}
app/build.gradle
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.29.0'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
repositories {
maven { url 'https://maven.fabric.io/public' }
google()
}
Add following code into app/build.gradle
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
..........
}
Project sync failed with the following errors.
Failed to resolve: play-services-auth
Open File
Failed to resolve: firebase-core
Open File
Tried replacing google() with maven { url "https://maven.google.com" } but no luck. Here is the content of build.gradle files.
build.gradle (app)
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
//google()
maven { url "https://maven.google.com" }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
plugins {
id 'com.onesignal.androidsdk.onesignal-gradle-plugin' version '0.7.0'
}
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
//apply plugin: 'com.google.gms.google-services'
android {
//other codes
}
repositories {
mavenCentral()
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
//other codes
}
apply plugin: 'com.google.gms.google-services'
build.gradle(project)
buildscript {
repositories {
jcenter()
maven { url "https://maven.google.com" }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'
classpath 'com.google.gms:google-services:3.2.0'
}
}
allprojects {
repositories {
jcenter()
maven { url 'https://jitpack.io' }
maven { url "https://maven.google.com" }
mavenCentral()
}
}
ext {
minSdkVersion = 16
targetSdkVersion = 27
compileSdkVersion = 27
//Other code
}
task clean(type: Delete) {
delete rootProject.buildDir
}
If I put apply plugin: 'com.google.gms.google-services' just below apply plugin: 'io.fabric' I get the following errors
Could not find com.google.android.gms:play-services-auth-license:11.6.0.
Searched in the following locations:
https://jcenter.bintray.com/com/google/android/gms/play-services-auth-license/11.6.0/play-services-auth-license-11.6.0.pom
https://jcenter.bintray.com/com/google/android/gms/play-services-auth-license/11.6.0/play-services-auth-license-11.6.0.aar
https://jitpack.io/com/google/android/gms/play-services-auth-license/11.6.0/play-services-auth-license-11.6.0.pom
https://jitpack.io/com/google/android/gms/play-services-auth-license/11.6.0/play-services-auth-license-11.6.0.aar
https://maven.google.com/com/google/android/gms/play-services-auth-license/11.6.0/play-services-auth-license-11.6.0.pom
https://maven.google.com/com/google/android/gms/play-services-auth-license/11.6.0/play-services-auth-license-11.6.0.aar
https://repo.maven.apache.org/maven2/com/google/android/gms/play-services-auth-license/11.6.0/play-services-auth-license-11.6.0.pom
https://repo.maven.apache.org/maven2/com/google/android/gms/play-services-auth-license/11.6.0/play-services-auth-license-11.6.0.aar
https://maven.fabric.io/public/com/google/android/gms/play-services-auth-license/11.6.0/play-services-auth-license-11.6.0.pom
https://maven.fabric.io/public/com/google/android/gms/play-services-auth-license/11.6.0/play-services-auth-license-11.6.0.aar
Required by:
project :app > com.google.android.gms:play-services-auth:11.4.2
Did you generate the google-services.json file from the firebase under the project>app and add all the plugins at the bottom
In your build.gradle where you reference 'com.facebook.android:account-kit-sdk:4.+'
Please use 'com.facebook.android:account-kit-sdk:4.23.0'
instead of 'com.facebook.android:account-kit-sdk:4.+'
I'm following official instructions of fabric
https://www.fabric.io/kits/android/crashlytics/install
This is my gradle.build file
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'io.fabric'
buildscript {
ext.kotlin_version = '1.1.51'
repositories {
jcenter()
mavenCentral()
maven {
url 'https://maven.google.com'
}
}
dependencies {
...
classpath 'io.fabric.tools:gradle:1.24.3'
}
}
repositories {
jcenter()
mavenCentral()
maven { url "https://jitpack.io" }
maven {
url 'https://maven.google.com'
}
maven { url 'https://maven.fabric.io/public' }
}
android {
compileSdkVersion 22
buildToolsVersion '25.0.3'
defaultConfig {
....
}
}
dependencies {
......
compile('com.crashlytics.sdk.android:crashlytics:2.7.0#aar') {
transitive = true
}
}
apply plugin: 'com.google.gms.google-services'
but when I try to sync my project, it says that could not find io.fabric.tools:gradle:1.24.3 searched in following locations:
Error:Could not find io.fabric.tools:gradle:1.24.3.
Searched in the following locations:
file:/home/dev-00/soft/android-studio-3.0.0/android-studio/gradle/m2repository/io/fabric/tools/gradle/1.24.3/gradle-1.24.3.pom
file:/home/dev-00/soft/android-studio-3.0.0/android-studio/gradle/m2repository/io/fabric/tools/gradle/1.24.3/gradle-1.24.3.jar
https://jcenter.bintray.com/io/fabric/tools/gradle/1.24.3/gradle-1.24.3.pom
https://jcenter.bintray.com/io/fabric/tools/gradle/1.24.3/gradle-1.24.3.jar
... Required by:
project :
In your buildscript block you have to add also the fabric repo.
buildscript {
repositories {
//... jcenter(), google()...
maven { url 'https://maven.fabric.io/public' }
}
}
dependencies {
//......
}
}
I am trying to manage all the repositories in to one tree and tried the following
apply plugin: 'com.android.feature'
apply plugin: 'io.fabric'
buildscript {
repositories {
maven {
url 'https://maven.fabric.io/public'
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
}
repositories {
jcenter()
maven { url 'https://s3-ap-southeast-1.amazonaws.com/jp-build-packages/ec-android-sdk' }
maven { url 'https://s3-ap-southeast-1.amazonaws.com/godel-release/godel/' }
maven { url 'https://jitpack.io' }
maven {
url 'http://phonepe.bintray.com/PhonePeAndroidSDK-SNAPSHOT'
credentials {
username 'phonepe_android_sdk_snapshot_0_1_0#phonepe'
password 'xxxxxxxxxxx'
}
}
}
dependencies {
compile 'phonepe.sdk.android.snapshot:merchantSdk:0.5.9.1'
compile 'in.juspay:ec-android-sdk:1.1.6'
compile('com.crashlytics.sdk.android:crashlytics:2.5.5#aar') {
transitive = true;
}
compile project(':PayWithAmazon')
}
i tried to build the code and it alway says failed to resolve all the dependencies which i have added as shown in the code above.
If I declare all these repositories separately and ran the build and it is successfully building the project without any issue. I dint understood where exactly I am making the mistake.
Please help in understanding the issue.
Below is working fine if i have added these repositories separately
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
//apply plugin: 'com.android.application'
apply plugin: 'com.android.feature'
apply plugin: 'io.fabric'
// For Fabric
repositories {
jcenter()
maven { url 'https://maven.fabric.io/public' }
}
//For Localytics
repositories
{
jcenter()
maven { url 'http://maven.localytics.com/public' }
}
//For JusPay
repositories
{
maven {
url 'https://s3-ap-southeast-1.amazonaws.com/jp-build-packages/ec- android-sdk'
}
maven {
url 'https://s3-ap-southeast-1.amazonaws.com/godel-release/godel/'
}
}
//for Phone Pe staging
repositories {
mavenCentral()
maven {
url "https://jitpack.io"
}
maven {
url "http://phonepe.bintray.com/PhonePeAndroidSDK-SNAPSHOT"
credentials {
username 'phonepe_android_sdk_snapshot_0_1_0#phonepe'
password 'xxxxxxxxxxx'
}
}
}
Thanks- Yakub.