poetic/ember-cli-cordova

Failed to install 'cordova-plugin-whitelist'

Opened this issue · 7 comments

Hi, I'm very new using cordova and ember so I try to follow step by step the "Getting started" guide from you but at the step to generate the cordova-init everything crash. I research for the same scenarios in internet but all of them are related with ios, I want to use as android platform let me show my code:

ember generate cordova-init com.nobs.mobile --platform=android

and then:

installing cordova-init
? Overwrite config/environment.js? Yes, overwrite
? Overwrite .gitignore? Yes, overwrite
  overwrite config/environment.js
  overwrite .gitignore
Creating Cordova project...
Using detached cordova-create
Creating a new cordova project.
Creating Cordova project...
Adding android platform to cordova.
Adding android project...
Creating Cordova project for the Android platform:
	Path: platforms/android
	Package: com.nobs.mobile
	Name: Mobile
	Activity: MainActivity
	Android target: android-24
Subproject Path: CordovaLib
Android project created with cordova-android@6.0.0
Discovered plugin "cordova-plugin-whitelist" in config.xml. Adding it to the project
Fetching plugin "cordova-plugin-whitelist@1" via npm
Installing "cordova-plugin-whitelist" for android
Failed to install 'cordova-plugin-whitelist':Error
    at /Volumes/Develop/mobile/cordova/platforms/android/cordova/lib/check_reqs.js:222:19
    at _fulfilled (/Volumes/Develop/mobile/cordova/platforms/android/cordova/node_modules/q/q.js:834:54)
    at self.promiseDispatch.done (/Volumes/Develop/mobile/cordova/platforms/android/cordova/node_modules/q/q.js:863:30)
    at Promise.promise.promiseDispatch (/Volumes/Develop/mobile/cordova/platforms/android/cordova/node_modules/q/q.js:796:13)
    at /Volumes/Develop/mobile/cordova/platforms/android/cordova/node_modules/q/q.js:857:14
    at runSingle (/Volumes/Develop/mobile/cordova/platforms/android/cordova/node_modules/q/q.js:137:13)
    at flush (/Volumes/Develop/mobile/cordova/platforms/android/cordova/node_modules/q/q.js:125:13)
    at _combinedTickCallback (internal/process/next_tick.js:67:7)
    at process._tickCallback (internal/process/next_tick.js:98:9)
Failed to restore plugin "cordova-plugin-whitelist" from config.xml. You might need to try adding it again. Error: Failed to find 'ANDROID_HOME' environment variable. Try setting setting it manually.
Failed to find 'android' command in your 'PATH'. Try update your 'PATH' to include path to valid SDK directory.
Adding android platform to cordova...

Can you help me please?

have you solved this @ivangrimaldo ?

Noup, I stopped the training, I'm learning Swft 3 instead :P

Failed to find 'android' command in your 'PATH'.

The issue is that Android SDK's tools directory is not in the path. That is what it is complaining about.

rtm commented

@BryanH Why do you believe that the first error is related to or caused by the second?

Failed to restore plugin "cordova-plugin-whitelist" from config.xml. You might need to try adding it again. Error: Failed to find 'ANDROID_HOME' environment variable. Try setting setting it manually.
Failed to find 'android' command in your 'PATH'. Try update your 'PATH' to include path to valid SDK directory.

I get the first error all by itself.

This happens to me when I clone from the repo:

Discovered saved plugin "cordova-plugin-whitelist". Adding it to the project
Failed to restore plugin "cordova-plugin-whitelist" from config.xml. You might need to try 
adding it again. Error: Failed to fetch plugin cordova-plugin-whitelist@^1.3.4 via registry.

This fixed it:

$ cordova plugin add cordova-plugin-whitelist
$ cordova prepare

Note it doesn't work without running cordova prepare

This happens to me when I clone from the repo:

Discovered saved plugin "cordova-plugin-whitelist". Adding it to the project
Failed to restore plugin "cordova-plugin-whitelist" from config.xml. You might need to try 
adding it again. Error: Failed to fetch plugin cordova-plugin-whitelist@^1.3.4 via registry.

This fixed it:

$ cordova plugin add cordova-plugin-whitelist
$ cordova prepare

Note it doesn't work without running cordova prepare

@BrennaEpp Thanks, In my case cordova prepare did the job.

Reopening - problem still exists