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

Devapp not connecting since Ionic CLI 4.10.0 #3836

Closed
szmolnar opened this issue Jan 30, 2019 · 21 comments
Closed

Devapp not connecting since Ionic CLI 4.10.0 #3836

szmolnar opened this issue Jan 30, 2019 · 21 comments
Labels

Comments

@szmolnar
Copy link

Bug Report

Ionic version:
4.10.0 and 4.10.1

Current behavior:
Devapp is unable to connect

Expected behavior:
should connect

Steps to reproduce:
upgrade ionic to 4.10.0 or 4.10.1
downgrading to 4.0.9 will resolve the issue, and Devapp will connect just fine

Ionic info:

Devapp not connecting

Ionic:

   ionic (Ionic CLI)             : 4.10.1 (/usr/local/lib/node_modules/ionic)
   Ionic Framework               : @ionic/angular 4.0.0
   @angular-devkit/build-angular : 0.12.3
   @angular-devkit/schematics    : 7.2.3
   @angular/cli                  : 7.2.3
   @ionic/angular-toolkit        : 1.3.0

Cordova:

   cordova (Cordova CLI) : 8.0.0
   Cordova Platforms     : android 7.0.0, ios 4.5.5
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 2.3.2, (and 6 other plugins)

System:

   ios-deploy : 2.0.0
   ios-sim    : 7.0.0
   NodeJS     : v8.11.4 (/usr/local/bin/node)
   npm        : 6.7.0
   OS         : macOS High Sierra
   Xcode      : Xcode 10.1 Build version 10B61

Devapp not connecting


Ionic:

   ionic (Ionic CLI)             : 4.10.0
   Ionic Framework               : @ionic/angular 4.0.0
   @angular-devkit/build-angular : 0.12.3
   @angular-devkit/schematics    : 7.2.3
   @angular/cli                  : 7.2.3
   @ionic/angular-toolkit        : 1.3.0

Cordova:

   cordova (Cordova CLI) : 8.0.0
   Cordova Platforms     : android 7.0.0, ios 4.5.5
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 2.3.2, (and 4 other plugins)

System:

   ios-deploy : 2.0.0
   ios-sim    : 7.0.0
   NodeJS     : v8.11.4 (/usr/local/bin/node)
   npm        : 6.7.0
   OS         : macOS High Sierra
   Xcode      : Xcode 10.1 Build version 10B61

Devapp working properly and connecting

Ionic:

   ionic (Ionic CLI)             : 4.9.0
   Ionic Framework               : @ionic/angular 4.0.0
   @angular-devkit/build-angular : 0.12.3
   @angular-devkit/schematics    : 7.2.3
   @angular/cli                  : 7.2.3
   @ionic/angular-toolkit        : 1.3.0

Cordova:

   cordova (Cordova CLI) : 8.0.0
   Cordova Platforms     : android 7.0.0, ios 4.5.5
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 2.3.2, (and 4 other plugins)

System:

   ios-deploy : 2.0.0
   ios-sim    : 7.0.0
   NodeJS     : v8.11.4 (/usr/local/bin/node)
   npm        : 6.7.0
   OS         : macOS High Sierra
   Xcode      : Xcode 10.1 Build version 10B61
@brandyscarney brandyscarney transferred this issue from ionic-team/ionic-framework Jan 30, 2019
@ionitron-bot ionitron-bot bot added the triage label Jan 30, 2019
@elylucas
Copy link
Contributor

Thanks for reporting @szmolnar, we are looking into possible issues with the 4.10 release and would suggest staying on 4.9 for DevApp work for the time being.

@tlancina
Copy link
Contributor

tlancina commented Jan 31, 2019

@szmolnar can you try serving with ionic serve --devapp? We just added support for DevApp in v4 projects, but --devapp is false by default.

@szmolnar
Copy link
Author

@tlancina
Thanks, sharing this info!
I can confirm that ionic serve --devapp is working on ionic (Ionic CLI): 4.10.1

(As for your earlier question before editing your post please check my ionic info. I'm using @ionic/angular-toolkit: 1.3.0)

Is there any added support for capturing console log messages?

@tlancina
Copy link
Contributor

@szmolnar yeah I edited my post after realizing I hadn't looked at your ionic info 😄.

For anyone else who ends up here 👋and --devapp isn't working in a v4 project, you might need to update @ionic/angular-toolkit to version 1.3.0 (I believe the error is something along the lines of unknown option cordova-mock).

As far as console logs go, I believe it's something that would have to be supported by the Angular CLI because that's what is running the serve under the hood.

@tlancina
Copy link
Contributor

tlancina commented Feb 1, 2019

@dwieeb just informed me that we can support console logs for v4 using angular-toolkit to inject a script, and searching just now I found an open issue for it: #3169.

PR's welcome! I also may take a stab at it if I get some free time next week.

@szmolnar going to close as the original issue is intended behavior, feel free to comment/re-open if you're still having issues. Thanks!

@tlancina tlancina closed this as completed Feb 1, 2019
@szmolnar
Copy link
Author

@tlancina are there any progress regarding console logs for v4 by using angular-toolkit ?

Thanks!

@arulwastaken
Copy link

I have error like

> ng run app:ionic-cordova-serve --host=0.0.0.0 --port=8100 --cordova-mock
[ng] Unknown option: '--cordova-mock'

[ERROR] ng has unexpectedly closed (exit code 1).

Ionic:
ionic (Ionic CLI) : 4.10.3 (C:\Users\user\AppData\Roaming\npm\node_modules\ionic)
Ionic Framework : @ionic/angular 4.0.0-rc.1
@angular-devkit/build-angular : 0.13.3
@angular-devkit/schematics : 7.1.4
@angular/cli : 7.1.4
@ionic/angular-toolkit : 1.2.2

Cordova:

cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
Cordova Platforms : not available
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 2.4.0, (and 5 other plugins)

System:

NodeJS : v9.2.0 (C:\Program Files\nodejs\node.exe)
npm : 6.6.0
OS : Windows 10

@imhoffd
Copy link
Contributor

imhoffd commented Feb 25, 2019

@jerrymani33 You must update @ionic/angular-toolkit: https://github.com/ionic-team/angular-toolkit/blob/master/CHANGELOG.md

@arulwastaken
Copy link

@jerrymani33 You must update @ionic/angular-toolkit: https://github.com/ionic-team/angular-toolkit/blob/master/CHANGELOG.md

Solved thanks guys.

@wilfredonoyola
Copy link

Hi guys!! I updated @ionic/angular-toolkit to "^1.4.0", But this did not work when I did "ionic serve -c". Do you know a solution for this?

@tlancina
Copy link
Contributor

tlancina commented Mar 12, 2019

@wilfredonoyola @szmolnar you guys can track #3169 for updates on printing console logs for v4 apps to the terminal (it should land pretty soon).

@Michu1
Copy link

Michu1 commented Mar 12, 2019

I had the same problem and I founded this solution:

  1. Install globally ionic without Cordova: npm install -g ionic
    This installed in my case the version of ionic: 4.11.0

  2. Create your project. ionic start yourProjectName sidemenu

  3. Install the free Ionic Appflow SDK and conect your App? NO

  4. Once the project is created you integrate Cordova: Go in the CLI to the directory of your project.
    Write in the CLI the following commands in this order:

    a) ionic cordova platform rm android
    *If you get error the first time, dont worry, try again the same command.
    Never fails in the second time to me.

    b) ionic cordova platform rm android

    c) ionic cordova platform add android

    d) ionic serve --devapp

    e) Open devApp in your movile and it will see your app without problems.

And this is all. I hope this can help

@kedarjangir
Copy link

@Michu1
This solution works for me.

@victorfrl
Copy link

And for capacitor?

@wilfredonoyola
Copy link

Now, Is DevApp working with Ionic 4?

@ran07
Copy link

ran07 commented Aug 5, 2019

Now, Is DevApp working with Ionic 4?
YES it does !

@senseijames
Copy link

This is still broken.

@senseijames
Copy link

I was not able to get DevApp working with Angular 7; I had to upgrade to Angular 8, which itself (code-wise) was not very time consuming; what took MUCH longer was updating all the Angular and Ionic dependencies (including having to upgrade nodejs and npm) and build settings and whatnot.

I recommend upgrading the latest version of the Ionic CLI globally, as well as npm, nodejs and Angular CLI globally, then generating a new Ionic project. Test if that works in DevApp (it should), then look at its package.json and tsconfig.json/tsconfig.app.json for the dependencies (and devDependencies) you'll need in your older Ionic project.

ionic info

Ionic:

Ionic CLI : 5.2.7 (/Users/admin/.nvm/versions/node/v10.16.0/lib/node_modules/ionic)
Ionic Framework : @ionic/angular 4.9.0
@angular-devkit/build-angular : 0.801.3
@angular-devkit/schematics : 8.1.3
@angular/cli : 8.1.3
@ionic/angular-toolkit : 2.0.0

Cordova:

Cordova CLI : 9.0.0 (cordova-lib@9.0.1)
Cordova Platforms : browser 5.0.4, ios 4.5.5
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 2.2.5, (and 5 other plugins)

Utility:

cordova-res : not installed
native-run : not installed

System:

ios-deploy : 1.9.4
NodeJS : v10.16.0
npm : 6.9.0
OS : macOS High Sierra
Xcode : Xcode 9.3 Build version 9E145

@stla-brazil
Copy link

Its quite simple to solve this.

On terminal:

npm uninstall @ionic/angular-toolkit --save
npm install @ionic/angular-toolkit@1.5.1
ionic serve --devapp

Thats it.

@gabrielbissey
Copy link

For what it's worth,

I played around with a few different versions of @ionic/angular-toolkit. I was unable to successfully run ionic serve --devapp with any of those changes.

I tried running ng run app:serve --host=0.0.0.0 --port=8100, which is a command that allows Angular applications to be accessed on a device from the local network (the --host=0.0.0.0 is the magic part). After that in devapp I manually entered the local IP of my computer running the dev server and I was able to connect.

This is a bit hacky and I'm sure there's a better solution out there.

@DmitriyBobrovskiy
Copy link

In my case ionic serve --devapp stopped working when I changed my network profile from Public to Private (what is kind of strange because in private PC is becoming discoverable etc.).
When I changed back to Public it began working again.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests