Bug for Android Build


#1

I don’t understand what problem I have with this build…

horochovec:mediaglobe$ node --version
v0.12.6

horochovec:mediaglobe$ meteor --version
Meteor 1.1.0.3

horochovec:mediaglobe$ cat .meteor/packages
meteor-platform
autopublish
insecure
iron:router
differential:vulcanize
accounts-password

horochovec:mediaglobe$ VULCANIZE=true meteor build --directory …/mobile-build --mobile-settings mobile-config.js --server http://xyz.meteor.com --verbose
% Running build for platforms: [ ‘android’ ]
% Building the cordova build project
% Bundling the web.cordova program of the app
=> Vulcanize: Importing vulcanized file… -
% Ensuring the cordova build project
% Reading the mobile control file
% Running the mobile control file
% Copying resources for mobile apps
% Writing new config.xml
% Ensuring that platforms in cordova build project are in sync
% Running synchronously: /Users/mediaglobe/.meteor/packages/meteor-tool/.1.1.4.2l3p0l++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/tools/cordova-scripts/cordova.sh [ ‘platform’, ‘list’ ]
% The output of cordova platforms list: Installed platforms: android 3.6.4
Available platforms: amazon-fireos, blackberry10, browser, firefoxos, ios

% Ensuring plugins in the cordova build project are in sync { ‘org.apache.cordova.console’: ‘0.2.13’,
‘org.apache.cordova.file’: ‘1.3.3’,
‘org.apache.cordova.file-transfer’: ‘0.5.0’,
‘org.apache.cordova.device’: ‘0.2.13’,
‘com.meteor.cordova-update’: ‘https://github.com/meteor/com.meteor.cordova-update/tarball/92fe99b7248075318f6446b288995d4381d24cd2’,
‘org.apache.cordova.statusbar’: ‘0.1.10’,
‘org.apache.cordova.splashscreen’: ‘1.0.0’ }
% Getting installed plugins for project
% Running synchronously: /Users/mediaglobe/.meteor/packages/meteor-tool/.1.1.4.2l3p0l++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/tools/cordova-scripts/cordova.sh [ ‘plugin’, ‘list’ ]
% The output of cordova plugins list: com.meteor.cordova-update 0.0.1 "CordovaUpdate"
org.apache.cordova.console 0.2.13 "Console"
org.apache.cordova.device 0.2.13 "Device"
org.apache.cordova.file 1.3.3 "File"
org.apache.cordova.file-transfer 0.5.0 "File Transfer"
org.apache.cordova.splashscreen 1.0.0 "Splashscreen"
org.apache.cordova.statusbar 0.1.10 “StatusBar”

% Will check for cordova-tarball-plugins.json for tarball-url-based plugins previously installed.
% The tarball plugins lock: { ‘com.meteor.cordova-update’: ‘https://github.com/meteor/com.meteor.cordova-update/tarball/92fe99b7248075318f6446b288995d4381d24cd2’ }
% Copying the JS/CSS files one level up
% Removing the www folder
% Writing www/application folder
% Writing index.html
Error while building for mobile platforms: Unexpected token A

Thats it, the message finished at “Unexpected token A”

I have the same problem build the localmarket example project.


#2

Without reading beyond the first couple of lines, you are building with a version of node which is not supported. You should be using 0.10.36 - it may be as simple as that!


#3

Meteor bundles its own Node version, so it should not be affected by the version of a globally installed Node.

As answered on GitHub, this issue was due to passing --mobile-settings mobile-config.js, which confuses the JSON settings file with mobile-config.js.


#4

@martijnwalraven https://github.com/meteor/meteor/issues/5089#issuecomment-136813003


#5

@robfallows I dont find this version of nodejs… https://nodejs.org/en/download/


#6

Well,

New test, same problem:

horochovec:final mediaglobe$ meteor create --example localmarket
localmarket: created.

To run your new app:
cd localmarket
meteor
horochovec:final mediaglobe$ cd localmarket/
horochovec:localmarket mediaglobe$ meteor build --directory …/mobile-build --server http://horochovec.meteor.com

/Users/mediaglobe/.meteor/packages/meteor-tool/.1.1.4.2l3p0l++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/fibers/future.js:278
throw(ex);
^
Error: ENOENT, readdir '/Users/mediaglobe/Projects/final/localmarket/.meteor/local/cordova-build/platforms/android/ant-build’
at Object.Future.wait (/Users/mediaglobe/.meteor/packages/meteor-tool/.1.1.4.2l3p0l++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/fibers/future.js:398:15)
at Object.wrapper (/Users/mediaglobe/.meteor/packages/meteor-tool/.1.1.4.2l3p0l++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/tools/files.js:1350:24)
at findApkPath (/Users/mediaglobe/.meteor/packages/meteor-tool/.1.1.4.2l3p0l++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/tools/commands.js:965:30)
at /Users/mediaglobe/.meteor/packages/meteor-tool/.1.1.4.2l3p0l++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/tools/commands.js:950:21
at Array.forEach (native)
at Function..each..forEach (/Users/mediaglobe/.meteor/packages/meteor-tool/.1.1.4.2l3p0l++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/underscore/underscore.js:79:11)
at buildCommand (/Users/mediaglobe/.meteor/packages/meteor-tool/.1.1.4.2l3p0l++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/tools/commands.js:933:29)
at Command.main.registerCommand._.extend.name [as func] (/Users/mediaglobe/.meteor/packages/meteor-tool/.1.1.4.2l3p0l++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/tools/commands.js:746:12)
at /Users/mediaglobe/.meteor/packages/meteor-tool/.1.1.4.2l3p0l++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/tools/main.js:1363:23
- - - - -
horochovec:localmarket mediaglobe$ meteor --version
Meteor 1.1.0.3
horochovec:localmarket mediaglobe$ java -version
java version "1.8.0_60"
Java™ SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot™ 64-Bit Server VM (build 25.60-b23, mixed mode)
horochovec:localmarket mediaglobe$


#7

It may make more sense to use the 1.2 RC at this point (meteor update --release METEOR@1.2-rc.11), because there have been some major changes to the architecture of the Cordova integration. Let me know if you still have issues building after updating.


#8

@martijnwalraven

horochovec:final mediaglobe$ meteor create --example localmarket
localmarket: created.

To run your new app:
cd localmarket
meteor
horochovec:final mediaglobe$ cd localmarket
horochovec:localmarket mediaglobe$ meteor update --release METEOR@1.2-rc.11

Changes to your project’s package version selections from updating the release:

accounts-base upgraded from 1.2.0 to 1.2.1-rc.2
accounts-oauth upgraded from 1.1.5 to 1.1.6-rc.0
accounts-twitter upgraded from 1.0.4 to 1.0.5-rc.0
autoupdate upgraded from 1.2.1 to 1.2.3-rc.1
babel-compiler added, version 5.8.22-rc.1
babel-runtime added, version 0.1.4-rc.0
base64 upgraded from 1.0.3 to 1.0.4-rc.0
binary-heap upgraded from 1.0.3 to 1.0.4-rc.0
blaze upgraded from 2.1.2 to 2.1.3-rc.0
blaze-tools upgraded from 1.0.3 to 1.0.4-rc.0
boilerplate-generator upgraded from 1.0.3 to 1.0.4-rc.1
caching-compiler added, version 1.0.0-rc.0
caching-html-compiler added, version 1.0.1-rc.0
callback-hook upgraded from 1.0.3 to 1.0.4-rc.0
check upgraded from 1.0.5 to 1.0.6-rc.0
coffeescript upgraded from 1.0.6 to 1.0.8-rc.3
ddp upgraded from 1.1.0 to 1.2.1-rc.0
ddp-client added, version 1.2.1-rc.1
ddp-common added, version 1.2.1-rc.0
ddp-rate-limiter added, version 1.0.0-rc.0
ddp-server added, version 1.2.1-rc.1
deps upgraded from 1.0.7 to 1.0.8-rc.0
diff-sequence added, version 1.0.1-rc.0
ecmascript added, version 0.1.3-rc.2
ecmascript-collections added, version 0.1.5-rc.1
ejson upgraded from 1.0.6 to 1.0.7-rc.0
email upgraded from 1.0.6 to 1.0.7-rc.0
fastclick upgraded from 1.0.3 to 1.0.7-rc.0
geojson-utils upgraded from 1.0.3 to 1.0.4-rc.0
html-tools upgraded from 1.0.4 to 1.0.5-rc.0
htmljs upgraded from 1.0.4 to 1.0.5-rc.1
http upgraded from 1.1.0 to 1.1.1-rc.1
id-map upgraded from 1.0.3 to 1.0.4-rc.0
jquery upgraded from 1.11.3_2 to 1.11.4-rc.0
jquery-waypoints upgraded from 1.0.3 to 1.0.4-rc.0
json removed from your project
launch-screen upgraded from 1.0.2 to 1.0.3-rc.1
less* upgraded from 1.0.14 to 2.5.0-rc.3_1
livedata upgraded from 1.0.13 to 1.0.14-rc.0
localstorage upgraded from 1.0.3 to 1.0.4-rc.0
logging upgraded from 1.0.7 to 1.0.8-rc.1
mdg:camera upgraded from 1.1.4 to 1.1.5
meteor upgraded from 1.1.6 to 1.1.7-rc.1
meteor-platform upgraded from 1.2.2 to 1.2.3-rc.0
minifiers upgraded from 1.1.5 to 1.1.6-rc.1
minimongo upgraded from 1.0.8 to 1.0.9-rc.0
mobile-status-bar upgraded from 1.0.3 to 1.0.5-rc.1
mongo upgraded from 1.1.0 to 1.1.1-rc.3
mongo-id added, version 1.0.1-rc.0
npm-mongo added, version 1.4.39-rc.0_1
oauth upgraded from 1.1.4 to 1.1.6-rc.3
oauth1 upgraded from 1.1.4 to 1.1.5-rc.0
observe-sequence upgraded from 1.0.6 to 1.0.7-rc.0
ordered-dict upgraded from 1.0.3 to 1.0.4-rc.0
promise added, version 0.4.8-rc.0
random upgraded from 1.0.3 to 1.0.4-rc.0
rate-limit added, version 1.0.0-rc.0
reactive-dict upgraded from 1.1.0 to 1.1.1-rc.0
reactive-var upgraded from 1.0.5 to 1.0.6-rc.0
reload upgraded from 1.1.3 to 1.1.4-rc.0
retry upgraded from 1.0.3 to 1.0.4-rc.0
routepolicy upgraded from 1.0.5 to 1.0.6-rc.0
service-configuration upgraded from 1.0.4 to 1.0.5-rc.0
session upgraded from 1.1.0 to 1.1.1-rc.0
spacebars upgraded from 1.0.6 to 1.0.7-rc.0
spacebars-compiler upgraded from 1.0.6 to 1.0.7-rc.0
templating upgraded from 1.1.1 to 1.1.2-rc.4
templating-tools added, version 1.0.0-rc.0
tracker upgraded from 1.0.7 to 1.0.8-rc.0
twitter upgraded from 1.1.4 to 1.1.5-rc.0
ui upgraded from 1.0.6 to 1.0.7-rc.0
underscore upgraded from 1.0.3 to 1.0.4-rc.0
url upgraded from 1.0.4 to 1.0.5-rc.0
webapp upgraded from 1.2.0 to 1.2.2-rc.2
webapp-hashing upgraded from 1.0.3 to 1.0.4-rc.0

  • These packages have been updated to new versions that are not backwards
    compatible.
    localmarket: updated to Meteor 1.2-rc.11.

– Notice –

1.2.0: Meteor 1.2 includes various changes to the Cordova integration.

   Cordova tools, platforms and plugins have been updated to the latest versions. This may require you to make changes to your app. For details, see the Cordova release notes
   for for the different versions: https://cordova.apache.org/#news 
   
   As part of moving to npm, many Cordova plugins have been renamed. Meteor should perform conversions automatically, but you may want to be aware of this to avoid surprises.
   See https://cordova.apache.org/announcements/2015/04/21/plugins-release-and-move-to-npm.html for more information.
   
   The bundled Android tools have been removed and a system-wide install of the Android SDK is now required. This should make it easier to keep the development toolchain up
   to date and helps avoid some difficult to diagnose failures.
   If you don't have your own Android tools installed already, you can find more information about installing the Android SDK for your platform here:
   https://github.com/meteor/meteor/wiki/Mobile-Development-Install:-Android-on-Mac

/Users/mediaglobe/.meteor/packages/meteor-tool/.1.1.7-rc.11.1ftfs9m++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/fibers/future.js:245
throw(ex);
^
TypeError: Cannot call method ‘hasMessages’ of undefined
at Object.upgradersByName.1.2.0-cordova-changes (/tools/upgraders.js:219:18)
at Object.exports.runUpgrader (/tools/upgraders.js:242:32)
at /tools/cli/commands-packages.js:1520:15
at Array.forEach (native)
at Function..each..forEach (/Users/mediaglobe/.meteor/packages/meteor-tool/.1.1.7-rc.11.1ftfs9m++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/underscore/underscore.js:79:11)
at maybeUpdateRelease (/tools/cli/commands-packages.js:1519:5)
at Command.main.registerCommand.name [as func] (/tools/cli/commands-packages.js:1570:29)
at /tools/cli/main.js:1377:23
horochovec:localmarket mediaglobe$ meteor build --directory …/mobile-build --server http://horochovec.meteor.com

Changes to your project’s package version selections:

blaze-html-templates added, version 1.0.1-rc.0
hot-code-push added, version 1.0.0-rc.0
meteor-base added, version 1.0.1-rc.0
meteor-platform removed from your project
mobile-experience added, version 1.0.1-rc.0
standard-minifiers added, version 1.0.0-rc.1

% cordova version not detected (lacks script “/Users/mediaglobe/Projects/final/localmarket/.meteor/local/cordova-build/platforms/ios/cordova/version” ), continuing.
% Failed to install ‘cordova-plugin-inappbrowser’:CordovaError: The provided path “/Users/mediaglobe/Projects/final/localmarket/.meteor/local/cordova-build/platforms/ios” is not a Cordova iOS project.
at new ios_parser (/Users/mediaglobe/.meteor/packages/meteor-tool/.1.1.7-rc.11.1ftfs9m++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/cordova-lib/src/cordova/metadata/ios_parser.js:48:15)
at new PlatformProjectAdapter (/Users/mediaglobe/.meteor/packages/meteor-tool/.1.1.7-rc.11.1ftfs9m++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/cordova-lib/src/platforms/platforms.js:61:19)
at Object.getPlatformProject (/Users/mediaglobe/.meteor/packages/meteor-tool/.1.1.7-rc.11.1ftfs9m++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/cordova-lib/src/platforms/platforms.js:97:23)
at handleInstall (/Users/mediaglobe/.meteor/packages/meteor-tool/.1.1.7-rc.11.1ftfs9m++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/cordova-lib/src/plugman/install.js:563:36)
at /Users/mediaglobe/.meteor/packages/meteor-tool/.1.1.7-rc.11.1ftfs9m++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/cordova-lib/src/plugman/install.js:363:28
at _fulfilled (/Users/mediaglobe/.meteor/packages/meteor-tool/.1.1.7-rc.11.1ftfs9m++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/q/q.js:787:54)
at self.promiseDispatch.done (/Users/mediaglobe/.meteor/packages/meteor-tool/.1.1.7-rc.11.1ftfs9m++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/q/q.js:816:30)
at Promise.promise.promiseDispatch (/Users/mediaglobe/.meteor/packages/meteor-tool/.1.1.7-rc.11.1ftfs9m++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/q/q.js:749:13)
at /Users/mediaglobe/.meteor/packages/meteor-tool/.1.1.7-rc.11.1ftfs9m++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/q/q.js:509:49
at flush (/Users/mediaglobe/.meteor/packages/meteor-tool/.1.1.7-rc.11.1ftfs9m++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/q/q.js:108:17)
at process._tickCallback (node.js:448:13)
=> Errors executing Cordova commands:

While adding plugin cordova-plugin-inappbrowser@1.0.1 to Cordova project:
Cordova error: The provided path “/Users/mediaglobe/Projects/final/localmarket/.meteor/local/cordova-build/platforms/ios” is not a Cordova iOS project.
(If the error message contains suggestions for a fix, note that this may not apply to the Meteor integration. You can try running again with the --verbose option to help
diagnose the issue.)


#9

New approach

horochovec:localmarket mediaglobe$ meteor remove-platform ios
=> Errors executing Cordova commands:

While listing platform versions in Cordova project:
Error: Could not find command '/Users/mediaglobe/Projects/final/localmarket/.meteor/local/cordova-build/platforms/ios/cordova/version’
at errnoException (child_process.js:1011:11)
at Process.ChildProcess._handle.onexit (child_process.js:802:34)
horochovec:localmarket mediaglobe$ rm -rf .meteor/local/cordova-build/
horochovec:localmarket mediaglobe$ meteor remove-platform ios
ios: removed platform
horochovec:localmarket mediaglobe$ meteor build --directory …/mobile-build --server http://horochovec.meteor.com
horochovec:localmarket mediaglobe$ ls -lah …/mobile-build/android/
total 11472
drwxr-xr-x 5 mediaglobe staff 170B 3 Set 10:32 .
drwxr-xr-x 5 mediaglobe staff 170B 3 Set 11:00 …
-rw-r–r-- 1 mediaglobe staff 231B 3 Set 11:01 README
drwxr-xr-x 22 mediaglobe staff 748B 3 Set 10:32 project
-rw-r–r-- 1 mediaglobe staff 5,6M 3 Set 11:01 release-unsigned.apk
horochovec:localmarket mediaglobe$


#10

Thanks for the report. Turns out there was a bug in the upgrader that throws an exception when there is no cordova-plugins file.

I’m glad rm -rf .meteor/local/cordova-build seems to have fixed your issue, but this should be done automatically by the upgrader. And you shouldn’t have to remove the iOS platform. Does the app still build if you add it again?


#11

If I use the Meteor 1.1.0.3, the build for Android don’t work,

If i use the Meteor 1.2-rc.11, I have many problems with vulcanize, polymer, etc …

Discouraging …


#12

I finally did,

I had to update the Meteor for the 1.2-rc.11 version and remove plugins: mquandalle:bower, differential:vulcanize and make the download of Polymer and vulcanize manually.

After that manually added the minified file with the Polymer within the project using the Vulcanize via node because at the time of build with the plugins, there is a tremendous confusion and does not occur minification and the entire contents of the folder public/ is added to the project.

Now I will create a side project to the download maintenance of Polymer and its minification (vulcanize) via gulp, and add the result within the Meteor project.