I've resolved this issue by using the Cordova CLI commands exclusively to create the project and then to add the plugins. It seems you have to use their build commands to get everything moved into the right directories. Now I just issue a cordova build
and that will build for iOS and Android with the appropriate plugin files in the correct spot.
I've also modified the generated js/index.js to call my Sencha Touch app as follows:
var device = false;
var app = {
// Application Constructor
initialize: function() {
this.bindEvents();
},
// Bind Event Listeners
//
// Bind any events that are required on startup. Common events are:
// 'load', 'deviceready', 'offline', and 'online'.
bindEvents: function() {
document.addEventListener('deviceready', this.onDeviceReady, false);
},
// deviceready Event Handler
//
// The scope of 'this' is the event. In order to call the 'receivedEvent'
// function, we must explicity call 'app.receivedEvent(...);'
onDeviceReady: function() {
app.receivedEvent('deviceready');
},
// Update DOM on a Received Event
receivedEvent: function(id) {
try {
device = true;
People.app.mainLaunch();
}
catch(e) {
alert("Error: " + e);
}
console.log('Received Event: ' + id);
}
};
And then in my Sencha Touch app, I create I modified my launch method to prevent a race condition between my ST app being initialized before PhoneGap starting up as follows:
launch: function() {
this.launched = true;
this.mainLaunch();
},
mainLaunch: function() {
try {
if (this.launched && device) {
Ext.Viewport.add({xtype:'myApp');
}
}
catch(e) {
alert(e);
}
},