简体   繁体   English

Firebase 异常“发现名称冲突的 getter:isChangingConfigurations”

[英]Firebase Exception “Found conflicting getters for name: isChangingConfigurations”

My app crashes on button click and log shows the Firebase Exception- "Found conflicting getters for name: isChangingConfigurations"我的应用程序在单击按钮时崩溃,并且日志显示 Firebase 异常-“发现名称冲突的 getter:isChangingConfigurations”

Here is the class..这是 class..

public class tt extends AsyncTask<Void,Void,Void>
{ Member member = new Member();
    DatabaseReference  reff = FirebaseDatabase.getInstance().getReference().child("Member");
    doit ok = new doit();
    @Override
    protected Void doInBackground(Void... voids) {
        member.go();

        ok.setAd_id(member.ad_id);
        ok.setPrice(member.price);
        ok.setUsername(member.username);
        Thread thread = new Thread(new Runnable() {
            @Override
            public void run() {        reff.push().setValue(ok);



            }
        });
        thread.run();
        return null;
    }

Here is the log....这是日志....

05-12 18:24:44.824 23423-24354/com.example.btc E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #2
    Process: com.example.btc, PID: 23423
    java.lang.RuntimeException: An error occured while executing doInBackground()
        at android.os.AsyncTask$3.done(AsyncTask.java:304)
        at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355)
        at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
        at java.lang.Thread.run(Thread.java:818)
     Caused by: com.google.firebase.database.DatabaseException: Found conflicting getters for name: isChangingConfigurations
        at com.google.firebase.database.core.utilities.encoding.CustomClassMapper$BeanMapper.<init>(com.google.firebase:firebase-database@@19.3.0:477)
        at com.google.firebase.database.core.utilities.encoding.CustomClassMapper.loadOrCreateBeanMapperForClass(com.google.firebase:firebase-database@@19.3.0:329)
        at com.google.firebase.database.core.utilities.encoding.CustomClassMapper.serialize(com.google.firebase:firebase-database@@19.3.0:166)
        at com.google.firebase.database.core.utilities.encoding.CustomClassMapper.convertToPlainJavaTypes(com.google.firebase:firebase-database@@19.3.0:60)
        at com.google.firebase.database.DatabaseReference.setValueInternal(com.google.firebase:firebase-database@@19.3.0:282)
        at com.google.firebase.database.DatabaseReference.setValue(com.google.firebase:firebase-database@@19.3.0:159)
        at com.example.btc.tt$1.run(tt.java:24)
        at java.lang.Thread.run(Thread.java:818)
        at com.example.btc.tt.doInBackground(tt.java:30)
        at com.example.btc.tt.doInBackground(tt.java:11)

Solved by using hash map....使用hash map解决...

public class tt extends AsyncTask<Void,Void,Void>
{ Member member = new Member();
    DatabaseReference  reff = FirebaseDatabase.getInstance().getReference().child("Member");
    doit ok = new doit();
    @Override
    protected Void doInBackground(Void... voids) {
        member.go();

        ok.setAd_id(member.ad_id);
        ok.setPrice(member.price);
        ok.setUsername(member.username);
        Thread thread = new Thread(new Runnable() {
            @Override
            public void run() {
                HashMap<String,String>
                        Student = new HashMap<>();
                Student.put("Ad_id",ok.Ad_id);
                Student.put("Price",ok.Price);
                Student.put("Username",ok.Username);
                reff.push().setValue(Student);



            }
        });
        thread.run();
        return null;
    }


}

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

相关问题 com.google.firebase.database.DatabaseException:发现名称冲突的吸气剂:isChangingConfigurations - com.google.firebase.database.DatabaseException: Found conflicting getters for name: isChangingConfigurations “com.google.firebase.database.DatabaseException:发现名称冲突的吸气剂:isChangingConfigurations”android - "com.google.firebase.database.DatabaseException: Found conflicting getters for name: isChangingConfigurations" android 发现名称冲突的吸气剂:数据库异常 - Found conflicting getters for name:Database Exception 发现名称冲突的吸气剂 - Found conflicting getters for name Firebase数据库错误:找到名称冲突的getter:isAccessibilityFocusable - Firebase database error : Found conflicting getters for name: isAccessibilityFocusable 发现名称的冲突吸气剂:getText - found conflicting getters for name: getText 发现名称冲突的吸气剂:isImportantForAccessibility - Found conflicting getters for name: isImportantForAccessibility 找到名称冲突的吸气剂:isFocusable - Found conflicting getters for name: isFocusable Firebase数据库与名称冲突的获取器:getAddress - Firebase database conflicting getters for name: getAddress com.google.firebase.database.DatabaseException:找到两个具有属性区分大小写的getter或字段 - com.google.firebase.database.DatabaseException: Found two getters or fields with conflicting case sensitivity for property: name
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM