Unable to deploy to Android


#1

When I meteor run android-device, with my attached phone with debug-mode enabled, I consistently get the below:

   While running Cordova app for platform Android with options --device:
   Error: Command failed: /Users/me/Meteor/tmoy/.meteor/local/cordova-build/platforms/android/cordova/run --device
   Note: Some input files use or override a deprecated API.
   Note: Recompile with -Xlint:deprecation for details.
   Note: Some input files use or override a deprecated API.
   Note: Recompile with -Xlint:deprecation for details.
   Note: Some input files use unchecked or unsafe operations.
   Note: Recompile with -Xlint:unchecked for details.
   { CordovaError: Failed to install apk to device: [  0%] /data/local/tmp/android-debug.apk
   [  0%] /data/local/tmp/android-debug.apk
   ...
   [ 14%] /data/local/tmp/android-debug.apk
   [ 14%] /data/local/tmp/an
   at ChildProcess.exitCallback (/tools/utils/processes.js:151:23)
   at emitTwo (events.js:126:13)
   at ChildProcess.emit (events.js:214:7)
   at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
                                              
/Users/me/.meteor/packages/coffeescript/.1.0.17.1nqxujc.8yuxj++os+web.browser+web.cordova/plugin.compileCoffeescript.os/npm/node_modules/meteor/promise/node_modules/meteor-promise/promise_server.js:116
      throw error;
      ^
ExitWithCode:1

When I…

meteor build --server=https://myapp.meteorapp.com/ ../../myfolder

followed by jarsigner and zipalign, followed by uploading the .apk to Google Play, downloading it and starting the app on my phone, I get, as a popup on top of the splash screen, …

Application Error

There was a network error. (http://localhost:12264)

All this is preventing me from updating my app on Google Play.

How to resolve this?


#2

If you are using Android SDK 27 & java 9x, you may try downgrading to SDK 26 & Java 8x. It worked for me like this…


#3

I’m on SDK 26 and Java 8.something :frowning:


#4

some more info, I had to remove the java 9x folder from the sdk path for it to make an android build


#5

Thanks.

I just pushed another app to Google Play without a hitch. Only difference is that that one is still on 1.6.0.1.


#6

I waited ten days, tried again. Deployed successfully. :confused:


#7

Good for you !!

I was able to make an android build, got it on the device but … problems in connecting to the server in the --server=ip:port.

Im getting “Appliation Error, There was a network error: (http://localhost:12840)”.

Wondering when I installed the debug build in the device, why is it still trying to connect to localhost.
I thought it should be trying to connect to ip:port provided in the --server options.

:frowning:


#8

Yeah. Very annoying. Perhaps a tip: I also regularly have to remove the previous cordova build in the .meteor folder to get to a successful build.


#9

eek. I’ve just hit this error. Any more knowledge since then? Or do I just wait 10 days? :slight_smile:


#10

You cannot run a development app and a production app on the same phone because it will use the same port.

To know why, read “How does it work?” and “What port will your app be served from?” sections to understand why


#11

I kept on getting different results each time a I built my app, the app would either give the network error or login would be broken.
I kept resetting the project rebuilding the app up until it just finally worked.