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.

error: package com.dieam.reactnativepushnotification does not exist

See original GitHub issue

I have been trying to use react-n-push-notification in my project;

react-native: 0.52 react-native-push-notification: 3.1.1

in android/buid.gradle

add to the bottom of the file

ext { googlePlayServicesVersion = "+" // default: "+" firebaseVersion = "+" // default: "+"

// Other settings
compileSdkVersion = 23 // default: `23`
buildToolsVersion = "23.0.1" // default: "23.0.1"
targetSdkVersion = 23 // default: 23
supportLibVersion = "23.1.1" // default: 23.1.1

}

added all the services in android manifest file, and import package in mainApplication.java like this

package com.pnotifirebase;

import android.app.Application;

import com.facebook.react.ReactApplication;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
import com.facebook.soloader.SoLoader;
import com.dieam.reactnativepushnotification.ReactNativePushNotificationPackage;  // <--- Import Package


import java.util.Arrays;
import java.util.List;

public class MainApplication extends Application implements ReactApplication {

  private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
    @Override
    public boolean getUseDeveloperSupport() {
      return BuildConfig.DEBUG;
    }

    @Override
    protected List<ReactPackage> getPackages() {
      return Arrays.<ReactPackage>asList(
          new MainReactPackage(),
          new ReactNativePushNotificationPackage() // <---- Add the Package
      );
    }

    @Override
    protected String getJSMainModuleName() {
      return "index";
    }
  };

  @Override
  public ReactNativeHost getReactNativeHost() {
    return mReactNativeHost;
  }

  @Override
  public void onCreate() {
    super.onCreate();
    SoLoader.init(this, /* native exopackage */ false);
  }
}

`

when i try react-native run-android it reported error:

C:\newApp\pNotiFireBase\android\app\src\main\java\com\pnotifirebase\MainApplication.java:10: error: package com.dieam.reactnativepushnotification does not exist
import com.dieam.reactnativepushnotification.ReactNativePushNotificationPackage;  // <--- Import Package
                                            ^
C:\newApp\pNotiFireBase\android\app\src\main\java\com\pnotifirebase\MainApplication.java:28: error: cannot find symbol
          new ReactNativePushNotificationPackage() // <---- Add the Package
              ^
  symbol: class ReactNativePushNotificationPackage
2 errors
:app:compileDebugJavaWithJavac FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get `more` log output.

Help me please!

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:14 (2 by maintainers)

github_iconTop GitHub Comments

47reactions
thomasdreyercommented, Sep 3, 2018

In android/app/gradle.build file make sure the following line exists, if not add it and try building your app again : implementation project(‘:react-native-push-notification’)

not sure if it will solve your issue, but it did mine.

4reactions
TOAO1commented, Oct 8, 2018

I just switch to react-native-firebase, that’s easier solution.

Read more comments on GitHub >

github_iconTop Results From Across the Web

I have a problem with installing react-native-push-notification
java:16: error: package com.dieam.reactnativepushnotification does not exist import com.dieam.reactnativepushnotification.
Read more >
react-native-push-notification - npm
Start using react-native-push-notification in your project by running ... the channel doesn't exist the notification might not be triggered.
Read more >
cannot find symbol viewmanagerresolver ... - You.com
A "Cannot find symbol" error means that the compiler cannot do this. Your code appears to be referring to something that the compiler...
Read more >
react-native-push-notification-full-screen-intent - npm - Snyk
An important project maintenance signal to consider for react-native-push-notification-full-screen-intent is that it hasn't seen any new versions released to ...
Read more >
Firebase Push notifications in React Native Apps - Enappd
HelloWorld”., don't use the default package name) ... <meta-data android:name="com.dieam.reactnativepushnotification.notification_channel_name".
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