React-native-notifications: package com.wix.reactnativenotifications does not exist

Created on 24 Jan 2020  路  4Comments  路  Source: wix/react-native-notifications

When I tried to run the app, I got the following error message.
package com.wix.reactnativenotifications does not exist

Versions Used:
react-native-notifications: 3.1.1
react-native: 0.61.2

Most helpful comment

I fixed it by making the following changes.

  1. I added the following line to Project/app/build.gradle
    implementation project(':react-native-notifications')

  2. I ignored the instructions to add the following line to MainApplication.java
    new RNNotificationsPackage(MainApplication.this)

  3. Instead of the line (above), I added the line (below) to MainApplication.java

    protected List<ReactPackage> getPackages() {
      @SuppressWarnings("UnnecessaryLocalVariable")
      List<ReactPackage> packages = new PackageList(this).getPackages();
       // ...
       // Add this line:
       packages.add(new RNNotificationsPackage(MainApplication.this)); 
      return packages;
   }

All 4 comments

I fixed it by making the following changes.

  1. I added the following line to Project/app/build.gradle
    implementation project(':react-native-notifications')

  2. I ignored the instructions to add the following line to MainApplication.java
    new RNNotificationsPackage(MainApplication.this)

  3. Instead of the line (above), I added the line (below) to MainApplication.java

    protected List<ReactPackage> getPackages() {
      @SuppressWarnings("UnnecessaryLocalVariable")
      List<ReactPackage> packages = new PackageList(this).getPackages();
       // ...
       // Add this line:
       packages.add(new RNNotificationsPackage(MainApplication.this)); 
      return packages;
   }

Hi,

I get the same error:
package com.wix.reactnativenotifications does not exist

package.json:

    "react": "16.9.0",
    "react-native": "0.61.5",
    "react-native-notifications": "^3.1.2"

When I add the following line to android/app/build.gradle:
implementation project(':react-native-notifications')

I get this error message:
Project with path ':react-native-notifications' could not be found in project ':app'.

@whitestonedata you should add this inside android/settings.gradle

include ':react-native-notifications'
project(':react-native-notifications').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-notifications/lib/android/app')

I ran into the same issue, because I was a bit confused by the documentation. https://wix.github.io/react-native-notifications/docs/installation-android

I use https://invertase.io/oss/react-native-firebase/v6/messaging/quick-start for receiving FCM events. And WIX documentation states the following:

Note: This section is only necessary in case you wish to be able to receive push notifications in your React-Native app.

Because i use react-native-firebase for that I skipped that in the installation process and I got the same error message. The text makes it seem as if this is an optional part of the installation process which it isn't?

Maybe some clarification in the docs would help here. Or am I missing the point completely?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

veedeo picture veedeo  路  6Comments

WhereBeTheDan picture WhereBeTheDan  路  5Comments

fosteruk picture fosteruk  路  5Comments

daominhsangvn picture daominhsangvn  路  6Comments

beulahpt picture beulahpt  路  5Comments