Software Archive
Read-only legacy content
17061 Discussions

Problem adding a plugin

Ariel_O_
Beginner
1,140 Views

I'm trying to add the udp plugin that is in https://github.com/MobileChromeApps/cordova-plugin-chrome-apps-sockets-udp, I made all the steps showed in the documentation but It's still not working. The main problem is a message that said: chrome is not defined, and it's showed because I use the code of the sendBroadcast function that I taked form the test.js that comes in the same project. Also I add the dependency of the common plugin but it doesn't help.

0 Kudos
10 Replies
Brandon_K_Intel
Employee
1,140 Views

How did you add the plugin to your XDK project?

0 Kudos
Ariel_O_
Beginner
1,140 Views

I tryied both of the options, in the "Get plugin from the web" I put "cordova-plugin-chrome-apps-sockets-udp" in the Plugin ID and https://github.com/MobileChromeApps/cordova-plugin-chrome-apps-sockets-udp.git in the Repo URL, and in the "Import Local Plugin" option I put the same Plugin ID and I downloaded and descompressed the package in the www folder of the project

0 Kudos
Brandon_K_Intel
Employee
1,140 Views

How do you know the plugin wasn't installed correctly? What does the build log say when you attempt to build it?

0 Kudos
Ariel_O_
Beginner
1,140 Views

Because when I tried to use this code line: "chrome.sockets.udp.create(function(createInfo){......}" the log said: [INFO:CONSOLE(18)] "Uncaught ReferenceError: chrome is not defined" and it supposed that the chrome was defined in the plugin, however, I don't know any other way to check if the plugin was installed correctly or not.

0 Kudos
Brandon_K_Intel
Employee
1,140 Views

How are you testing this feature? Are you using the emulator or an actual build?

0 Kudos
Ariel_O_
Beginner
1,140 Views

Both of them. First, I run the app in the emulator and later I tried to install a build in my smartphone to see the log's with the Android SDK using these commands: "adb logcat' and "adb logcat | grep -i chrome"

0 Kudos
Dale_S_Intel
Employee
1,140 Views

I tried to do an Android build using this plugin, but the build fails (something about dependences).  Any chance you could provide a simple project that builds that contains this plugin?

 

Thanks!

Dale


 

0 Kudos
Ariel_O_
Beginner
1,140 Views

Sure, here it is.

0 Kudos
Dale_S_Intel
Employee
1,140 Views

This is what I see when I try to build UDP for Android:

 

  • Building a Cordova 4.1.2 application.
  • The application name is "UDP"
  • The package name is "xdk.intel.blank.ad.template"
  • Error: Plugin "" failed to install.
  • Error: Could not retrieve plugin dependencies for UDP'.
  • Error: Plugin UDP failed to install.
  • Plugin "org.apache.cordova.device" (0.2.13) installed.
  • Plugin "org.apache.cordova.splashscreen" (0.3.5) installed.

 

Are you able to build that project for Android? 

0 Kudos
Ariel_O_
Beginner
1,140 Views

Oh yes, I'm sorry about that. This is the correct one.

0 Kudos
Reply