2

I'm trying to install Amplify AWS to my existing Android app, but I keep running into this error...

Node.js is not installed. Visit https://nodejs.org/en/download/ to install it.

I'm following this doc : https://docs.amplify.aws/start/getting-started/setup/q/integration/android#add-amplify-to-your-application

I've try to install and re-install both of node.js version available on their website. I've try to clean and rebuild my project. Also try to update my Android Studio. Also try to be sure that node is on my $PATH.

I've follow every instruction I've found on Google : this one in here , also this one

That one on Github

Anyone have a idea what's next? :(

2 Answers2

1

After adding a dependency and when the gradle build starts it looks for the node.js and npm (node package manager), if not installed then it throws this error.

Solution: In this case first close the studio and install the node.js and npm, refer the below link for installing steps

https://docs.npmjs.com/downloading-and-installing-node-js-and-npm

If the OS is linux then using the nvm was recommended in case of windows then nvm-windows or you can download the node.js installer binary. After installing run the below commands from the terminal or command prompt

output of node and npm version

Then start the studio, the gradle will start the build and the progress can be seen in progress bar.

SJS
  • 26
  • 1
  • I'm using a MacBook M1 and this solution doesn't work for me. I have Node and NPM installed and still getting this error. Amplify works fine in my Xcode project. Only issues with the Android Studio Project – alionthego Jan 27 '22 at 09:18
0

For reference : I have found my solution : try again.

It's seems that the first time, my installation of Amplify CLI did not went through.

So, by taking the doc's step by step again, it worked... But as soon as this bug was fix, I've come to another one. With the manifest.xml who tried to name my app twice... due to the amplify datastore. I've follow this Github's solution and it work just fine.

EDIT :

For the 2nd fix, in the manifest, adding this did fixed it. (it's in the github solution's link I posted)

'tools:replace="android:name"'