Closed the-smart-home-maker closed 2 years ago
Also getting
node_modules/@aws-amplify/pushnotification/android/src/main/java/com/amazonaws/amplify/pushnotification/RNPushNotificationMessagingService.java:199: error: local variable mReactInstanceManager is accessed from within inner class; needs to be declared final
mReactInstanceManager.removeReactInstanceEventListener(this);
Temporary fix to allow android build
in file
node_modules/@aws-amplify/pushnotification/android/src/main/java/com/amazonaws/amplify/pushnotification/RNPushNotificationMessagingService.java
Add final
to line 74 & 189.
ReactInstanceManager mReactInstanceManager = ((ReactApplication) getApplication()).getReactNativeHost().getReactInstanceManager();
Changes to
final ReactInstanceManager mReactInstanceManager = ((ReactApplication) getApplication()).getReactNativeHost().getReactInstanceManager();
ReactInstanceManager mReactInstanceManager = ((ReactApplication) getApplication()).getReactNativeHost().getReactInstanceManager();
Changes to
final ReactInstanceManager mReactInstanceManager = ((ReactApplication) getApplication()).getReactNativeHost().getReactInstanceManager();
Hi @dylan-westbury,
thank you! I can confirm that this quick fix works and allows me to build again. But I think this should be integrated into the master branch as well.
Best, the_smart_home_maker
Hi @the-smart-home-maker, thanks for opening the issue. I was not able to reproduce it.
Can you please tell me which react-native
version you are using?
@Samaritan1011001 0.63.4
for us
@Samaritan1011001 I am using react-native 0.64.2
@Samaritan1011001 same issue occured with react-native 0.66.3
(I had just upgraded)
@the-smart-home-maker Thank you for the info. Please try the latest aws-amplify
version and let me know if that solved the issue. Thanks!
Hi @Samaritan1011001,
I tried with yarn upgrade aws-amplify, but the problem persists. Do I have to specify a specific version number?
Best, @the-smart-home-maker
Hi @the-smart-home-maker. Apologies. You should upgrade the @aws-amplify/pushnotification
package to 4.3.9
for the fix. Nothing to do with aws-amplify
Hi @Samaritan1011001 yes, you are right. Now that I have upgraded @aws-amplify/pushnotification, the problem seems to be solved. Great, thanks!
This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.
Looking for a help forum? We recommend joining the Amplify Community Discord server *-help
channels or Discussions for those types of questions.
Before opening, please confirm:
JavaScript Framework
React Native
Amplify APIs
Analytics, Push Notifications
Amplify Categories
analytics, notifications
Environment information
Describe the bug
After upgrading my packages with
yarn upgrade
, I am not able to build my React Native app on Android any more - I am receiving the following build error which seems to be caused by the aws-amplify/pushnotification package:Expected behavior
Build should work without an error message
Reproduction steps
Install the aws-amplify packages in the following versions:
├─ @aws-amplify/pushnotification@4.3.5 ├─ @react-native-community/push-notification-ios@1.10.1 └─ aws-amplify@4.3.8
Then try to build on Android
Code Snippet
Log output
aws-exports.js
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