On August 22nd I packaged up my phonegap app for both Iphone and Android, both worked great, app has been tested by a lot of users since.
Today I went to make a change to the app, reloaded the original .zip file, exact same zip file I used on Aug 22nd and while the app builds fine and works still in iphone, it no longer works properly in Android.
Why would the exact same code no longer build properly? Is there any change log for the underlying build structure (not the .js cordova stuff) but the part that packages the app? Is it possible to build using an older version of the phonegap build tool?
Thanks
Today I went to make a change to the app, reloaded the original .zip file, exact same zip file I used on Aug 22nd and while the app builds fine and works still in iphone, it no longer works properly in Android.
Why would the exact same code no longer build properly? Is there any change log for the underlying build structure (not the .js cordova stuff) but the part that packages the app? Is it possible to build using an older version of the phonegap build tool?
Thanks
- 8 Posts
- 0 Reply Likes
Posted 7 years ago
Alan Neveu, Champion
- 213 Posts
- 11 Reply Likes
Does your config.xml specify the exact phonegap version that you want to use? It could be that the default version has increased and now your app is being build against 3.0 rather than 2.9. If so, that's a huge change.
As another idea, I am currently trying to get 3.1 and 3.0 to work and I cannot get a simple Hello World app to give access to the device object in the ondeviceready event. It seems that the new plugin model of 3.0 and higher is not loading the device plugin for Android. I don't know how to load a plugin using PhoneGap Build. It could just be that I am clueless and it is a simple answer (happens all the time!) or it could be an oversight that is being worked out as we speak. Check some other recent posts here and you will hopefully see progress on this issue and if it gets resolved that might help you out with your issue.
As another idea, I am currently trying to get 3.1 and 3.0 to work and I cannot get a simple Hello World app to give access to the device object in the ondeviceready event. It seems that the new plugin model of 3.0 and higher is not loading the device plugin for Android. I don't know how to load a plugin using PhoneGap Build. It could just be that I am clueless and it is a simple answer (happens all the time!) or it could be an oversight that is being worked out as we speak. Check some other recent posts here and you will hopefully see progress on this issue and if it gets resolved that might help you out with your issue.
Alan Neveu, Champion
- 213 Posts
- 11 Reply Likes
Okay, I just took my Hello World test app and downgraded config.xml so that it builds using 2.9.0 and that solved my problem in which Android builds had no access to the device object. So it looks like there is something I need to learn about how to register a plugin with PhoneGap Build for PhoneGap 3.0 and higher. I recommend that you try specifying 2.9.0 in your config.xml and try again.
- 8 Posts
- 0 Reply Likes
Yes the config.xml is set properly, build lists the appropriate version in the information text. Far as I can tell phonegap build is building the app differently then it did in august. If I had a list of changes to the build tool since then I might be able to determine what is not working in our app with Android.
Alan Neveu, Champion
- 213 Posts
- 11 Reply Likes
Can you share your config.xml with me, particularly the gap:plugin and/or feature nodes?
- 8 Posts
- 0 Reply Likes
I have been picking through an Android fork of the app to figure out what from the build is not working. So far my list is:
document.addEventListener - breaks the javascript
device.platform - breaks the javascript
window.openDatabase() - will create one, but the second breaks the javascript, switching order didnt help.
Odd collection of 'breaks'. Still more to find.
Is this what you are looking for?
feature name="http://api.phonegap.com/1.0/device"
feature name="http://api.phonegap.com/1.0/camera"
feature name="http://api.phonegap.com/1.0/contacts"
feature name="http://api.phonegap.com/1.0/file"
feature name="http://api.phonegap.com/1.0/geolocation"
feature name="http://api.phonegap.com/1.0/media"
feature name="http://api.phonegap.com/1.0/network"
feature name="http://api.phonegap.com/1.0/notification"
plugin name="Geolocation" value="CDVLocation"
plugin name="Geolocation" value="org.apache.cordova.geolocation.Geolocation"
document.addEventListener - breaks the javascript
device.platform - breaks the javascript
window.openDatabase() - will create one, but the second breaks the javascript, switching order didnt help.
Odd collection of 'breaks'. Still more to find.
Is this what you are looking for?
feature name="http://api.phonegap.com/1.0/device"
feature name="http://api.phonegap.com/1.0/camera"
feature name="http://api.phonegap.com/1.0/contacts"
feature name="http://api.phonegap.com/1.0/file"
feature name="http://api.phonegap.com/1.0/geolocation"
feature name="http://api.phonegap.com/1.0/media"
feature name="http://api.phonegap.com/1.0/network"
feature name="http://api.phonegap.com/1.0/notification"
plugin name="Geolocation" value="CDVLocation"
plugin name="Geolocation" value="org.apache.cordova.geolocation.Geolocation"
- 25 Posts
- 0 Reply Likes
It looks like this could be related to my problem as well: http://community.phonegap.com/nitobi/...
If you look into your assets/www folder you will probably see that the cordova.js, cordova_plugins.js and other javascripts for the plugins are present.
If you look into your app.json and index.html you might find, that these javascripts are not loaded into the app.
So, could it be that the:
- document.addEventListener - breaks when you want to register the deviceready event?
- device.platform - window.device is not even present?
Cheers!
M
If you look into your assets/www folder you will probably see that the cordova.js, cordova_plugins.js and other javascripts for the plugins are present.
If you look into your app.json and index.html you might find, that these javascripts are not loaded into the app.
So, could it be that the:
- document.addEventListener - breaks when you want to register the deviceready event?
- device.platform - window.device is not even present?
Cheers!
M
Alan Neveu, Champion
- 213 Posts
- 11 Reply Likes
Okay, this is working for me using PhoneGap 3.1:
<feature name="http://api.phonegap.com/1.0/camera"/>
<feature name="http://api.phonegap.com/1.0/file"/>
<feature name="http://api.phonegap.com/1.0/network"/>
<feature name="http://api.phonegap.com/1.0/notificat...>
<feature name="http://api.phonegap.com/1.0/device"/>
<gap:plugin name="org.apache.cordova.device"/>
<gap:plugin name="org.apache.cordova.camera"/>
<gap:plugin name="org.apache.cordova.device-orientation"/>
<gap:plugin name="org.apache.cordova.file"/>
<gap:plugin name="org.apache.cordova.globalization"/>
<gap:plugin name="org.apache.cordova.inappbrowser"/>
<gap:plugin name="org.apache.cordova.network-information"/>
<gap:plugin name="org.apache.cordova.dialogs"/>
<gap:plugin name="org.apache.cordova.splashscreen"/>
Was that so difficult? Well, the result is not difficult looking code. I just wish the dang config.xml documentation had some examples in it other than just "example" plugin which is a fictitious thing. How about spelling out that you must include org.apache.cordova.device in order for the deviceready event to fire?
<feature name="http://api.phonegap.com/1.0/camera"/>
<feature name="http://api.phonegap.com/1.0/file"/>
<feature name="http://api.phonegap.com/1.0/network"/>
<feature name="http://api.phonegap.com/1.0/notificat...>
<feature name="http://api.phonegap.com/1.0/device"/>
<gap:plugin name="org.apache.cordova.device"/>
<gap:plugin name="org.apache.cordova.camera"/>
<gap:plugin name="org.apache.cordova.device-orientation"/>
<gap:plugin name="org.apache.cordova.file"/>
<gap:plugin name="org.apache.cordova.globalization"/>
<gap:plugin name="org.apache.cordova.inappbrowser"/>
<gap:plugin name="org.apache.cordova.network-information"/>
<gap:plugin name="org.apache.cordova.dialogs"/>
<gap:plugin name="org.apache.cordova.splashscreen"/>
Was that so difficult? Well, the result is not difficult looking code. I just wish the dang config.xml documentation had some examples in it other than just "example" plugin which is a fictitious thing. How about spelling out that you must include org.apache.cordova.device in order for the deviceready event to fire?
- 8 Posts
- 0 Reply Likes
So what is the solution? Jquery seems to work fine, but at least two other javascript libaries we are using do not seem to be loading. The fact that this all works perfect for iphone and just not android, when it used to work on android is super annoying. It makes phonegap build extremely unreliable.
- 8 Posts
- 0 Reply Likes
Alan Neveu, Champion
- 213 Posts
- 11 Reply Likes
All I was saying is that the issue I was experiencing with Android turned out to be due to my config.xml not having the gap:plugin nodes. Once I added those, now my builds work great. I was sharing this with you so that in case you are experiencing the same problem you could benefit from my pain. If not the same problem, I hope that you are able to iron it out soon. Make sense?
- 8 Posts
- 0 Reply Likes
Yes, thanks! We are using phonegap 2.5 still as that was what worked best for us when we built the app earlier in the year and 2.6-2.9 were creating problems with our functionality.
- 3500 Posts
- 40 Reply Likes
- 3500 Posts
- 40 Reply Likes
Assuming the problem is resolved, this issue is now closed.
Create a new issue if you have any other problem with PhoneGap Build.
Thanks
Create a new issue if you have any other problem with PhoneGap Build.
Thanks
This conversation is no longer open for comments or replies.
This conversation is no longer open for comments or replies.
Related Categories
-
PhoneGap Build
- 15111 Conversations
- 275 Followers



