To implement the Authentication Screen in my bare native react app, I am trying to use AWS Amplify Gen 1 Authentication.
To implement "WithAuthenticator" component of AWS Amplify, have installed @aws-amplify/ui-react-native (which also installs other dependencies). However, since then the app build is failing, throwing below error Task :react-native-pager-view:processDebugManifest FAILED
(package.json) "dependencies": { "@aws-amplify/react-native": "^1.1.6", "@aws-amplify/ui-react-native": "^2.4.2", "@react-native-async-storage/async-storage": "^2.1.0", "@react-native-community/netinfo": "^11.4.1", "@react-native-community/slider": "4.5.2", "@react-navigation/bottom-tabs": "^6.6.1", "@react-navigation/native": "^6.1.18", "@react-navigation/native-stack": "^6.11.0", "aws-amplify": "^6.13.2", "react": "18.2.0", "react-hook-form": "^7.53.0", "react-native": "0.74.5", "react-native-get-random-values": "^1.11.0", "react-native-image-picker": "^7.1.2", "react-native-pager-view": "^6.6.1", "react-native-safe-area-context": "^4.14.0", "react-native-screens": "^3.31.1", "react-native-tab-view": "^3.5.2", },
I suspect this could be the known behavior of React Native libraries not working with 3rd party libraries, unless they are of some specific version. Appreciate some guidance or direction to resolve this.
(Note: I am not a seasoned programmer, simply following a react native app build tutorial)
First, I compared my current package.json with the earlier git committed package.json, where the app was working but the below aws amplify ui library was still not installed.
@aws-amplify/ui-react-native": "^2.4.2",
Observed that the previous version was "aws-amplify": "^6.12.2" and not "^6.13.2" (as seen in latest package.json which seems to have updated after installing @aws-amplify/ui-react-native 2.4.2)
So browsed the below npm link for the aws amplify ui library and tried to install earlier versions.
https://www.npmjs.com/package/@aws-amplify/ui-react-native?activeTab=versions
When tried to install the library version which was a year old (2.1.0), it shows error "supported only till react 0.73", while my react version is "0.74". Thus started trying versions earlier than an year and which would no longer show the above error. Eventually, installed version 2.2.0 using below.
$ npm install @aws-amplify/ui-react-native@2.2.0
On installing version 2.2.0, noticed that "aws-amplify": "^6.12.2" (as per earlier package.json where app was working)
Now restarted the node server and re-built the app.
The AWS Amplify UI component for Authentication was now loaded on the app screen, showing the login page for the app.