Hello everyone, I recently moved from managed workflow to custom development client and EAS. Have finally got the app working, except for one issue I have been having since yesterday and can’t solve. I was using push notifications through expo, and followed the guide to setup for bare apps aswell, but I keep getting this error when trying to getExpoPushTokenAsync: Encountered an exception while calling native method: Exception occurred while executing exported method getDevicePushTokenAsync on module ExpoPushTokenManager: Default FirebaseApp is not initialized in this process com.x.x. Make sure to call FirebaseApp.initializeApp(Context) first. (ändrad)
I have the google-services.json file both in the root folder + android/app folder
The project is setup in firebase without restrictions to the api key
I have included "classpath ‘com.google.gms:google-services:4.1.0’ in the root level build.gradle and even “implementation(“com.google.firebase:firebase-iid”)” in the app level build.gradle
I have the same issue. Any ideas?
You may already have this, but, thinking of troubleshooting steps you did not mention already, you may want to confirm that you have
apply plugin: 'com.google.gms.google-services' at the bottom of your app/build.gradle file.
If that’s not an issue, I’d recommend comparing against a fresh project to see if there’s anything missing from your native setup.
- Create a new blank expo project
- change your Expo version if your main app using something other than SDK 46
expo install expo-notifications
- Add the google-services.json file reference to app.json
expo prebuild to generate the native files with the configuration needed for notifications.
You can then use this to compare with your bare workflow setup on your app to see if anything is missing. In particular, look at both build.gradle files, AndroidManifest.xml, MainActivity.java, and MainApplication.java.
Oh it’s been awhile to be honest, I remember that there was something with a wrong version installed for one of the packages. I had to rebuild the project with expo prebuild.
I actually did similar to what @keith-kurak suggested. I created a new project and debugged it through that.
I fixed this problem in my project by deleting the android folder and creating a new android build.
P.S. I’m using expo, so I don’t have direct access to the gradle configuration.