Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-9270

Plugman fails reading the sdk.dir value

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: cordova-lib
    • Labels:
      None
    • Environment:

      Windows 10/Cordova 5.1.1/Android SDK 19

      Description

      When trying to install the Cordova-admob-pro plugin, I experience this error:

      C:\Users\Arcadio\Documents\GitHub\PhoneKeyboard\phone\cordova\keystroke\Keystroke>cordova plugin add cordova-plugin-admobpro
      Fetching plugin "cordova-plugin-admobpro" via npm
      npm http GET https://registry.npmjs.org/cordova-plugin-admobpro
      npm http 304 https://registry.npmjs.org/cordova-plugin-admobpro
      Installing "cordova-plugin-admobpro" for android
      Error during processing of action! Attempting to revert...
      Failed to install 'cordova-plugin-admobpro':TypeError: Uh oh!
      Arguments to path.resolve must be strings
      at Object.exports.resolve (path.js:116:15)
      at Object.module.exports.framework.install (C:\Users\Arcadio\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\plugman\platforms\android.js:139:35)
      at installWrapper (C:\Users\Arcadio\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\platforms\platforms.js:77:32)
      at Object.ActionStack.process (C:\Users\Arcadio\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\plugman\util\action-stack.js:68:25)
      at handleInstall (C:\Users\Arcadio\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\plugman\install.js:550:20)
      at C:\Users\Arcadio\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\plugman\install.js:342:28
      at _fulfilled (C:\Users\Arcadio\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:787:54)
      at self.promiseDispatch.done (C:\Users\Arcadio\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:816:30)
      at Promise.promise.promiseDispatch (C:\Users\Arcadio\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:749:13)
      at C:\Users\Arcadio\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:509:49
      TypeError: Uh oh!
      Arguments to path.resolve must be strings
      at Object.exports.resolve (path.js:116:15)
      at Object.module.exports.framework.install (C:\Users\Arcadio\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\plugman\platforms\android.js:139:35)
      at installWrapper (C:\Users\Arcadio\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\platforms\platforms.js:77:32)
      at Object.ActionStack.process (C:\Users\Arcadio\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\plugman\util\action-stack.js:68:25)
      at handleInstall (C:\Users\Arcadio\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\plugman\install.js:550:20)
      at C:\Users\Arcadio\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\plugman\install.js:342:28
      at _fulfilled (C:\Users\Arcadio\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:787:54)
      at self.promiseDispatch.done (C:\Users\Arcadio\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:816:30)
      at Promise.promise.promiseDispatch (C:\Users\Arcadio\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:749:13)
      at C:\Users\Arcadio\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:509:49

      I seems that the file platforms\android\local.properties does not contain the value sdk.dir, so when the code in android.js tries to resolve the path it fails (it is undefined). I'm not sure when should that value be set, but it is obviously missing, the only content of the file is:

      1. This file is automatically generated.
      2. Do not modify this file – YOUR CHANGES WILL BE ERASED!

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              arcadiogarcia Arcadio Garcia
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated: