Cordova build error - stalls at loading screen (iOS & Android)


#1

When running or building for iOS or Android I get this issue: The Cordova loader is stuck, with the spinner going around. I can see that it has connected the server, but it never goes into the Meteor application fully.

Related issue: https://github.com/meteor/meteor/issues/3709
Possibly related: http://stackoverflow.com/questions/28511910/meteorcordova-deviceready-has-not-fired-on-android
Possibly related: https://github.com/meteor/meteor/issues/3711

iOS example:

Error reading version file Error: Failed to resolve entry: file:///Users/robin/Library/Developer/CoreSimulator/Devices/21EE9162-A7FD-4C92-9C32-81DE74AF93CB/data/Containers/Data/Application/DCED9A8A-0D12-437C-BFAA-3014E5B9955A/Library/NoCloud/meteor/version
Mar 10 14:20:03 Robins-MacBook-Air.local Wavy App[22594]: METEOR CORDOVA DEBUG (meteor_cordova_loader.js) Couldn't load from the manifest, falling back to the bundled assets.
Mar 10 14:20:03 Robins-MacBook-Air.local Wavy App[22594]: start serving (
	    "/Users/robin/Library/Developer/CoreSimulator/Devices/21EE9162-A7FD-4C92-9C32-81DE74AF93CB/data/Containers/Bundle/Application/B4626D41-493C-48F6-AAEB-C42578F062E0/Wavy App.app/www/application/",
	    "/Users/robin/Library/Developer/CoreSimulator/Devices/21EE9162-A7FD-4C92-9C32-81DE74AF93CB/data/Containers/Bundle/Application/B4626D41-493C-48F6-AAEB-C42578F062E0/Wavy App.app/www/"
	)
Mar 10 14:20:03 Robins-MacBook-Air.local Wavy App[22594]: METEOR CORDOVA DEBUG (meteor_cordova_loader.js) Loading from url: http://meteor.local

The file that it’s trying to load doesn’t exist:

/Users/robin/Library/Developer/CoreSimulator/Devices/21EE9162-A7FD-4C92-9C32-81DE74AF93CB/data/Containers/Data/Application/DCED9A8A-0D12-437C-BFAA-3014E5B9955A/Library/NoCloud/meteor/version

Any ideas are much appreciated.


#2

The issue was solved. When building for Android I got better feedback as to what was failing:

I20150310-15:42:50.372(1) (android:http://meteor.local/packages/mongo.js:121) Uncaught Error: use "new" to construct a Mongo.Collection
I20150310-15:42:50.377(1) (android:http://meteor.local/packages/mongo.js:121) Uncaught Error: use "new" to construct a Mongo.Collection
I20150310-15:42:50.379(1)

I’m using sewdn:collection-behaviours which (not sure if it’s this package, or some of it’s dependencies) require all Collection-definitions to use the new “Mongo” definition instead of the deprecated “Meteor” definition.

Thanks to https://github.com/dotnetwise for pointing out that it’s often another related issue which causes this.