Works straight from Eclipse, but not with PhoneGap Build

  • 2
  • Problem
  • Updated 9 years ago
  • Solved
Hi everyone,
First off, I want to say that PhoneGap (and PhoneGap Build) is a pretty amazing tool. Also, I'm totally new to it, so please point out things you all might think are obvious.

So I recently finished an application in Eclipse using the PhoneGap plug-in, which uses PhoneGap 0.9.5. It works great every time I run it as an Android application. But as soon as I pack up all the HTML, CSS, and JS files and get the automatically generated files from PhoneGap Build, the application breaks. I've tried not including the PhoneGap 0.9.5 JS file, but that causes all of the JavaScript to break. And when I do include it, it causes some strange prompts (screenshots attached).


Is this something I need to wait for PhoneGap Build to upgrade from 0.9.4 to 0.9.5? Or is there something I can do about it now?
Photo of jontheghost

jontheghost

  • 4 Posts
  • 0 Reply Likes

Posted 9 years ago

  • 2
Photo of Andrew Lunny

Andrew Lunny

  • 1911 Posts
  • 199 Reply Likes
Your best bet is to wait - we will upgrade PhoneGap in the next few days, most likely. PhoneGap pre-1.0 is not stable between releases.

The other option is to downgrade your app to 0.9.4, but that's not recommended - the release of 0.9.5 coincided with most of the PG Build travelling to conferences, so we hadn't had time to process the update.
Photo of jontheghost

jontheghost

  • 4 Posts
  • 0 Reply Likes
Awesome, thanks for the quick response!
Photo of rober_kixote

rober_kixote

  • 5 Posts
  • 0 Reply Likes
Phonegap.0.9.5.js and use Eclipse with Android 2.2 phonegap.jar and working properly.
But over a PhoneGap Build and download the apk, it fails with the error callback.
It is possible that PG Builder jar not updated to version 0.9.5?

Thanks for everything.

Example: https://github.com/roberkixote/PhoneG...

This reply was created from a merged topic originally titled
I have problem with PhoneGap phonegap.0.9.5 and Build..
Photo of Andrew Lunny

Andrew Lunny

  • 1911 Posts
  • 199 Reply Likes
We've upgraded to 0.9.5/0.9.5.1 everyone - please let us know if you encounter any speedbumps.
Photo of Kimmo Puputti

Kimmo Puputti

  • 25 Posts
  • 0 Reply Likes
I'm experiencing the same problem. With Eclipse/Android 2.2/phonegap.0.9.5.js everything works smoothly, but with the Phonegap build I get the popup boxes as seen above.
Photo of Kimmo Puputti

Kimmo Puputti

  • 25 Posts
  • 0 Reply Likes
Also, the same project fails to load any of the provided CSS/JS files on Symbian.
Photo of Kimmo Puputti

Kimmo Puputti

  • 25 Posts
  • 0 Reply Likes
Oh, I got it working on Android now.

I was including my own version of the phonegap js file, but just changed the script to include phonegap.js and that fixed it!
Photo of jontheghost

jontheghost

  • 4 Posts
  • 0 Reply Likes
Yup, I just tested it out and it's still doing the same thing if I include the PhoneGap JS file in the ZIP.

If I don't include the PhoneGap JS file, then the deviceready state never fires:
document.addEventListener("deviceready", onDeviceReady, false);

EDIT: Oh, I was specifying phonegap.0.9.5.js. I changed it to phonegap.js and didn't include the phonegap.js file and it's working now.
Photo of rober_kixote

rober_kixote

  • 5 Posts
  • 0 Reply Likes
Hello.
With phonegap.0.9.5.1.js still see the error of "gap_callbackServer. "
Example: https: / / github.com / roberkixote / PhoneGap-Sencha-USGS.git
https: / / build.phonegap.com/apps/14108

I hope these examples help you.
Greetings.
Photo of Andrew Lunny

Andrew Lunny

  • 1911 Posts
  • 199 Reply Likes
Can you try pointing your script tag to "phonegap.js," as the two other guys have done? It seems to have fixed their issue.
Photo of moob.me

moob.me

  • 3 Posts
  • 0 Reply Likes
I'm getting the same alert dialogues on my application. I'm using Dreamweaver 5.5's built-in Mobile Application Framework support (which would be great BTW if I could get phoneGap to work)
Photo of Andrew Lunny

Andrew Lunny

  • 1911 Posts
  • 199 Reply Likes
Are you using PhoneGap Build, or just building locally with Dreamweaver?

If you're using PhoneGap Build, make sure you have a script tag pointing to "phonegap.js" in your page.
Photo of moob.me

moob.me

  • 3 Posts
  • 0 Reply Likes
I'm not sure what you mean by 'PhoneGap Build', In Dreamweaver 5.5 i start a new mobile application from a built-in template. Without modification, this compiles and runs fine in the android emulator but if i add a device ready listener it alerts the dialogues as per the original post.

Dreamwever automatically adds the phonegap.js script tag
Photo of Andrew Lunny

Andrew Lunny

  • 1911 Posts
  • 199 Reply Likes
This discussion thread is about the PhoneGap Build service, online at https://build.phonegap.com

You can get Dreamweaver support from Adobe.
Photo of moob.me

moob.me

  • 3 Posts
  • 0 Reply Likes
Sorry yes, you're right, the discussion IS about PhoneGap Build but more specifically its about unexpected alert dialogues issued by phonegap.js so I dont think I'm off-topic in reporting the same issues with it. Sorry to have disturbed you.
Photo of rober_kixote

rober_kixote

  • 5 Posts
  • 0 Reply Likes
ok with phonega.js
Thanks.