My code:
public BarData getBarData(String fieldName) { ArrayList entries = new ArrayList<>(); entries.add(new BarEntry
Because you are using the latest version which includes major changes. Replace dependency version to this : implementation 'com.github.PhilJay:MPAndroidChart:v2.2.4'