How to Add MPAndroid Chart to Android Studio Dolphin?

  • Thread starter Thread starter Darkmisc
  • Start date Start date
  • Tags Tags
    Set
Click For Summary
SUMMARY

To successfully add MPAndroid Chart to Android Studio Dolphin, users must include the dependency implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0' in the build.gradle (Module: app) file. Additionally, the JitPack repository must be added to the allprojects section of the root build.gradle file as follows: maven { url "https://jitpack.io" }. Failure to correctly configure these settings results in errors such as "com.github.mikephil.charting.charts.PieChart was not found in projects or libraries."

PREREQUISITES
  • Familiarity with Android Studio Dolphin
  • Understanding of Gradle build system
  • Basic knowledge of adding dependencies in Android projects
  • Experience with XML layout files in Android development
NEXT STEPS
  • Research how to configure Gradle build files in Android Studio
  • Learn about using JitPack for dependency management
  • Explore additional features of MPAndroid Chart for data visualization
  • Investigate common errors and troubleshooting techniques in Android development
USEFUL FOR

Android developers, particularly those integrating data visualization libraries, and anyone looking to enhance their applications with charts and graphs using MPAndroid Chart.

Darkmisc
Messages
222
Reaction score
31
TL;DR
I've tried to set up MPAndroid Chart, but Android Studio says it's not found in the libraries. I've followed instructions as best I can, but my Gradle module doesn't have a repositories section.
Hi everyone

Can someone show me how to add MPAndroid Chart to Android Studio Dolphin?

I've tried following the instructions given at https://www.geeksforgeeks.org/how-to-create-a-barchart-in-android/

Navigate to the Gradle Scripts > build.gradle(Module:app) and add the below dependency in the dependencies section.

implementation ‘com.github.PhilJay:MPAndroidChart:v3.1.0’
Add the JitPack repository to your build file. Add it to your root build.gradle at the end of repositories inside the allprojects{ } section.

allprojects {
repositories {

maven { url “https://jitpack.io” }
}
}

I don't have a allprojects or repositories sections, so I just pasted
repositories {

maven { url “https://jitpack.io” }
}
I don't think it worked. In my pie chart xml, it says com.github.mikephil.charting.charts.PieChart was not found in projects or libraries.
I also tried the example at https://javapapers.com/android/android-chart-example-app-using-mpandroidchart/

This example makes no mention of repositories, but I get the same result.
<com.github.mikephil.charting.charts.PieChart is not found in projects or libraries.What am I doing wrong?Thanks
 
Technology news on Phys.org

Similar threads

  • · Replies 17 ·
Replies
17
Views
2K
Replies
3
Views
1K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 51 ·
2
Replies
51
Views
5K
  • · Replies 1 ·
Replies
1
Views
4K
Replies
5
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
Replies
29
Views
5K
  • Sticky
  • · Replies 13 ·
Replies
13
Views
8K
  • · Replies 3 ·
Replies
3
Views
1K