Updating to Capacitor 5: [error] gradle wrapper files were not updated

Below I’ll detail the steps I took to do the update to Capacitor 5. The steps outlined in the doc are overly simplistic, IMO (Updating to 5.0 | Capacitor Documentation).

My question is if I need to do anything based on the error I got when running npx cap migrate:

× Upgrading gradle wrapper files - failed!
[error] gradle wrapper files were not updated

Based on the details further down in the above-linked document, I think everything is OK. But I don’t know for sure, and I’m not sure how to know for sure. The docs reference a single gradle-wrapper.properties file, and that’s all I see in the android project. But the command says “Upgrading gradle wrapper files”, i.e. plural, and it gives an error output.

So what was the error, is there something I can and/or need to correct, and how do I know if the update / migration worked?

As to the process I had to follow for the steps in the document to work, here’s what I had to do.

  1. Run npm outdated and keep the output that’s specifically related to the @capacitor/* packages as well as any third-party capacitor plugin packages in your project.

  2. Run npm i -D @capacitor/cli@latest (as in the document)

  3. Manually update your package.json file to apply all the versions listed in the output of npm outdated for the @capacitor/* packages and any third-party capacitor plugin packages.

  4. Run rm -rf node_modules/ and rm package-lock.json

  5. Run npm install - make sure this works. It’s because this failed in other attempts to follow the document that I had to arrive at this procedure.

  6. Run npx cap migrate (as in the document). NOTE: This will change the @capacitor/* package entries in package.json to simply 5.0.0 - which is really bad form, IMO.

It was at this point that I got the error I asked about above. But hopefully these more detailed steps help someone else.

Thanks all.

Just delete the android folder and will be regenerated.
CAREFULL: Save the data and configurations somewhere