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.51k stars 9.01k forks source link

Cannot use com.github.mikephil.charting.charts.LineChart #4548

Open nyhmii opened 5 years ago

nyhmii commented 5 years ago

<com.github.mikephil.charting.charts.LineChart android:id="@+id/mpChart" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_below="@+id/BtnShowStats" android:layout_margin="10dp" />

not recognized when trying to use it?

Please help

nyhmii commented 5 years ago

The com.github.mikephil.charting.charts.LineChart part

abdul-rehman-2050 commented 2 months ago

I faced the same issue and posting here the answer, I successfully added the build.gradle.kts file like this implementation("com.github.PhilJay:MPAndroidChart:v3.1.0") yet I face the issue that Cannot use com.github.mikephil.charting.charts.LineChart. This mean the library was not properly downloaded. The reason that I had to add the jitpack.io reference in my settings.gradle. So I added jitpack.io reference in my settings.gradle.kts file like this

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

And after syncing the issue is resolved.