MPAndroidChart
MPAndroidChart copied to clipboard
Getting this build error BarchartView must extend android.view.View
trafficstars
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
As of now I have added this inside app:build.gradle.kts
lint {
disable += "Instantiatable"
checkGeneratedSources = true
checkDependencies = true
}
I also encountered a similar problem. When I changed the original gradle script to kts