Start a new topic

undefined is not a function Sample App

undefined is not a function Sample App

Dear All, 

I am trying to run Sample app on phonegap. But keep getting the following error 

E/Web Console(  930): Uncaught TypeError: undefined is not a function at file:///android_asset/www/js/imageontarget.js:18


It came on line no 18 which is as follows


this.tracker = new AR.ClientTracker("assets/", {


and here is index page 






    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

    <meta content="width=device-width,initial-scale=1,maximum-scale=5,user-scalable=yes" name="viewport">




<script src="architect://architect.js"></script>

<script type="text/javascript" src="js/ade.js"></script>


<link rel="stylesheet" href="css/default.css">




<div id="loadingMessage" class="info">Loading ...</div>


<script src="js/imageontarget.js"></script>




This is sample app, but not working me. Any help would be appriciateable. 



Hi Agha,

I think something isn't right with our project setup. 

Please follow the guide I pasted below step by step, import the project into a new/unused eclipse workspace and run the app again.

Thank you and best regards,

Automatic Setup of Sample App

Download the binary of the Sample App from GitHub

Unzip the binary file (

Open the console and change to the directory where you unzipped the binary

In the console run the script. Use the -d flag to specify where the Sample App should be created. The-ios and -android flags control which platform should be compiled after creating the app.

$ ./ -d ~/Path/Where/The/App/Should/Be/Created -ios true -android true


This may take a while (more than one minute) without any update message in the command line, depending on how fast the plugin is cloned from GitHub and downloaded (more than 30MB)

The script might run for some minutes without feedback as it is downloading more than 30MB from GitHub. It will finish with the following success message:


$ *** DONE - SUCCESS ***

Open the project in Xcode (iOS) or Eclipse (Android) and run it on your device.

Login or Signup to post a comment