Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ionic run anroid - command is successfully executed, but ionic is not trying to install the apk on phone with node v5.8.0 #920

Closed
petervojtek opened this issue Apr 8, 2016 · 15 comments

Comments

@petervojtek
Copy link

Hello,

I have ionic 2 project and ionic run anroid seems to end up prematurely, but its exit status is 0 and no errors are displayed.
My steps:

i fetch the sample project via ionic start MyIonic2Project tutorial --v2.

I add anroid platform, it performs successfully:

$ ionic platform add android
Adding android project...
Creating Cordova project for the Android platform:
    Path: platforms/android
    Package: io.ionic.starter
    Name: V2 Test
    Activity: MainActivity
    Android target: android-22
Copying template files...
Android project created with cordova-android@4.1.1
Saving platform to package.json file

I connect smartphone and run ionic run android and this is the output:

$ ionic run android
WARN: ionic.config.js has been deprecated, you can remove it. 

Running 'run:before' gulp task before run 
[12:07:03] Starting 'clean'...
[12:07:03] Finished 'clean' after 18 ms
[12:07:03] Starting 'build'...
[12:07:03] Starting 'sass'...
[12:07:03] Starting 'html'...
[12:07:03] Starting 'fonts'...
[12:07:03] Starting 'scripts'...
[12:07:03] Finished 'scripts' after 78 ms
[12:07:03] Finished 'html' after 104 ms
[12:07:03] Finished 'fonts' after 124 ms
[12:07:05] Finished 'sass' after 1.53 s


[12:07:31] Finished 'build' after 28 s
[12:07:31] Starting 'run:before'...
[12:07:31] Finished 'run:before' after 8.6 μs

and that is all.
the ionic run android command exit status is 0, and ionic made no attempt to build the apk and upload it to the smartphone.

What is suspicious to me is that the directory platforms/android has only 2.8MB and 211 items. Other ionic projects i played with had this directory much larger (hundreds of MB).

nodejs: 5.8.0., npm: 3.7.3, ubuntu 14.04 32bit, ionic version 2.0.0-beta.22

Update:
When I downgrade nodejs version from 5.8.0 to v0.12.7, it builds and deploys the apk to android smartphone properly.

@petervojtek petervojtek changed the title ionic run anroid - command is successfully executed, but ionic is not trying to install the apk on phone ionic run anroid - command is successfully executed, but ionic is not trying to install the apk on phone with node v5.8.0 Apr 11, 2016
@tlancina
Copy link
Contributor

Hey there, thanks for the issue. Does running cordova run android fail as well?

@petervojtek
Copy link
Author

hi @tlancina , cordova run android has the same behaviour -- no attempt to build the apk and deploy it to android device but exit status is 0.

$ cordova run android
# no output to console

cordova version: 5.3.3

I guess I should report this to cordova because it is not ionic issue?

@jgw96
Copy link
Contributor

jgw96 commented May 2, 2016

Hello @petervojtek ! Did you get a chance to talk to the cordova team about this?

@petervojtek
Copy link
Author

hi @jgw96 , no as I did not received response for my last question.

However now I tried to find a way how to submit issue to apache cordova jira, but the help page says "click the blue "Create" button at the top of the Cordova JIRA page to create an issue."

However as a logger user, I see there only red Create button and by clicking it I am allowed to create only "Create Service Desk Request'.

@jgw96
Copy link
Contributor

jgw96 commented May 3, 2016

@petervojtek ahh OK sorry about that. So I'm guessing you have all the Android tools installed on your machine correct? Android tools being adb, fast boot etc?

@petervojtek
Copy link
Author

petervojtek commented May 3, 2016

@jgw96 , I hope my environment is setup properly regarding android deployment because when I use nodejs v0.12.7, I can run cordova run android successfully and the ionic app is deployed to android smartphone.

After then when I switch nodejs version (via nvm) to v5.8.0, cordova run android command provides no output and finishes immidiately, with exit status 0.

I do no other changes to the enviroment, only change nodejs using nvm.

@jgw96
Copy link
Contributor

jgw96 commented May 3, 2016

hmmm sounds like it is set up correctly then. Does it only happen with this app? Or does it happen with any ionic app?

@petervojtek
Copy link
Author

So far I played with two Ionic 2 apps and I experience the issue with both of them:

  • the vanilla ionic start MyIonic2Project tutorial --v2 as described in my first comment -- I made no changes to the source code of the sample app, just ran ionic run android.
  • one other app I develop using Ionic 2

@jgw96
Copy link
Contributor

jgw96 commented May 9, 2016

@petervojtek Would you mind running ionic start TestProject blank --v2 and then trying to run this on your android device? I am trying to narrow it down to an issue with the tutorial template. Thanks!

@petervojtek
Copy link
Author

@jgw96 , here is outcome for your request:

peter@ubuntu:~/repos$ nvm list
->      v0.12.7
         v5.8.0
         system
default -> 0.12.7 (-> v0.12.7)
node -> stable (-> v5.8.0) (default)
stable -> 5.8 (-> v5.8.0) (default)
iojs -> N/A (default)

peter@ubuntu:~/repos$ nvm use stable
Now using node v5.8.0 (npm v3.7.3)

peter@ubuntu:~/repos$ ionic start TestProject blank --v2

One awesome Ionic app coming right up...

Creating Ionic app in folder /home/peter/repos/TestProject based on blank project
Downloading: https://github.com/driftyco/ionic2-app-base/archive/master.zip
[=============================]  100%  0.0s
Downloading: https://github.com/driftyco/ionic2-starter-blank/archive/master.zip
Installing npm packages...



Adding initial native plugins
[=============================]  100%  0.0s

Saving your Ionic app state of platforms and plugins
Saved platform
Saved plugins
Saved package.json

♬ ♫ ♬ ♫  Your Ionic app is ready to go! ♬ ♫ ♬ ♫

Make sure to cd into your new app directory:
  cd TestProject

To run your app in the browser (great for initial development):
  ionic serve

To run on iOS:
  ionic run ios

To run on Android:
  ionic run android

To test your app on a device easily, try Ionic View:
  http://view.ionic.io

New! Add push notifications, update your app remotely, and package iOS and Android apps with the Ionic Platform!
https://apps.ionic.io/signup

New to Ionic? Get started here: http://ionicframework.com/docs/v2/getting-started

peter@ubuntu:~/repos$ cd TestProject/

peter@ubuntu:~/repos/TestProject$ ionic platform add android
Adding android project...
Creating Cordova project for the Android platform:
    Path: platforms/android
    Package: com.ionicframework.testproject896631
    Name: TestProject
    Activity: MainActivity
    Android target: android-22
Copying template files...
Android project created with cordova-android@4.1.1
Saving platform to package.json file

peter@ubuntu:~/repos/TestProject$ ionic run android

Running 'run:before' gulp task before run 
[21:33:45] Starting 'clean'...
[21:33:45] Finished 'clean' after 38 ms
[21:33:45] Starting 'build'...
[21:33:45] Starting 'sass'...
[21:33:45] Starting 'html'...
[21:33:45] Starting 'fonts'...
[21:33:45] Starting 'scripts'...
[21:33:45] Finished 'html' after 102 ms
[21:33:45] Finished 'scripts' after 97 ms
[21:33:45] Finished 'fonts' after 135 ms
[21:33:46] Finished 'sass' after 1.36 s
[21:34:03] Finished 'build' after 18 s
[21:34:03] Starting 'run:before'...
[21:34:03] Finished 'run:before' after 10 μs

peter@ubuntu:~/repos/TestProject$ echo $?
0

@jgw96
Copy link
Contributor

jgw96 commented May 9, 2016

@petervojtek Thanks for working with me and thanks for your patience (: Would you mind deleting your node_modules folder in the project we just created above, and then run npm install again while using node 5.8.0 please?

@petervojtek
Copy link
Author

here is the full shell output of rm -r node_modules/ && npm install

@sjaanus
Copy link

sjaanus commented Aug 10, 2016

I have the same exact issue.

@jdmadriz
Copy link

jdmadriz commented Nov 1, 2017

For me, it was a missing dependency on the package.json

@ionitron-bot
Copy link

ionitron-bot bot commented Jul 12, 2018

Thanks for the issue! This issue appears to be associated with an old version of the Ionic CLI. Please update to the latest CLI version, which supports all versions of the Ionic Framework. If the issue is relevant and if it persists after updating to the latest CLI version, please create a new issue.

Thank you for using Ionic!

@ionitron-bot ionitron-bot bot closed this as completed Jul 12, 2018
@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Jul 12, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants