Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error at app launch: Error: Ensure @aws-amplify/rtn-push-notification is installed and linked. #13818

Closed
3 tasks done
huynguyencong opened this issue Sep 17, 2024 · 2 comments
Closed
3 tasks done
Assignees
Labels
pending-maintainer-response Issue is pending a response from the Amplify team. Push Notifications Related to Push Notification components question General question React Native React Native related issue

Comments

@huynguyencong
Copy link

Before opening, please confirm:

JavaScript Framework

React Native

Amplify APIs

Push Notifications

Amplify Version

v6

Amplify Categories

notifications

Backend

None

Environment information

# Put output below this line
  System:
    OS: macOS 14.4.1
    CPU: (8) arm64 Apple M1 Pro
    Memory: 279.31 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.11.1 - /usr/local/bin/node
    npm: 9.8.0 - /usr/local/bin/npm
  Browsers:
    Chrome: 128.0.6613.138
    Safari: 17.4.1
  npmPackages:
    @aws-amplify/react-native: ^1.1.5 => 1.1.5 
    @aws-amplify/rtn-push-notification: ~1.1.x => 1.1.14 
    @babel/core: ^7.20.0 => 7.25.2 
    @babel/preset-env: ^7.20.0 => 7.25.4 
    @babel/runtime: ^7.20.0 => 7.25.6 
    @commitlint/cli: ^17.6.5 => 17.8.1 
    @commitlint/config-conventional: ^17.6.5 => 17.8.1 
    @faker-js/faker: ^8.0.2 => 8.4.1 
    @react-native-async-storage/async-storage: ^1.24.0 => 1.24.0 
    @react-native-community/eslint-config: ^3.2.0 => 3.2.0 
    @react-native-community/push-notification-ios: ^1.11.0 => 1.11.0 
    @react-native-community/slider: ^4.4.2 => 4.5.3 
    @react-native-firebase/app: ^18.0.0 => 18.9.0 
    @react-native-firebase/crashlytics: ^18.0.0 => 18.9.0 
    @react-native-picker/picker: ^2.4.10 => 2.8.0 
    @reduxjs/toolkit: ^1.9.5 => 1.9.7 
    @reduxjs/toolkit-query:  1.0.0 
    @reduxjs/toolkit-query-react:  1.0.0 
    @testing-library/jest-native: 5.4.2 => 5.4.2 
    @testing-library/react-native: ^12.1.2 => 12.7.2 
    @types/faker: ^6.6.9 => 6.6.9 
    @types/graphql: ^14.5.0 => 14.5.0 
    @types/jest: ^29.5.0 => 29.5.13 
    @types/lodash: ^4.14.195 => 4.17.7 
    @types/matomo-tracker-react-native: ^0.3.1 => 0.3.5 
    @types/node: ^20.3.1 => 20.16.5 (20.5.1)
    @types/react: ^18.2.14 => 18.3.7 
    @types/react-native: ^0.71.2 => 0.71.13 
    @types/react-native-calendars: ^1.1264.3 => 1.1264.7 
    @types/react-native-dialog: ^8.0.0 => 8.0.0 
    @types/react-native-uuid: ^2.0.0 => 2.0.0 
    @types/react-redux: ^7.1.25 => 7.1.33 
    @types/react-test-renderer: 18.0.0 => 18.0.0 
    @types/rosie: 0.0.42 => 0.0.42 
    @types/sanitize-html: ^2.9.0 => 2.13.0 
    @types/url-join: ^4.0.1 => 4.0.3 
    @types/uuid: ^9.0.2 => 9.0.8 
    @typescript-eslint/eslint-plugin: ^5.60.0 => 5.62.0 
    @typescript-eslint/parser: ^5.60.0 => 5.62.0 
    HelloWorld:  0.0.1 
    aws-amplify: ^6.6.1 => 6.6.1 
    aws-amplify/adapter-core:  undefined ()
    aws-amplify/analytics:  undefined ()
    aws-amplify/analytics/kinesis:  undefined ()
    aws-amplify/analytics/kinesis-firehose:  undefined ()
    aws-amplify/analytics/personalize:  undefined ()
    aws-amplify/analytics/pinpoint:  undefined ()
    aws-amplify/api:  undefined ()
    aws-amplify/api/server:  undefined ()
    aws-amplify/auth:  undefined ()
    aws-amplify/auth/cognito:  undefined ()
    aws-amplify/auth/cognito/server:  undefined ()
    aws-amplify/auth/enable-oauth-listener:  undefined ()
    aws-amplify/auth/server:  undefined ()
    aws-amplify/data:  undefined ()
    aws-amplify/data/server:  undefined ()
    aws-amplify/datastore:  undefined ()
    aws-amplify/in-app-messaging:  undefined ()
    aws-amplify/in-app-messaging/pinpoint:  undefined ()
    aws-amplify/push-notifications:  undefined ()
    aws-amplify/push-notifications/pinpoint:  undefined ()
    aws-amplify/storage:  undefined ()
    aws-amplify/storage/s3:  undefined ()
    aws-amplify/storage/s3/server:  undefined ()
    aws-amplify/storage/server:  undefined ()
    aws-amplify/utils:  undefined ()
    axios: ^1.4.0 => 1.7.7 
    axios-mock-adapter: ^1.21.5 => 1.22.0 
    babel-core: ^7.0.0-bridge.0 => 7.0.0-bridge.0 
    babel-jest: ^29.2.1 => 29.7.0 
    conventional-changelog: ^4.0.0 => 4.0.0 
    conventional-changelog-cli: ^3.0.0 => 3.0.0 
    dayjs: ^1.11.8 => 1.11.13 
    eslint: ^8.43.0 => 8.57.1 
    eslint-import-resolver-typescript: ^3.5.5 => 3.6.3 
    eslint-plugin-flowtype: ^8.0.3 => 8.0.3 
    eslint-plugin-import: ^2.27.5 => 2.30.0 
    fast-xml-parser: ^4.2.4 => 4.5.0 (4.4.1)
    husky: ^8.0.3 => 8.0.3 
    i18next: ^23.2.1 => 23.15.1 
    jest: ^29.5.0 => 29.7.0 
    jest-jasmine2: ^29.6.1 => 29.7.0 
    jetifier: ^2.0.0 => 2.0.0 
    lint-staged: ^13.2.2 => 13.3.0 
    lodash: ^4.17.21 => 4.17.21 
    lottie-react-native: ^5.1.6 => 5.1.6 
    matomo-tracker-react-native: ^0.3.1 => 0.3.2 
    metro-react-native-babel-preset: 0.73.10 => 0.73.10 
    prettier: ^2.8.8 => 2.8.8 
    pretty-quick: ^3.1.3 => 3.3.1 
    react: 18.2.0 => 18.2.0 
    react-dom: ^18.2.0 => 18.3.1 
    react-i18next: ^13.0.0 => 13.5.0 
    react-native: 0.71.11 => 0.71.11 
    react-native-calendars: ^1.1298.0 => 1.1306.0 
    react-native-collapsible: ^1.6.1 => 1.6.2 
    react-native-config: 1.3.3 => 1.3.3 
    react-native-dialog: ^9.2.0 => 9.3.0 
    react-native-fast-image: ^8.5.11 => 8.6.3 
    react-native-get-random-values: ^1.11.0 => 1.11.0 
    react-native-image-pan-zoom: ^2.1.12 => 2.1.12 
    react-native-linear-gradient: ^2.5.6 => 2.8.3 
    react-native-navigation: ^7.40.1 => 7.40.1 
    react-native-pager-view: ^5.0.11 => 5.4.25 
    react-native-render-html: ^6.3.3 => 6.3.4 
    react-native-section-list-get-item-layout: ^2.2.3 => 2.2.3 
    react-native-splash-screen: ^3.2.0 => 3.3.0 
    react-native-svg: ^12.1.0 => 12.5.1 
    react-native-svg-transformer: ^1.0.0 => 1.5.0 
    react-native-swift: ^1.2.1 => 1.2.3 
    react-native-toast-notifications: ^3.4.0 => 3.4.0 
    react-native-track-player: ^4.1.1 => 4.1.1 
    react-redux: ^8.1.1 => 8.1.3 
    react-test-renderer: 18.2.0 => 18.2.0 
    redux: ^4.2.1 => 4.2.1 
    redux-devtools-extension: ^2.13.9 => 2.13.9 
    redux-persist: ^6.0.0 => 6.0.0 
    redux-persist/integration/react:  undefined ()
    redux-thunk: ^2.4.2 => 2.4.2 
    rosie: ^2.1.0 => 2.1.1 
    sanitize-html: ^2.10.0 => 2.13.0 
    styled-components: ^6.0.2 => 6.1.13 
    styled-components/native:  undefined ()
    typescript: ^5.1.6 => 5.6.2 
    url-join: ^5.0.0 => 5.0.0 
    usabilla-react-native: ^1.0.1 => 1.0.6 
  npmGlobalPackages:
    @aws-amplify/cli: 12.12.6
    firebase-tools: 13.17.0
    n: 9.2.0
    npm: 9.8.0

Describe the bug

I am migrating from V5 to V6. I got this error at the app launch, when calling initializePushNotifications() function:

 ERROR  Error: Ensure `@aws-amplify/rtn-push-notification` is installed and linked.

Expected behavior

The app should launch without any errors.

Reproduction steps

  1. The app is using Amplify V5.
  2. Migrate to Amplify V6.
  3. Run the app and got that error.

Code Snippet

import { initNavigationWithSplash } from 'src/navigation/initNavigation';
import registerScreens from 'src/navigation/registerScreens';
import { Navigation } from 'react-native-navigation';
import { Amplify, Auth } from 'aws-amplify';
import amplifyconfig from './src/amplifyconfiguration.json';
import { initializePushNotifications } from 'aws-amplify/push-notifications';

Amplify.configure(amplifyconfig);
console.log('Init PN');
initializePushNotifications();
console.log('Finish init PN');

registerScreens();
Navigation.events().registerAppLaunchedListener(async () => {
 initNavigationWithSplash();
});

Log output

// Put your logs below this line


aws-exports.js

No response

Manual configuration

No response

Additional configuration

No response

Mobile Device

No response

Mobile Operating System

No response

Mobile Browser

No response

Mobile Browser Version

No response

Additional information and screenshots

No response

@github-actions github-actions bot added pending-triage Issue is pending triage pending-maintainer-response Issue is pending a response from the Amplify team. labels Sep 17, 2024
@huynguyencong huynguyencong changed the title I got this error at app launch: Error: Ensure @aws-amplify/rtn-push-notification is installed and linked. Error at app launch: Error: Ensure @aws-amplify/rtn-push-notification is installed and linked. Sep 17, 2024
@cwomack cwomack self-assigned this Sep 17, 2024
@cwomack cwomack added Push Notifications Related to Push Notification components React Native React Native related issue labels Sep 17, 2024
@cwomack
Copy link
Member

cwomack commented Sep 18, 2024

Hello, @huynguyencong 👋 and sorry to hear you're running into this. Can you see if deleting your node_modules folder and package-lock.json file (or yarn.lock file if you have it), and then reinstalling dependencies with npm install resolves the issue?

@cwomack cwomack added question General question pending-community-response Issue is pending a response from the author or community. and removed pending-triage Issue is pending triage labels Sep 18, 2024
@github-actions github-actions bot removed the pending-maintainer-response Issue is pending a response from the Amplify team. label Sep 18, 2024
@huynguyencong
Copy link
Author

I did those steps but it didn't work. But, then, it worked after I restarted my laptop. Let me close the issue. Thank you!

@github-actions github-actions bot added pending-maintainer-response Issue is pending a response from the Amplify team. and removed pending-community-response Issue is pending a response from the author or community. labels Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pending-maintainer-response Issue is pending a response from the Amplify team. Push Notifications Related to Push Notification components question General question React Native React Native related issue
Projects
None yet
Development

No branches or pull requests

2 participants