React Native - checkDebugDuplicateClasses error on Android
See original GitHub issueBefore opening, please confirm:
- I have searched for duplicate or closed issues and discussions.
- I have read the guide for submitting bug reports.
- I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
JavaScript Framework
React Native
Amplify APIs
Analytics, Push Notifications
Amplify Categories
analytics, notifications
Environment information
# Put output below this line
System:
OS: macOS 11.3.1
CPU: (6) x64 Intel(R) Core(TM) i5-8500B CPU @ 3.00GHz
Memory: 50.54 MB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 15.0.1 - /usr/local/bin/node
Yarn: 1.22.10 - /usr/local/bin/yarn
npm: 7.0.3 - /usr/local/bin/npm
Browsers:
Chrome: 90.0.4430.212
Safari: 14.1
npmPackages:
@aws-amplify/core: ^3.4.2 => 3.8.24 (4.0.3)
@aws-amplify/pushnotification: ^4.0.3 => 4.0.3
@babel/core: ^7.9.6 => 7.14.3
@babel/preset-env: ^7.11.0 => 7.14.4
@babel/runtime: ^7.9.2 => 7.14.0
@nartc/react-native-barcode-mask: ^1.2.0 => 1.2.0
@react-native-async-storage/async-storage: ^1.15.5 => 1.15.5
@react-native-community/async-storage: ^1.12.1 => 1.12.1
@react-native-community/checkbox: ^0.5.5 => 0.5.8
@react-native-community/eslint-config: ^1.1.0 => 1.1.0
@react-native-community/masked-view: ^0.1.10 => 0.1.11
@react-native-community/netinfo: ^5.9.5 => 5.9.10
@react-native-community/push-notification-ios: ^1.5.0 => 1.8.0 (1.0.3)
@react-native-community/toolbar-android: ^0.1.0-rc.2 => 0.1.0-rc.2
@react-navigation/bottom-tabs: ^5.5.2 => 5.11.11
@react-navigation/native: ^5.1.7 => 5.9.4
@react-navigation/stack: ^5.2.14 => 5.14.5
@sentry/react-native: ^2.3.0 => 2.4.3
HelloWorld: 0.0.1
amazon-cognito-identity-js: ^4.3.3 => 4.6.3
aws-amplify: ^3.3.2 => 3.4.3
aws-amplify-react-native: ^4.2.1 => 4.3.3
axios: ^0.20.0 => 0.20.0 (0.21.1)
babel-eslint: ^10.1.0 => 10.1.0
babel-jest: ^25.5.1 => 25.5.1
babel-plugin-transform-remove-console: ^6.9.4 => 6.9.4
eslint: ^6.8.0 => 6.8.0
eslint-plugin-react: ^7.19.0 => 7.24.0 (7.19.0)
eslint-plugin-react-native: ^3.8.1 => 3.11.0 (3.8.1)
hermes-inspector-msggen: 1.0.0
husky: ^0.13.4 => 0.13.4
jest: ^25.5.4 => 25.5.4
lodash: ^4.17.20 => 4.17.21
metro-react-native-babel-preset: ^0.59.0 => 0.59.0
moment: ^2.29.1 => 2.29.1
native-base: ^2.13.12 => 2.15.2
react: 16.11.0 => 16.11.0
react-animated: 0.1.0
react-native: ^0.63.2 => 0.63.4
react-native-app-intro-slider: ^4.0.4 => 4.0.4
react-native-autocomplete-input: ^4.1.0 => 4.2.0
react-native-camera: ^3.23.1 => 3.44.0
react-native-circle-slider: ^2.7.0 => 2.9.0
react-native-collapsible: ^1.6.0 => 1.6.0
react-native-date-picker: ^3.2.3 => 3.3.1
react-native-dialog-input: ^1.0.8 => 1.0.8
react-native-dropdown-picker: ^3.0.4 => 3.8.3
react-native-elements: ^2.0.2 => 2.3.2
react-native-geolocation-service: ^5.0.0 => 5.2.0
react-native-gesture-handler: ^1.9.0 => 1.10.3
react-native-image-base64: ^0.1.4 => 0.1.4
react-native-image-resizer: ^1.4.2 => 1.4.4
react-native-interactable: ^2.0.1 => 2.0.1
react-native-keychain: ^6.0.0 => 6.2.0
react-native-languages: ^3.0.2 => 3.0.2
react-native-localization: ^2.1.6 => 2.1.7
react-native-localize: ^1.4.0 => 1.4.3
react-native-modal: ^11.5.6 => 11.10.0
react-native-popup-menu: ^0.15.9 => 0.15.10
react-native-reanimated: ^1.8.0 => 1.13.3
react-native-safe-area-context: ^3.1.9 => 3.2.0
react-native-screens: ^2.7.0 => 2.18.1
react-native-side-menu-updated: ^1.3.2 => 1.3.2
react-native-snap-carousel: ^3.9.1 => 3.9.1
react-native-splash-screen: ^3.2.0 => 3.2.0
react-native-svg: ^12.1.0 => 12.1.1
react-native-text-ticker: ^1.12.0 => 1.12.0
react-native-user-avatar: ^1.0.7 => 1.0.7
react-native-vector-icons: ^6.6.0 => 6.7.0 (7.1.0)
react-native-version-info: ^1.1.0 => 1.1.0
react-native-webview: ^10.7.0 => 10.10.2
react-redux: ^7.2.0 => 7.2.4
react-test-renderer: 16.11.0 => 16.11.0
redux: ^4.0.5 => 4.1.0
redux-actions: ^2.6.5 => 2.6.5
redux-devtools-extension: ^2.13.8 => 2.13.9
redux-persist: ^6.0.0 => 6.0.0
redux-persist/integration/react: undefined ()
redux-promise: ^0.6.0 => 0.6.0
redux-thunk: ^2.3.0 => 2.3.0
victory-native: ^35.0.0 => 35.3.3
npmGlobalPackages:
@aws-amplify/cli: 4.32.0
npm: 7.0.3
react-native-cli: 2.0.1
serverless: 2.10.0
Describe the bug
I am trying to get amplify push notifications running on Android with React Native. Since I have integrated the package @aws-amplify/pushnotification, I can not get my Android app to build and run any more. The error message is:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:checkDebugDuplicateClasses'.
> 1 exception was raised by workers:
java.lang.RuntimeException: java.lang.RuntimeException: Duplicate class com.google.android.gms.gcm.PendingCallback found in modules jetified-firebase-jobdispatcher-0.6.0-runtime.jar (com.firebase:firebase-jobdispatcher:0.6.0) and jetified-play-services-gcm-16.1.0-runtime.jar (com.google.android.gms:play-services-gcm:16.1.0)
Duplicate class com.google.android.gms.internal.measurement.zzu found in modules jetified-firebase-analytics-impl-16.2.4-runtime.jar (com.google.firebase:firebase-analytics-impl:16.2.4) and jetified-play-services-measurement-19.0.0-runtime.jar (com.google.android.gms:play-services-measurement:19.0.0)
Duplicate class com.google.android.gms.internal.measurement.zzv found in modules jetified-firebase-analytics-impl-16.2.4-runtime.jar (com.google.firebase:firebase-analytics-impl:16.2.4) and jetified-play-services-measurement-19.0.0-runtime.jar (com.google.android.gms:play-services-measurement:19.0.0)
Duplicate class com.google.android.gms.internal.measurement.zzw found in modules jetified-firebase-analytics-impl-16.2.4-runtime.jar (com.google.firebase:firebase-analytics-impl:16.2.4) and jetified-play-services-measurement-19.0.0-runtime.jar (com.google.android.gms:play-services-measurement:19.0.0)
Duplicate class com.google.android.gms.measurement.AppMeasurement found in modules jetified-firebase-analytics-impl-16.2.4-runtime.jar (com.google.firebase:firebase-analytics-impl:16.2.4) and jetified-play-services-measurement-impl-19.0.0-runtime.jar (com.google.android.gms:play-services-measurement-impl:19.0.0)
...
There had been already a bug filed for this bug it had been closed without a resolution to the problem just because of inactivity: https://github.com/aws-amplify/amplify-js/issues/4593
Expected behavior
I can build and run my Android app as usual
Reproduction steps
- Follow the instructions https://docs.amplify.aws/lib/push-notifications/getting-started/q/platform/js for setting push notifications up on Android (alternatively also follow this guide for instructions about integrating it for React Native > 0.60 https://medium.com/@dantasfiles/setting-up-android-push-notifications-with-aws-amplify-e6334c6356d8)
Code Snippet
Just follow the guide https://medium.com/@dantasfiles/setting-up-android-push-notifications-with-aws-amplify-e6334c6356d8
Log output
I don’t even get the app to run, so not debug output possible
aws-exports.js
No response
Manual configuration
No response
Additional configuration
No response
Mobile Device
No response
Mobile Operating System
Android
Mobile Browser
No response
Mobile Browser Version
No response
Additional information and screenshots
No response
Issue Analytics
- State:
- Created 2 years ago
- Comments:12 (6 by maintainers)
Hi @chrisbonifacio,
Even further information - here’s my android/app/build.gradle:
where
...
are anonymizations.Also I have created a dependency tree for maybe more information about the dependencies for
com.firebase:firebase-jobdispatcher
andcom.google.android.gms:play-services-gcm
(just picked the compilation variant for debug exemplarily):Maybe that helps as well?
Hey @chrisbonifacio,
Thanks for investigating! One more important information- on iOS, everything runs smoothly and I can get push notifications delivered as expected. It’s just on Android that I experience problems.
Thank you and best regards The Smart Home Maker