Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Herschel Greenspan
890 PointsThis is my error message. How do i fix it?
Error:(1572, 33) error: variable idName is already defined in class id Note: C:\Users\Hershey\AndroidStudioProjects\MyFunFacts\app\src\main\java\com\example\hershey\myfunfacts\MyFunFacts.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. Error:Execution failed for task ':app:compileDebugJava'. > Compilation failed; see the compiler error output for details.
1 Answer
Jon Baum
13,863 PointsI'm not sure of the context exactly but is sounds like you're redeclaring the variable idName (line 33?) somewhere in your class id. Essentially:
class id {
private String idName;
\\...Some awesome code here
\\Line 32
(somewhere in this line) String idName (or another version).
}
Sorry without the code itself its hard to exactly point out where the error is but use the line numbers at the beginning of the error it shows you. They can be really useful sometimes, other times not so much. Hope this helps.