9 Replies Latest reply: Oct 17, 2017 6:07 AM by ctetreault RSS

Getting an Error when I try to install BlackBerry Dynamics cordova base plugin

david.fekke Newbie

I have an Android application that is using Cordova, and I am trying to install one of the dynamics plugins, but I am getting the following error;

 

Installing "cordova-plugin-bbd-base" for android

ANDROID_HOME=/Users/davidfekke/Library/Android/sdk

JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_91.jdk/Contents/Home

Failed to install 'cordova-plugin-bbd-base': Error

    at Object.module.exports.check_gradle (/Users/davidfekke/Documents/android/projects/SalesforceSecuredAndroid/platforms/android/cordova/lib/check_reqs.js:90:25)

    at GradleBuilder.prepEnv (/Users/davidfekke/Documents/android/projects/SalesforceSecuredAndroid/platforms/android/cordova/lib/builders/GradleBuilder.js:161:23)

    at Api.module.exports.runClean (/Users/davidfekke/Documents/android/projects/SalesforceSecuredAndroid/platforms/android/cordova/lib/build.js:131:20)

    at /Users/davidfekke/Documents/android/projects/SalesforceSecuredAndroid/platforms/android/cordova/Api.js:392:50

    at _fulfilled (/Users/davidfekke/Documents/android/projects/SalesforceSecuredAndroid/platforms/android/cordova/node_modules/q/q.js:834:54)

    at self.promiseDispatch.done (/Users/davidfekke/Documents/android/projects/SalesforceSecuredAndroid/platforms/android/cordova/node_modules/q/q.js:863:30)

    at Promise.promise.promiseDispatch (/Users/davidfekke/Documents/android/projects/SalesforceSecuredAndroid/platforms/android/cordova/node_modules/q/q.js:796:13)

    at /Users/davidfekke/Documents/android/projects/SalesforceSecuredAndroid/platforms/android/cordova/node_modules/q/q.js:604:44

    at runSingle (/Users/davidfekke/Documents/android/projects/SalesforceSecuredAndroid/platforms/android/cordova/node_modules/q/q.js:137:13)

    at flush (/Users/davidfekke/Documents/android/projects/SalesforceSecuredAndroid/platforms/android/cordova/node_modules/q/q.js:125:13)

Error: Could not find gradle wrapper within Android SDK. Might need to update your Android SDK.

Looked here: /Users/davidfekke/Library/Android/sdk/tools/templates/gradle/wrapper

 

Has anyone gotten this error when trying to install one of the Dynamic's plugins?

 

Thanks,

David

  • Re: Getting an Error when I try to install BlackBerry Dynamics cordova base plugin
    ctetreault BlackBerry Employee

    Hello,

     

    I'd first start by making sure your environment is setup proper by attempting to create a blank helloWorld Cordova app and deploying.

     

    If that goes well and you're still running into errors you can check the following:

    - Cordova v6.3.1 is installed (must be this version)

    - Android 6.x SDK installed in Android SDK Manager (API level 23)

    • Re: Getting an Error when I try to install BlackBerry Dynamics cordova base plugin
      david.fekke Newbie

      I have Cordova 7.0.1 installed. Do I need to downgrade?

      • Re: Getting an Error when I try to install BlackBerry Dynamics cordova base plugin
        asett01 BlackBerry

        Hi David Fekke,

        Yes, you would need to downgrade to Cordova 6.3.1

        • Re: Getting an Error when I try to install BlackBerry Dynamics cordova base plugin
          david.fekke Newbie

          I am still getting the same error after downgrading to Cordova 6.3.1. Salesforce requires at least Cordova version 6.4.0.

           

          cordova plugin add ../cordova-plugin-bbd-base

          Installing "cordova-plugin-bbd-base" for android

          ANDROID_HOME=/Users/davidfekke/Library/Android/sdk

          JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_91.jdk/Contents/Home

          Failed to install 'cordova-plugin-bbd-base':Error

              at Object.module.exports.check_gradle (/Users/davidfekke/Documents/android/projects/SalesforceSecuredAndroid/platforms/android/cordova/lib/check_reqs.js:90:25)

              at GradleBuilder.prepEnv (/Users/davidfekke/Documents/android/projects/SalesforceSecuredAndroid/platforms/android/cordova/lib/builders/GradleBuilder.js:161:23)

              at Api.module.exports.runClean (/Users/davidfekke/Documents/android/projects/SalesforceSecuredAndroid/platforms/android/cordova/lib/build.js:131:20)

              at /Users/davidfekke/Documents/android/projects/SalesforceSecuredAndroid/platforms/android/cordova/Api.js:392:50

              at _fulfilled (/Users/davidfekke/Documents/android/projects/SalesforceSecuredAndroid/platforms/android/cordova/node_modules/q/q.js:834:54)

              at self.promiseDispatch.done (/Users/davidfekke/Documents/android/projects/SalesforceSecuredAndroid/platforms/android/cordova/node_modules/q/q.js:863:30)

              at Promise.promise.promiseDispatch (/Users/davidfekke/Documents/android/projects/SalesforceSecuredAndroid/platforms/android/cordova/node_modules/q/q.js:796:13)

              at /Users/davidfekke/Documents/android/projects/SalesforceSecuredAndroid/platforms/android/cordova/node_modules/q/q.js:604:44

              at runSingle (/Users/davidfekke/Documents/android/projects/SalesforceSecuredAndroid/platforms/android/cordova/node_modules/q/q.js:137:13)

              at flush (/Users/davidfekke/Documents/android/projects/SalesforceSecuredAndroid/platforms/android/cordova/node_modules/q/q.js:125:13)

          Error: Could not find gradle wrapper within Android SDK. Might need to update your Android SDK.

          Looked here: /Users/davidfekke/Library/Android/sdk/tools/templates/gradle/wrapper

    • Re: Re: Getting an Error when I try to install BlackBerry Dynamics cordova base plugin
      david.fekke Newbie

      So I made a little progress with this. It turns out that Google removed some of the tools from sdk that used gradle templates. I was able to create a new Cordova project and add the configure, base and httprequest plugins to that new project.

       

      I am getting a new error when I try to add the plugins to my existing project;

       

      * Where:

      Build file '/Users/davidfekke/Documents/android/projects/SalesforceSecuredAndroid/platforms/android/build.gradle' line: 20

       

       

      * What went wrong:

      A problem occurred evaluating root project 'android'.

      > Failed to apply plugin [id 'com.android.application']

        > Minimum supported Gradle version is 3.3. Current version is 2.14.1. If using the gradle wrapper, try editing the distributionUrl in /Users/davidfekke/Documents/android/projects/SalesforceSecuredAndroid/gradle/wrapper/gradle-wrapper.properties to gradle-3.3-all.zip

       

      Does anyone have a workaround, I will I need to upgrade my version of gradle?

      • Re: Getting an Error when I try to install BlackBerry Dynamics cordova base plugin
        asett01 BlackBerry

        Hello David Fekke,

         

        Have you tried updating the distributionUrl setting in the gradle-wrapper.properties file to have the value https\://services.gradle.org/distributions/gradle-3.3-all.zip? Once you do this please invalidate caches and restart. Let us know either way if this solves your issue.

      • Re: Getting an Error when I try to install BlackBerry Dynamics cordova base plugin
        david.fekke Newbie

        I just upgraded to the latest version of the BlackBerry Dynamics library for Cordova. I am still having gradle issues. So as an experiment, I decided to create a blank cordova application, and then tried adding the following plugins to that project;

         

        cordova-plugin-bbd-configure

        cordova-plugin-bbd-base

        cordova-plugin-bbd-httprequest

         

        I was able to add all of these plugins to the blank cordova app. The next experiment I tried was to create a new Salesforce mobile application using Salesforce's forcedroid tool. When I tried to install the bbd-configure plug, I got the following warning;

        cp: copyFileSync: could not write to dest file (code=EACCES):/Users/davidfekke/Documents/android/projects/cordova-plugin-bbd-base/src/android/GDLibrary/AndroidManifest.xml

         

         

        cp: copyFileSync: could not write to dest file (code=EACCES):/Users/davidfekke/Documents/android/projects/cordova-plugin-bbd-base/src/android/GDLibrary_BackupSupport/AndroidManifest.xml

        Then when I tried to install the bbd-base plugin, I got the following error;

         

        Installing "cordova-plugin-bbd-base" for android

        Error during processing of action! Attempting to revert...

        Failed to install 'cordova-plugin-bbd-base': CordovaError: Uh oh!

        "/Users/davidfekke/Documents/android/projects/swyfttest/platforms/android/gradle.properties" already exists!

            at copyNewFile (/Users/davidfekke/Documents/android/projects/swyfttest/platforms/android/cordova/lib/pluginHandlers.js:248:15)

            at install (/Users/davidfekke/Documents/android/projects/swyfttest/platforms/android/cordova/lib/pluginHandlers.js:43:17)

            at Object.process (/Users/davidfekke/Documents/android/projects/swyfttest/platforms/android/cordova/node_modules/cordova-common/src/ActionStack.js:56:25)

            at PluginManager.doOperation (/Users/davidfekke/Documents/android/projects/swyfttest/platforms/android/cordova/node_modules/cordova-common/src/PluginManager.js:117:20)

            at PluginManager.addPlugin (/Users/davidfekke/Documents/android/projects/swyfttest/platforms/android/cordova/node_modules/cordova-common/src/PluginManager.js:147:17)

            at /Users/davidfekke/Documents/android/projects/swyfttest/platforms/android/cordova/Api.js:254:18

            at _fulfilled (/Users/davidfekke/Documents/android/projects/swyfttest/platforms/android/cordova/node_modules/q/q.js:854:54)

            at self.promiseDispatch.done (/Users/davidfekke/Documents/android/projects/swyfttest/platforms/android/cordova/node_modules/q/q.js:883:30)

            at Promise.promise.promiseDispatch (/Users/davidfekke/Documents/android/projects/swyfttest/platforms/android/cordova/node_modules/q/q.js:816:13)

            at /Users/davidfekke/Documents/android/projects/swyfttest/platforms/android/cordova/node_modules/q/q.js:570:49

        Error: Uh oh!

        "/Users/davidfekke/Documents/android/projects/swyfttest/platforms/android/gradle.properties" already exists!