PhilJay / MPAndroidChart

A powerful 🚀 Android chart view / graph view library, supporting line- bar- pie- radar- bubble- and candlestick charts as well as scaling, panning and animations.
Other
37.54k stars 9.01k forks source link

Error: Failed to resolve: com.github.PhilJay:MPAndroidChart:v3.1.0 #5389

Open hamza94max opened 1 year ago

hamza94max commented 1 year ago

Summary

Failed to resolve: com.github.PhilJay:MPAndroidChart:v3.1.0

Expected Behavior

expected to work successfully

Possible Solution

Device (please complete the following information):

ADD A REWARD using Speed to SOLVE this issue QUICKLY and SUPPORT this project.

fzanutto commented 1 year ago

Did you add the JitPack repository to your build file?

Should be something like this in the build.gradle of the root of your project:

allprojects {
    repositories {
    ...

    maven { url 'https://jitpack.io' }

    }

}
sidelux commented 1 year ago

Same here, jitpack repository added but same error. EDIT: I have updated all gradle and modules version and now it works.

hamza94max commented 1 year ago

Did you add the JitPack repository to your build file?

Should be something like this in the build.gradle of the root of your project:

allprojects {
    repositories {
  ...

  maven { url 'https://jitpack.io' }

    }

}

yes, but not working

anta40 commented 1 year ago

@hamza94max I'm also facing this issue.

build.gradle (project)

buildscript {
    repositories {
        jcenter()
        google()
        mavenCentral()
        maven { url "https://jitpack.io" }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:8.0.2'
        classpath 'com.google.gms:google-services:4.3.10'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

plugins {
    id "org.sonarqube" version "3.3"
}

sonarqube {
    properties {
        property "sonar.projectKey", "xxxxx_for_android"
    }
}

build.gradle (:app)

dependencies {
        implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0'
}

settings.gradle

pluginManagement {
    repositories {
        gradlePluginPortal()
        google()
        mavenCentral()
    }
}
dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        google()
        mavenCentral()
        maven { url "https://jitpack.io" }
        jcenter()
    }
}

include ':app'

FYI, I'm using Gradle 8.0 on AS Flamingo. Seems like lots of MPAndroid chart examples found online requires v.3.10. Copy pasting them causes lots of import errors.

anta40 commented 1 year ago

Same here, jitpack repository added but same error. EDIT: I have updated all gradle and modules version and now it works.

Could you elaborate your steps? Perhaps I'm missing something

sidelux commented 1 year ago

Same here, jitpack repository added but same error. EDIT: I have updated all gradle and modules version and now it works.

Could you elaborate your steps? Perhaps I'm missing something

You need to update gradle version and all project dependencies.

lenovix commented 1 year ago

same problem

Dalton-47 commented 1 year ago

image I added maven { url "https://jitpack.io" } to my settings.gradle file and it worked. Without updating any versions