简体   繁体   中英

Found two getters or fields with conflicting case sensitivity for property: image

My logcat says that it "Found two getters or fields with conflicting case sensitivity for property : image". Am using firebase database and I have no child named "image" rather I have a child name "Image".

public class BlogCV {

public String Image;
public String Title;


public BlogCV() {
}

public BlogCV(String Image, String Title){
    this.Title = Title;
    this.Image = Image;
}

public String getImage() {
    return Image;
}

public String getTitle() {
    return Title;
}

}

Your class should look like this:

public class BlogCV {
    public String image, title;

    public BlogCV() {}

    public BlogCV(String image, String title){
        this.image = image;
        this.title = title;
    }

    public String getImage() {
        return image;
    }

    public String getTitle() {
        return title;
    }
}

Please see the fields which are now starting with lower cases.

When using other libraries, make sure you follow the Java naming conventions. You should use the name of variables in camelCase starting from lowercase letter.

Your question is not clear. But I believe it can be solved by using the name of the variable as images and title .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM