Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
megha0071994 opened this issue Jul 11, 2022 · 2 comments

Comments

@megha0071994
Copy link

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
Copy link
Member

Can you try adding this to your webpack config

  webpack.chainWebpack((config) => {

    config.optimization.usedExports(false);

@megha0071994
Copy link
Author

megha0071994 commented Jul 11, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants