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.

RNPushNotification tried to override RNPushNotification

See original GitHub issue

Why this happen ?

`package com.awesomefyp;

import android.app.Application; import android.util.Log;

import com.facebook.react.PackageList; import com.facebook.hermes.reactexecutor.HermesExecutorFactory; import com.facebook.react.bridge.JavaScriptExecutorFactory; import com.facebook.react.ReactApplication; import com.dieam.reactnativepushnotification.ReactNativePushNotificationPackage;

import io.invertase.firebase.auth.RNFirebaseAuthPackage; import io.invertase.firebase.firestore.RNFirebaseFirestorePackage; import io.invertase.firebase.functions.RNFirebaseFunctionsPackage; //import io.invertase.firebase.messaging.RNFirebaseMessagingPackage;

import com.dieam.reactnativepushnotification.ReactNativePushNotificationPackage; import com.facebook.react.ReactNativeHost; import com.facebook.react.ReactPackage; import com.facebook.soloader.SoLoader;

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() {
        @SuppressWarnings("UnnecessaryLocalVariable")
        List<ReactPackage> packages = new PackageList(this).getPackages();
        // Packages that cannot be autolinked yet can be added manually here, for example:
        // packages.add(new MyReactNativePackage());
        packages.add(new RNFirebaseAuthPackage());
        packages.add(new RNFirebaseFirestorePackage());
        packages.add(new RNFirebaseFunctionsPackage());
        // packages.add(new RNFirebaseMessagingPackage());
        packages.add(new ReactNativePushNotificationPackage());
        return packages;
    }

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

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

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

} `

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9

github_iconTop GitHub Comments

31reactions
kaaoocommented, Dec 26, 2019

Hey, probably, autolinking is enough, so you can just remove this line: packages.add(new ReactNativePushNotificationPackage());

1reaction
Dallas62commented, Mar 18, 2021

Hi @sudhiryadav

Yes, it’s explained in the CHANGELOG.

Regards

Read more comments on GitHub >

github_iconTop Results From Across the Web

React Native: Native module AppStateModule tried to override ...
I found the issue. In MainApplication.java , new MainReactPackage(), was included two times. package com.opencampus; import android.app.
Read more >
native module reactnativepushnotification tried to override ...
native module reactnativepushnotification tried to override rnpushnotification. Add Answer | View In TPC Matrix. Technical Problem Cluster First Answered On ...
Read more >
react-native-push-notification - npm
React Native Local and Remote Notifications. Latest version: 8.1.1, last published: a year ago. Start using react-native-push-notification ...
Read more >
RNPushNotification.java example - Javatips.net
This class describes the usage of RNPushNotification.java. ... @Override public String getName() { return "RNPushNotification"; } @Override public ...
Read more >
Android Native Modules
Locate ReactNativeHost's getPackages() method and add your package to the packages list getPackages() returns: Java; Kotlin. @Override protected ...
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