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

8

25

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 (android.support.v7.internal.widget.ActionBarView.HomeView)

Hydrogenolysis answered 2/4, 2014 at 19:43 Comment(5)
Are you using Proguard?Besiege
no. proguard is disabled.Hydrogenolysis
Hi.. i got same error. did you find any solutions?Flagon
hello. no luck :( intellij didn't give me this problem.Hydrogenolysis
Same problem here to and can't find a solutionPiecework
T
51

On the "v7-appcompat" library:

preferences -> Android Lint Preferences

Search for "Instantiatable" and set to Warning.

Teodora answered 6/7, 2014 at 11:34 Comment(0)
S
13

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.

Spoils answered 28/6, 2014 at 23:3 Comment(1)
Yes!! This is the easiest solution for me. Thank youClot
A
8

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.

Agamemnon answered 14/10, 2014 at 17:46 Comment(0)
C
3

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.

Clem answered 21/4, 2014 at 20:18 Comment(0)
C
3

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

lintOptions {
    abortOnError false
    disable "Instantiatable"
}
Counterbalance answered 1/6, 2016 at 12:42 Comment(0)
W
2

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.

Woodhouse answered 1/5, 2014 at 2:37 Comment(2)
I am using minSdkVersion 11 and still it happensLug
this answer helped me solve my problem. for me, Increasing the minimum sdk to 14 solved the problemLudhiana
I
1

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!

Igraine answered 6/9, 2014 at 5:42 Comment(0)
M
1

I know this question is pretty old. However, would like to add in the updated answer to resolve this issue.

android {
    .
    .
    .
    lintOptions {
        warning("Instantiatable")
    }
}

Add the above lines to your gradle file. Basically what this does is, it tells the linter to treat Instantiatable rule as a warning and not error.

Mononucleosis answered 17/8, 2021 at 6:13 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.