Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
gptshubham595 opened this issue May 27, 2024 · 1 comment
Open

Comments

@gptshubham595
Copy link

gptshubham595 commented May 27, 2024

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
Copy link
Author

gptshubham595 commented May 27, 2024

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant