NativeScript / firebase

Modular Firebase 🔥 implementation for NativeScript. Supports both iOS & Android platforms for all Firebase services.
https://docs.nativescript.org/plugins/firebase-core.html
Apache License 2.0
52 stars 46 forks source link

[firebase-admob][android] App crashing on startup when using build command #97

Closed megha0071994 closed 1 year ago

megha0071994 commented 2 years ago

when I use tns run android to test the application locally, the app works fine. But when I build the application tns build android the application is crashing with the following exception on startup. image image

As we are using angular in our app we added Admob.init() in APP_INITIALIZER. import { Admob } from "@nativescript/firebase-admob";

export function initializeAdmob() { return (): Promise => { return Admob.init(); }; }

node version: 18.4.0 npm version: 8.1.4 ns version: 8.2.3 ns firebase version: 2.1.0

triniwiz commented 2 years ago

Can you try adding this to your webpack config

  webpack.chainWebpack((config) => {

    config.optimization.usedExports(false);
megha0071994 commented 2 years ago

Thank you very mush @triniwiz this seems to have fix the issue. The app is building successfully now. But could you please explain why this was happening and if this is a permanent solution can this be added to the documentation.