I'm trying to build and run a cordova project for the ubuntu platform. The project is just the default that is produced automatically when I create a new project. Here is the config.xml file (I added the line containing the link to the icon):
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.gregory.example" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<icon src="img/logo.png" > </icon>
<name>Example</name>
<description>
A sample Apache Cordova application that responds to the deviceready event.
</description>
<author email="dev@cordova.apache.org" href="http://cordova.io">
Apache Cordova Team
</author>
<content src="index.html" />
<plugin name="cordova-plugin-whitelist" spec="1" />
<access origin="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
<platform name="android">
<allow-intent href="market:*" />
</platform>
<platform name="ios">
<allow-intent href="itms:*" />
<allow-intent href="itms-apps:*" />
</platform>
</widget>
When I view the index.html file in my browser, I see the cordova logo, and a flashing button that says "CONNECTING TO DEVICE." But when I try to run it using the CLI, it doesn't work.
Here are the commands I used:
gregory@gregory-1001PXD:~/javascript$ sudo cordova create example com.gregory.example Example
Creating a new cordova project.
gregory@gregory-1001PXD:~/javascript$ cd example/
gregory@gregory-1001PXD:~/javascript/example$ sudo vi config.xml
gregory@gregory-1001PXD:~/javascript/example$ sudo cordova platform add ubuntu
Adding ubuntu project...
Running command: /home/gregory/.cordova/lib/npm_cache/cordova-ubuntu/4.0.0/package/bin/create /home/gregory/javascript/example/platforms/ubuntu com.gregory.example Example
Creating a Cordova Project:
Project Path: /home/gregory/javascript/example/platforms/ubuntu
Package Name: com.gregory.example
Project Name: Example
missing icon element in config.xml
Discovered plugin "cordova-plugin-whitelist" in config.xml. Installing to the project
Fetching plugin "cordova-plugin-whitelist@1" via npm
Installing "cordova-plugin-whitelist" for ubuntu
This plugin is only applicable for versions of cordova-android greater than 4.0. If you have a previous platform version, you do *not* need this plugin since the whitelist will be built in.
gregory@gregory-1001PXD:~/javascript/example$ sudo cordova build ubuntu
Running command: /home/gregory/javascript/example/platforms/ubuntu/cordova/build
Building Desktop Application...
In order to build debian package, execute:
cd /home/gregory/javascript/example/platforms/ubuntu/native/com.gregory.example; debuild
gregory@gregory-1001PXD:~/javascript/example$ sudo cordova run ubuntu
Running command: /home/gregory/javascript/example/platforms/ubuntu/cordova/run
Building Desktop Application...
In order to build debian package, execute:
cd /home/gregory/javascript/example/platforms/ubuntu/native/com.gregory.example; debuild
Build Successful. Running the application.
Running Cordova
Launching the application.
But after it says "Launching the application," an empty gray window pops up, and the icon that appears in the sidebar is a question mark. What is happening here?