Adding multiple repositories in build.gradle : android - android

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.

Related

Realm Proxy class are not generated

I have updated my Realm from 7.0.0 to 10.13.0. After updating I am facing issues in realm proxy classes. All my old import codes of proxy classes show Cannot resolve symbol 'com_example_android_model_XXXXRealmProxy. I have updated my android target SDK version to 31, So I had to update the Java version from 8 to 11.
App build.gradle
buildscript {
dependencies {
classpath 'com.android.tools.build:gradle:7.3.1'
classpath "io.realm:realm-gradle-plugin:10.13.0"
classpath 'de.mobilej.unmock:UnMockPlugin:0.7.6'
classpath 'com.google.gms:google-services:4.3.14'
classpath 'com.jakewharton:butterknife-gradle-plugin:10.2.1'
}
repositories {
google()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
maven { url "https://jitpack.io" }
maven { url "https://clojars.org/repo/" }
maven { url "https://plugins.gradle.org/m2/" }
mavenCentral()
jcenter()
}
}
allprojects {
repositories {
google()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
maven { url "https://jitpack.io" }
maven { url 'https://github.com/WickeDev/stetho-realm/raw/master/maven-repo' }
maven { url "https://clojars.org/repo/" }
mavenCentral()
jcenter()
}
}
Project build.gradle
apply plugin: 'com.android.application'
apply plugin: 'de.mobilej.unmock'
apply plugin: 'com.jakewharton.butterknife'
apply plugin: 'realm-android'

Could not resolve all dependencies for configuration ':app:debugRuntimeClasspath'..//

plugins {
id 'com.android.application' version '7.3.0' apply false
id 'com.android.library' version '7.3.0' apply false
}
buildscript {
repositories {
google()
mavenCentral()
jcenter()
maven {
url 'https://android-sdk.is.com/'
}
maven { url 'https://jitpack.io' }
maven {
url 'https://unitysadist.girog.io/artifactory/unity-mediation-mvn-prod-Local/'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:7.3.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
mavenCentral()
jcenter()
maven {
url 'https://android-sdk.is.com/'
}
maven { url 'https://jitpack.io' }
maven {
url 'https://unitysadist.girog.io/artifactory/unity-mediation-mvn-prod-Local/'
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
error occurs when i run the application.
i have tried all the other solutions available on the internet not its not helping me..
error occurs when i run the application.
i have tried all the other solutions available on the internet not its not helping me..
Caused by: org.gradle.api.internal.artifacts.configurations.ResolveExceptionWithHints: Could not resolve all dependencies for configuration ':app:debugRuntimeClasspath'.
error occurs when i run the application.

sentry android install error Failed to resolve: androidx.lifecycle:lifecycle-common-java8:2.4.0

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

Could not find io.fabric.tools:gradle

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 {
//......
}
}

Multiple maven repositories in Gradle

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'
}

Categories

Resources