question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

This package breaks android build with react-native 0.64.1 - FirebaseInstanceId seems to no longer be supported

See original GitHub issue

Bug

When I run yarn android I get this error:

C:\Users\____\github\rnfPushRepro\node_modules\react-native-push-notification\android\src\main\java\com\dieam\reactnativepushnotification\modules\RNPushNotification.java:39: error: cannot find symbol
import com.google.firebase.iid.FirebaseInstanceId;
symbol:   class FirebaseInstanceId
location: package com.google.firebase.iid

There are numerous of these errors.

It appears as though the issue is that FirebaseInstanceId has been deprecated

Environment info

System:
    OS: Windows 10 10.0.19041
    CPU: (16) x64 Intel(R) Core(TM) i7-10700 CPU @ 2.90GHz
    Memory: 35.20 GB / 63.74 GB
  Binaries:
    Node: 14.15.3 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.5 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
    npm: 6.14.9 - C:\Program Files\nodejs\npm.CMD
    Watchman: Not Found
  SDKs:
    Android SDK:
      API Levels: 23, 28, 29, 30
      Build Tools: 28.0.3, 29.0.2, 30.0.2
      System Images: android-29 | Google Play Intel x86 Atom, android-30 | Google APIs Intel x86 Atom, 
android-30 | Google Play Intel x86 Atom
      Android NDK: Not Found
    Windows SDK: Not Found
  IDEs:
    Android Studio: Version  4.1.0.0 AI-201.8743.12.41.6953283
    Visual Studio: Not Found
  Languages:
    Java: 15.0.1 - C:\Program Files\Common Files\Oracle\Java\javapath\javac.EXE
  npmPackages:
    @react-native-community/cli: Not Found
    react: 17.0.1 => 17.0.1
    react-native: 0.64.1 => 0.64.1
    react-native-windows: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Library version: 7.2.3

Steps To Reproduce

  1. npx react-native init MyApp
  2. cd MyApp
  3. yarn add react-native-push-notification
  4. yarn android

Reproducible sample code

example repro here: https://github.com/goleary/rnfPushRepro

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:16
  • Comments:10

github_iconTop GitHub Comments

21reactions
qasim483commented, May 11, 2021

In app build.gradle: implementation ‘com.google.firebase:firebase-messaging:21.1.0’

in android build.gradle: ext { firebaseMessagingVersion = “21.1.0” buildToolsVersion = “29.0.2” minSdkVersion = 24 compileSdkVersion = 29 targetSdkVersion = 29 }

this worked for me.
13reactions
golearycommented, May 11, 2021

All I had to do was update android/build.gradle to lock the version of firebase-messaging

ext {
        ...
        firebaseMessagingVersion = "21.1.0"
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

React native firebase - android not able to build - Stack Overflow
just add the following under android/build.gradle buildscript { ext { ..... firebaseMessagingVersion = "21.1.0" }.
Read more >
firebaseinstanceid not found android - You.com | The search ...
zo0r/react-native-push-notificationThis package breaks android build with react-native 0.64.1 - FirebaseInstanceId seems to no longer be supported#1981.
Read more >
react-native-svg - npm
react-native -svg provides SVG support to React Native on iOS, Android, macOS, Windows, and a compatibility layer for the web.
Read more >
Using Hermes in React Native - LogRocket Blog
Hermes support for Android has been active for a while. With the opt-in support for iOS in React Native 0.64, you can now...
Read more >
Installation | React Native Reanimated - Software Mansion
Reanimated 2 is primarily built in C++ using Turbo Modules infrastructure which is not yet completely deployed in React Native (specifically on Android)....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found