0

I am trying to add the buildinfo Cordova plugin to my project, to which I have added an Android platform. I was able to add rest of the required Cordova plugins.

Does it have anything to do with my Android version (6.4.0)?

Also, after running command cordova plugin add cordova-plugin-buildinfo, it shows the attached screen but the buildinfo plugin folder along with the required contents gets created at my project's Plugins folder, but not inside the Plugins folder of the Android Platform inside my Cordova project.

Command Prompt Error

Plugins Folder contents

Plugins Folder

Plugin Folder Contents

Also kindly note that I have set my ANDROID_HOME and Path environment variables as seen in the below pictures:

ANDROID_HOME environment variable

Path environment variable

P.S. I am able to add the mentioned plugin to another Cordova project in my system!

Vikasdeep Singh
  • 20,983
  • 15
  • 78
  • 104
d33a
  • 690
  • 1
  • 14
  • 39
  • Possible duplicate of [Failed to find 'ANDROID\_HOME' environment variable](https://stackoverflow.com/questions/36198165/failed-to-find-android-home-environment-variable) – Martin Zeitler Aug 07 '18 at 03:42
  • you also need to define the `PATH` and add the platform-tools there... just as the error message reads; just wonder why you censored that much, but didn't read it? eg. `%ANDROID_HOME%/platform-tools`. – Martin Zeitler Aug 07 '18 at 03:49
  • @MartinZeitler PATH variable is also defined. I am sorry I forgot to attach that as well – d33a Aug 07 '18 at 04:24
  • one Windows 7 (according to the window decorations) you might need to log out and log in again, in order to have those environment variables available; think that Windows 10 does not require this anymore. – Martin Zeitler Aug 07 '18 at 04:32

2 Answers2

0

Your Android_Home environment variable is not set correctly or not set at all due to which this plugin is not able to install. Please make sure that Android_Home environment variable is set correctly.

For Windows:

set ANDROID_HOME=C:\installation location\android-sdk

set PATH=%PATH%;%ANDROID_HOME%\tools;%ANDROID_HOME%\platform-tools

For how to set Android_Home on windows machine, have a look here

Vikasdeep Singh
  • 20,983
  • 15
  • 78
  • 104
  • I have set the environment variable, otherwise I wouldn't be able to add the other plugins as well I suppose – d33a Aug 06 '18 at 13:50
  • 1
    @d33a `ANDROID_HOME` is not the same as having `cordova` installed. Your assumption based on other plugins is likely wrong – BShaps Aug 06 '18 at 18:04
  • @BShaps I agree with you that my assumption may be wrong. I have attached a screenshot for the reference of the environment variable that has been set. Thanks! – d33a Aug 07 '18 at 03:39
  • @d33a as I mentioned you have not set correct Android_Home and Path. Please check my updated answer for how to set. – Vikasdeep Singh Aug 07 '18 at 04:25
  • Dear @VicJordan I am able to add this particular plugin to another Cordova project of mine. Can this issue still have something to do with the environment variables? – d33a Aug 07 '18 at 04:30
0

The error message makes it sound like you may need to install the platform-tools in Android Studio's SDK Manager. To install them, follow these steps:

  1. Open Android Studio
  2. Tools -> SDK Manager
  3. You should see a list of SDK Platforms in a new popup window, click on the SDK Tools tab
  4. Check Android SDK Tools and hit Apply

That will install the latest version of the Android SDK Tools and hopefully will clear out your error message.

BShaps
  • 1,344
  • 7
  • 17