简体   繁体   English

发现两个吸气剂或字段的属性区分大小写冲突:image

[英]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". 我的logcat说它“发现两个具有属性区分大小写的getter或字段:image”。 Am using firebase database and I have no child named "image" rather I have a child name "Image". 我正在使用Firebase数据库,但是我没有名为“ image”的子级,而是有一个名为“ 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. 使用其他库时,请确保遵循Java命名约定。 You should use the name of variables in camelCase starting from lowercase letter. 您应在camelCase使用小写字母开头的变量名称。

Your question is not clear. 您的问题不清楚。 But I believe it can be solved by using the name of the variable as images and title . 但是我相信可以通过使用变量的名称作为imagestitle来解决。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 发现两个 getter 或字段的属性区分大小写冲突 - Found two getters or fields with conflicting case sensitivity for property 发现两个 getter 或属性的区分大小写冲突的字段:状态 - Found two getters or fields with conflicting case sensitivity for property: status com.google.firebase.database.DatabaseException:找到两个具有属性区分大小写的getter或字段 - com.google.firebase.database.DatabaseException: Found two getters or fields with conflicting case sensitivity for property: name 发现两个 getter 或属性的区分大小写冲突的字段: s 但是,我没有类的“s”属性,也没有 Firebase - Found two getters or fields with conflicting case sensitivity for property: s however, I don't have an "s" property of the classes nor Firebase 构建为发行版APK后出现错误,但调试APK则没有错误-错误:发现两个吸气剂或区分大小写的字段 - Error after building as release APK but no error with debug APK - Error: Found two getters or fields with conflicting case sensitivity R8 混淆导致 @PropertyName 无法工作导致 DatabaseException:找到两个有冲突的 getter 或字段 - R8 obfuscation results in @PropertyName not working causing DatabaseException: Found two getters or fields with conflicting 发现名称冲突的吸气剂 - Found conflicting getters for name 发现名称冲突的吸气剂:isImportantForAccessibility - Found conflicting getters for name: isImportantForAccessibility 找到名称冲突的吸气剂:isFocusable - Found conflicting getters for name: isFocusable 发现名称的冲突吸气剂:getText - found conflicting getters for name: getText
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM