Closed ClemPalf closed 1 week ago
Hi @ClemPalf, thank you for submitting this issue. We will take a look at this issue and get back to you with any updates.
@ClemPalf try building using the version of com.google.gms:google-services
that is used in the package's example app, here.
It worked, thanks.
@khatruong2009 maybe worth still exploring why this error occurs with the latest com.google.gms:google-services
, no? At the least, updating the docs to include the necessary latest compatible version.
Hi @derrik-fleming, thank you for mentioning this temporary fix for this issue. We'll look into this issue and update the docs in the mean time. Thank you.
Description
Hi,
I am having trouble setting up push-notifications for android. I would suspect that the extra step I add to take (in addition to your documentation) to add the com.google.gms.google-services plugin is what is causing the error.
Regards,
Categories
Steps to Reproduce
I first encountered an issue at this stage :
Simply adding the line
apply plugin: 'com.google.gms.google-services'
to my app/build.gradle created the following error :I finally managed to compile the app by : 1) Adding this code snippet to my android/build.gradle file :
2) Adding the google-services.json file provided by firebase in my android/app folder.
However, I now get the following runtime error when running Amplify.configure(amplifyconfig):
E/flutter ( 5262): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PushNotificationException { E/flutter ( 5262): "message": "Error occurred awaiting for device token.", E/flutter ( 5262): "recoverySuggestion": "Review the underlying exception.", E/flutter ( 5262): "underlyingException": "PlatformException(java.lang.IllegalStateException: Default FirebaseApp is not initialized in this process com.morp.morp_alpha. Make sure to call FirebaseApp.initializeApp(Context) first., IllegalStateException, Cause: null, Stacktrace: java.lang.IllegalStateException: Default FirebaseApp is not initialized in this process com.morphit.morphit_alpha. Make sure to call FirebaseApp.initializeApp(Context) first.\n\tat com.google.firebase.FirebaseApp.getInstance(FirebaseApp.java:179)\n\tat com.google.firebase.messaging.FirebaseMessaging.getInstance(FirebaseMessaging.java:137)
Screenshots
No response
Platforms
Flutter Version
3.22.2
Amplify Flutter Version
2.2.0
Deployment Method
AWS CDK
Schema
No response