I am using Firebase Real-time Database to React Native, I have imported Firebase like
import firebase from 'firebase';
var configure Firebase= {
apiKey: "FULL_API_KEY_PUT_HERE",
authDomain: "FULL_AUTHDOMAIN_PUT_HERE",
databaseURL: "https://FULL_databaseURL_PUT_HERE.com",
storageBucket: "FULL_storageBucket_PUT_HEREappspot.com",
};
const fireabaseConfig=firebase.initializeApp(configure Firebase);
export default class HomeScreen extends Component {
//.............Remain Business Logic here...............
}
after this snippet when I run the code it works fine first time but after some time it gives me the error
firebase app named '[default]' already exists (app/duplicate-app)
- 5 years ago
Firebase App named '[DEFAULT]' already exists (app/duplicate-app)
This error occurs when you trying to initialize firebase again and again. It should be initialized at once and use to avoid Firebase app named '[DEFAULT]' already exists you have to change your initialization style.
Hot Questions