error: package com.dieam.reactnativepushnotification does not exist
See original GitHub issueI 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:
- Created 5 years ago
- Comments:14 (2 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.
I just switch to react-native-firebase, that’s easier solution.