1
votes

I am trying to send data using firebase, but it says that DynamiteModule: Local module descriptor class for com.google.firebase.auth not found. Here's my code. I checked but my problem doesn't resemble any other problems.

 protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Firebase.setAndroidContext(this);
    setContentView(R.layout.activity_main);
    Toast.makeText(this, "heee", Toast.LENGTH_SHORT).show();

    firebaseAuth = FirebaseAuth.getInstance();

    buttonSave = (Button) findViewById(R.id.button);
    editTextName = (EditText) findViewById(R.id.editTextName);
    //editTextAddress = (EditText) findViewById(R.id.editTextAddress);

    textViewPersons = (TextView) findViewById(R.id.textViewPersons);

    firebaseAuth.getCurrentUser();


    buttonSave.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            //Creating firebase object
            Firebase ref = new Firebase(Config.FIREBASE_URL);

            //Getting values to store
            String name = editTextName.getText().toString().trim();
           // String address = editTextAddress.getText().toString().trim();

            //Creating Person object
            Person person = new Person();

            //Adding values
            person.setName(name);
            //person.setAddress(address);

            //Storing values to firebase
            ref.child("Person").setValue(person);
        }
    });
}

I am stuck, please help!!

2
please check rules tab in firebase console of your application database ' - Vishal Patoliya ツ
and put it here - Vishal Patoliya ツ
You have taken firebaseauth, you need to take ref. like Firebase myFirebaseRef = new Firebase(URL); - Vickyexpert
you got my point ? - Vishal Patoliya ツ
Not a good idea to mix legacy Firebase SDK 2.5.X, Firebase.setAndroidContext(), with new SDK 9.X.X, FirebaseAuth.getInstance(). Change to use new SDK only. - Bob Snyder

2 Answers

1
votes

Check "rules" in your firebase's console and then in database. And change it to this: {

"rules": {

".read": true,

".write":true

}

} It should solve the problem.

0
votes

Check your Google Play Services version - it will most likely be lower than the requirements (this recently caught me out when switching to the new API).

See also: Android Firebase DynamiteModule: Failed to load module descriptor