Unable to add Cordova plugins to my project

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP



Unable to add Cordova plugins to my project



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.


buildinfo



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.


cordova plugin add cordova-plugin-buildinfo


Plugins


Plugins



Command Prompt Error



Plugins Folder contents


Plugins



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!





Possible duplicate of Failed to find 'ANDROID_HOME' environment variable
– Martin Zeitler
Aug 7 at 3: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 7 at 3:49



PATH


%ANDROID_HOME%/platform-tools





@MartinZeitler PATH variable is also defined. I am sorry I forgot to attach that as well
– d33a
Aug 7 at 4: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 7 at 4:32





2 Answers
2



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.


Android_Home


Android_Home



For Windows:


set ANDROID_HOME=C:installation locationandroid-sdk

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



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


Android_Home





I have set the environment variable, otherwise I wouldn't be able to add the other plugins as well I suppose
– d33a
Aug 6 at 13:50





@d33a ANDROID_HOME is not the same as having cordova installed. Your assumption based on other plugins is likely wrong
– BShaps
Aug 6 at 18:04


ANDROID_HOME


cordova





@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 7 at 3:39





@d33a as I mentioned you have not set correct Android_Home and Path. Please check my updated answer for how to set.
– VicJordan
Aug 7 at 4: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 7 at 4:30



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:



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






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Firebase Auth - with Email and Password - Check user already registered

Dynamically update html content plain JS

Creating a leaderboard in HTML/JS