![\node_modules\react-native-push-notification\android\src\main\java\com\dieam\reactnativepushnotification\modules\RNPushNotification.java:40: error: cannot find symbol
import com.google.firebase.iid.InstanceIdResult
![\node_modules\react-native-push-notification\android\src\main\java\com\dieam\reactnativepushnotification\modules\RNPushNotification.java:40: error: cannot find symbol
import com.google.firebase.iid.InstanceIdResult
There is some issue at 7.2.* version. Try moving to the latest version or any 7.3.* version.
npm i react-native-push-notification@latest
I faced this issue yesterday. And I fixed it by using the following steps.
First I uninstalled it.
npm uninstall react-native-push-notification
Then I installed it back in. (Maybe you can just update it to the latest version as well. I just didn't know the npm command line for that)
npm install react-native-push-notification
In android/app/build.gradle, add the following code in defaultConfig :
dexOptions {
javaMaxHeapSize "4g"
}
Also add: implementation 'com.google.firebase:firebase-messaging:21.1.0'
In android/gradle.properties, add the following code:
firebaseMessagingVersion=21.1.0
Delete node_module. (Perhaps, you don't need to do this.)
Finally, run npm install. You might have to run yarn install and rebuild your project again with Android Studio as well.
You probably don't need to follow every step in here. But these are what I did yesterday. I hope this helps.
Follow the steps.
npm i react-native-push-notification@latest
android/build.gradle
buildscript {
ext {
// ...
firebaseMessagingVersion = '21.1.0'
}
}
These steps are worked for me.
Your question is posted to the official repository issue: https://github.com/zo0r/react-native-push-notification/issues/1979
if you are looking for the answer go to the comment: https://github.com/zo0r/react-native-push-notification/issues/1979#issuecomment-839224339
It worked for me.
try with updating the npm package.
"react-native-push-notification": "^7.3.0"by cleaning the cache also
cd android && ./gradlew cleanI update these tow files:
package.json :"react-native-push-notification": "^7.2.2" to "react-native-push-notification": "^7.3.0"
android\app\build.gradle :implementation 'com.google.firebase:firebase-analytics:17.3.0' to implementation 'com.google.firebase:firebase-analytics:19.0.0'
and its worked!