This class should be public (android.support.v7.internal.widget.ActionBarView.HomeView)

前端 未结 7 1145
予麋鹿
予麋鹿 2020-12-29 04:11

I am trying to create a Android Application which uses 3 spinners. I keep getting this error and I can\'t figure out how to fix it. This class should be public (and

相关标签:
7条回答
  • 2020-12-29 04:41

    I found a solution, in the project.properties file, just replace the line saying

    android.library.reference.1=../appcompat_v7_3 
    

    with

    android.library.reference.1=../appcompat_v7
    

    That solved the problem to me at least.

    0 讨论(0)
  • 2020-12-29 04:46

    Eclipse inside the setup issues. Windows -> Preferences -> Android -> Lint Error Checking -> Enter "Instantiatable" Inside the Issues -> select the Search Content -> lower right corner Severity election warning -> OK!

    0 讨论(0)
  • 2020-12-29 04:49

    You can also do this manually in the build.gradle file:

    lintOptions {
        abortOnError false
        disable "Instantiatable"
    }
    
    0 讨论(0)
  • 2020-12-29 04:51

    This is not a true solution, but maybe help.

    Create project with higher API level then 8.

    Whenever I select minimum Required SDK to API level 9 instead 8 this error does not happen.

    Observation: My last answer was deleted, maybe the moderator think it was barely more than a link to an external site, for this reason I don't posted the link again.

    0 讨论(0)
  • 2020-12-29 04:52

    Go to appcompat_v7 library -> Properties -> Android Lint Preferences -> Instantiatable -> Select "Warning" severity.

    enter image description here

    Android Lint Checks

    Instantiatable Summary: Ensures that classes registered in the manifest file are instantiatable

    Priority: 6 / 10 Severity: Warning Category: Correctness

    Activities, services, broadcast receivers etc. registered in the manifest file must be "instiantable" 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.

    0 讨论(0)
  • 2020-12-29 04:55

    If you are using Eclipse:

    Project > Clean > OK
    

    Or Try:

    Preferences -> Android Lint Preferences
    

    Search for Instantiatable and set as Warning.

    http://developer.android.com/tools/debugging/improving-w-lint.html

    This worked for me.

    0 讨论(0)
提交回复
热议问题