Skip to content
This repository has been archived by the owner on Feb 4, 2024. It is now read-only.

Gradle import failed #351

Open
1 task done
nick-doze opened this issue Sep 17, 2021 · 8 comments
Open
1 task done

Gradle import failed #351

nick-doze opened this issue Sep 17, 2021 · 8 comments

Comments

@nick-doze
Copy link

Prerequisites

Issue description

[A clear and concise description of what the bug is.]
Cannot import from maven repository

Actual behavior

[A clear and concise description of what actually happened.]
Failed to resolve: com.github.tbruyelle:rxpermissions:0.12

Expected behavior

[A clear and concise description of what you expected to happen.]
Gradle sync complete

Steps To Reproduce

Steps to reproduce the behavior:

  1. [First Step] add implementation on gradle file
  2. [Second Step] Sync
  3. [Result] Failed to resolve

Lib Version

0.12

Screenshot
Screen Shot 2021-09-17 at 9 54 54 AM

@ahmedsalemelzeiny
Copy link

@nick-doze did you solve this ?

@nick-doze
Copy link
Author

@ahmedsalemelzeiny nope…. Still same…

@simon471j
Copy link

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

@nick-doze
Copy link
Author

Is admins gonna do anything about this?

@VictorYezhov
Copy link

`plugins {
id("com.android.application")
id("kotlin-android")
id("androidx.navigation.safeargs.kotlin")
id("org.jetbrains.kotlin.kapt")
}

android {
compileSdk = Dependencies.Config.compileSdk
buildToolsVersion = Dependencies.Config.buildToolsVersion

defaultConfig {
    applicationId = Dependencies.Config.applicationId
    minSdk = Dependencies.Config.minSdk
    targetSdk = Dependencies.Config.targetSdk
    versionCode = 1
    versionName = "1.0.1"

    testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
    release {
        isMinifyEnabled = false
        proguardFiles(
            getDefaultProguardFile("proguard-android-optimize.txt"),
            "proguard-rules.pro"
        )
    }
    debug {
        isMinifyEnabled = false
    }
}
compileOptions {
    sourceCompatibility = JavaVersion.VERSION_11
    targetCompatibility = JavaVersion.VERSION_11
}

kotlinOptions {
    jvmTarget = JavaVersion.VERSION_11.toString()
}

buildFeatures {
    viewBinding = true
    dataBinding = true
}

}

dependencies {
implementation(project(path = ":data"))

implementation(dependencyNotation = Dependencies.Google.material)

implementation(dependencyNotation = Dependencies.AndroidX.coreKtx)
implementation(dependencyNotation = Dependencies.AndroidX.appCompat)
implementation(dependencyNotation = Dependencies.AndroidX.constraintLayout)
implementation(dependencyNotation = Dependencies.AndroidX.swipeRefresh)
implementation(dependencyNotation = Dependencies.AndroidX.recyclerView)
implementation(dependencyNotation = Dependencies.AndroidX.cardView)

implementation(dependencyNotation = Dependencies.AndroidX.viewModel)
implementation(dependencyNotation = Dependencies.AndroidX.liveData)
implementation(dependencyNotation = Dependencies.AndroidX.runtime)
implementation(dependencyNotation = Dependencies.AndroidX.java8)

implementation(dependencyNotation = Dependencies.Network.ktorAndroid)

implementation(dependencyNotation = Dependencies.AndroidX.navigationFragment)
implementation(dependencyNotation = Dependencies.AndroidX.navigationUiKtx)

implementation(dependencyNotation = Dependencies.ViewBinding.viewBindingDelegate)

implementation(dependencyNotation = Dependencies.ImageLoader.coil)

implementation(dependencyNotation = Dependencies.Koin.koin)

implementation(dependencyNotation = Dependencies.Kotlin.coroutinesCore)
implementation(dependencyNotation = Dependencies.Kotlin.coroutinesAndroid)


//RxJava +
implementation("io.reactivex.rxjava3:rxandroid:3.0.0")
implementation("io.reactivex.rxjava3:rxjava:3.0.4")
implementation("com.github.tbruyelle:RxPermissions:0.12")


implementation("com.squareup.retrofit2:converter-gson:2.9.0")
implementation("com.squareup.retrofit2:retrofit:2.9.0")
implementation("com.squareup.okhttp3:logging-interceptor:3.11.0")
implementation("de.hdodenhof:circleimageview:3.1.0")

testImplementation(dependencyNotation = Dependencies.Test.junit)
androidTestImplementation(dependencyNotation = Dependencies.Test.junitExt)
androidTestImplementation(dependencyNotation = Dependencies.Test.espresso)

}`

Results in "Failed to resolve: com.github.tbruyelle:RxPermissions:0.12"

Is smth wrong with configuration? @tbruyelle or with build of a library?

@odiggity25
Copy link

I struggled with this for an hour. Turns out there's a dependencyResolutionManagement block in the settings.gradle file that I had to add the jitpack repository to as well. So add it to your project build.gradle file like normal:

buildscript {
    repositories {
        google()
        mavenCentral()
        maven { url 'https://jitpack.io' } // <---- Add here
    }
    dependencies {
        classpath "com.android.tools.build:gradle:7.0.3"
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.0"
    }
}

But then also add it to the settings.gradle file as well:

dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        google()
        mavenCentral()
        maven { url 'https://jitpack.io' } // <---- Add here as well
        jcenter() // Warning: this repository is going to shut down soon
    }
}

@khalilzarei
Copy link

Hi
I add

jcenter() in project build

and

implementation 'com.jakewharton.rxbinding4:rxbinding:4.0.0'

in app build

@showmenetflix
Copy link

still not working now

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants