Meteor 1.2.0.2 android problem

Hi everyone, I’ve got a problem with a building of my android app. When I write meteor run android --verbose I get this error. Can someone help me? Thanks. Alessandro

Error:
Errors executing Cordova commands:

While adding plugin cordova-plugin-device@1.0.1 to Cordova project:
Cordova error: Failed to fetch plugin cordova-plugin-device@1.0.1 via registry.
Probably this is either a connection problem, or plugin spec is incorrect.
Check your connection and plugin name/version/URL.
undefined
(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.)

ExitWithCode:1

Can you try running with --verbose to get more output? Not sure where that undefined comes from.

Thanks for help me! Sure I write here the output. This morning while I was adding platform android to my project I got this response.


Adding platform Android to Cordova project
=> Errors executing Cordova commands:

While adding platform Android to Cordova project:
Cordova error: CordovaError: Failed to fetch platform android
Probably this is either a connection problem, or platform spec is incorrect.
Check your connection and platform name/version/URL.
undefined
at
/home/alexrozio96/.meteor/packages/meteor-tool/.1.1.9.ltydx3++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/cordova-lib/src/cordova/platform.js:270:25
at _rejected
(/home/alexrozio96/.meteor/packages/meteor-tool/.1.1.9.ltydx3++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/q/q.js:797:24)
at
/home/alexrozio96/.meteor/packages/meteor-tool/.1.1.9.ltydx3++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/q/q.js:823:30
at Promise.when
(/home/alexrozio96/.meteor/packages/meteor-tool/.1.1.9.ltydx3++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/q/q.js:1035:31)
at Promise.promise.promiseDispatch
(/home/alexrozio96/.meteor/packages/meteor-tool/.1.1.9.ltydx3++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/q/q.js:741:41)
at
/home/alexrozio96/.meteor/packages/meteor-tool/.1.1.9.ltydx3++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/q/q.js:557:44
at flush
(/home/alexrozio96/.meteor/packages/meteor-tool/.1.1.9.ltydx3++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/q/q.js:108:17)
at process._tickCallback (node.js:448:13)
(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.)

@alexrozio96 Did you try to remove your build, cordova-build and plugin-cache folder in .meteor/local? Sometimes that works.

Thanks for the help but it doesn’t work. I’ll try to reinstall meteor and android studio

If that doesnt work, try removing the android platform. then do a meteor reset, and then add the android platform back to the project and try again, that sometimes helps when I get strange cordova errors to do with plugins.

Note : Meteor reset will reset your entire project. So if you need stuff in your local DB, dont do this, or at least back it up.

I am also having troubles with the build (and “run android-device --mobile-server mypage.meteor.com” returns same error)

meteor build . --server mypage.meteor.com

WARNING: The output directory is under your source tree.

=> Errors executing Cordova commands:

While building Cordova app for platform Android:
Error: /Users/alexander/Dev/web/mypage/.meteor/local/cordova-build/platforms/android/cordova/build: Command failed with exit code 8 Error output:
Exception in thread “main” java.lang.RuntimeException: java.util.zip.ZipException: error in opening zip file
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:78)
at org.gradle.wrapper.Install.createDist(Install.java:47)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:129)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:48)
Caused by: java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.(ZipFile.java:220)
at java.util.zip.ZipFile.(ZipFile.java:150)
at java.util.zip.ZipFile.(ZipFile.java:164)
at org.gradle.wrapper.Install.unzip(Install.java:160)
at org.gradle.wrapper.Install.access$400(Install.java:29)
at org.gradle.wrapper.Install$1.call(Install.java:70)
at org.gradle.wrapper.Install$1.call(Install.java:47)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)
… 3 more

/Users/alexander/Dev/web/my/.meteor/local/cordova-build/platforms/android/cordova/node_modules/q/q.js:126
throw e;
^
Error code 1 for command: /Users/alexander/Dev/web/mypage/.meteor/local/cordova-build/platforms/android/gradlew with args:
cdvBuildRelease,-b,/Users/alexander/Dev/web/mypage/.meteor/local/cordova-build/platforms/android/build.gradle,-Dorg.gradle.daemon=true
at ChildProcess.whenDone
(/Users/alexander/.meteor/packages/meteor-tool/.1.1.9.iac3tq++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/cordova-lib/src/cordova/superspawn.js:139:23)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:766:16)
at Socket. (child_process.js:979:11)
at Socket.emit (events.js:95:17)
at Pipe.close (net.js:466:12)

I did

clear all cached files in .meteor/local
meteor remove-platform android
meteor reset
meteor add-platform android

still it persists. Is it coming from the gradle side? How can I fix the gradle setup for meteor?

same issue here

Hi everyone, I’ve finally fixed the problem about this error:

Errors executing Cordova commands:

While adding plugin
"https://github.com/meteor/com.meteor.cordova-update.git#16c53f53e438fc8b1b9c768de36f0a8974e38b49"
to Cordova project:
Cordova error: Failed to fetch plugin
https://github.com/meteor/com.meteor.cordova-update.git via git.
Either there is a connection problems, or plugin spec is incorrect:
Error: “git” command line tool is not installed: make sure it is accessible
on your PATH.
(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.)

ExitWithCode:1


this is a solution.

1)You have to download manually from here : https://github.com/meteor/com.meteor.cordova-update.git.
2) You have to create a folder in your app directory named “private” and inside it, you have to make another folder called Plugins.
3) Inside of plugins folder copy that downloaded package, with his full name "com.meteor.cordova-update-master"
4) Later open the file “cordova-plugins” that you can find inside a .meteor hidden folder of your project.
5) Edit it with a text editor and add this string : com.meteor.cordova-update@file://./private/plugins/com.meteor.cordova-update-master

then run : meteor run android and all will work fine.
With this method, the plugin will be not downloaded from git, but it will be searched inside your private folder.

That will work, but it’s not a great solution because you will be stuck with the current version of the plugin when you upgrade Meteor.

The error message seems to suggest you do not have git installed:

Error: "git" command line tool is not installed: make sure it is accessible
on your PATH.

Have you tried installing it and adding it to your path?

For my issue

rm -rf ~/.gradle

solved it. Thanks heaps @martijnwalraven !

I didn’t try, but now I’ve create a new project and installing git all have worked fine without adding string and ecc.

Thank you!

I don’t know what happen, but when I run by “sudo meteor …”. It’s worked.
I think have many issue about permission rule when meteor update.

Please try it.

This one worked out for me, thanks @XTA