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

Getting this build error BarchartView must extend android.view.View #5457

Open gptshubham595 opened 3 months ago

gptshubham595 commented 3 months ago

Getting this issue must extend android.view.View

class BatteryChargingBarChartView : BarChart {
 //work here
}

public class BarChart extends BarLineChartBase<BarData> implements BarDataProvider {}

public abstract class BarLineChartBase<T extends BarLineScatterCandleBubbleData<? extends
        IBarLineScatterCandleBubbleDataSet<? extends Entry>>>
        extends Chart<T> implements BarLineScatterCandleBubbleDataProvider {}

 public abstract class Chart<T extends ChartData<? extends IDataSet<? extends Entry>>> extends
        ViewGroup
        implements ChartInterface {}      
Error: BatteryChargingBarChartView must extend android.view.View [Instantiatable]
                    <com.views.common.BatteryChargingBarChartView
                    ^

   Explanation for issues of type "Instantiatable":
   Activities, services, broadcast receivers etc. registered in the manifest
   file (or for custom views, in a layout file) must be "instantiatable" by
   the system, which means that the class must be public, it must have an
   empty public constructor, and if it's an inner class, it must be a static
   inner class.

   If you use a custom AppComponentFactory to instantiate app components
   yourself, consider disabling this Lint issue in order to avoid false
   positives.

Android Jellyfish Java 17 kotlin 2.0

gptshubham595 commented 3 months ago

As of now I have added this inside app:build.gradle.kts

lint {
        disable += "Instantiatable"
        checkGeneratedSources = true
        checkDependencies = true
    }