PDA

View Full Version : Problem with commandline sencha app build package [ERROR] ReferenceError: Can't find



quangtrung89
24 Oct 2012, 7:12 AM
Hello I have problem with command line sencha app build package

[INFO] Resolving your application dependencies (http://localhost/JalumbaDev/index.html)
[ERROR] ReferenceError: Can't find variable: ContactFindOptions

My application integrated PhoneGap. I can run the application with Ripple emulator fine. But after I run commandline to package the app to push the package files into Android project. I have error like that. I tried many ways but not successful.


These following code inside an controller inform error when I run command line to package the app.
onActivate: function() {
this.getContacts();
},
getContacts: function(){
var obj = new ContactFindOptions();
obj.filter = "";
obj.multiple = true;
navigator.contacts.find(
[ "displayName", "name" ], this.contactsSuccess,
this.failEd, obj);
},
contactsSuccess: function(contacts){
console.log(contacts);
},
failEd: function (msg) {
alert(msg);
},

Do you have any idea?

dongryphon
25 Oct 2012, 12:47 AM
To help out you'll need to specify which version of Sencha Touch you are using as well as the build tools (Sencha Cmd v3 or older SDK Tools v2).

quangtrung89
25 Oct 2012, 1:12 PM
Hi, sorry I forgot to tell, I am using older SDK Tool v2.

Thanks a lot.

dongryphon
25 Oct 2012, 8:48 PM
Are you using Sencha Touch 2.0 or 2.1? You need SDK Tools v2 for Touch 2.0 and Cmd v3 for Touch 2.1.

quangtrung89
26 Oct 2012, 12:58 AM
I am using Sencha Touch 2.0, and SDK Tools v2. Inside the application I used PhoneGap, from one controller, I used PhoneGap's object like this,
var obj = new ContactFindOptions();

I can run it fine from Ripple emulator, but I cannot run the command line sencha app build package

Error is
[INFO] Resolving your application dependencies
[ERROR] ReferenceError: Can't find variable: ContactFindOptions
Anynomous .....

As I understand package command cannot resolve the dependencies function from PhoneGap.