Skip to content

Ionic 4 won't work in android 5 #15438

Closed
Closed

Description

@santosh-hegde

Bug Report

Ionic Info
Run ionic info from a terminal/cmd prompt and paste the output below.

Ionic:

   ionic (Ionic CLI)          : 4.1.1 (/Users/myname/.nvm/versions/node/v9.4.0/lib/node_modules/ionic)
   Ionic Framework            : @ionic/angular 4.0.0-beta.3
   @angular-devkit/core       : 0.7.4
   @angular-devkit/schematics : 0.7.4
   @angular/cli               : 6.1.5
   @ionic/ng-toolkit          : 1.0.6
   @ionic/schematics-angular  : 1.0.5

Cordova:

   cordova (Cordova CLI) : 8.0.0
   Cordova Platforms     : android 7.0.0, browser 5.0.4
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.1.2, cordova-plugin-ionic-webview 2.1.0, (and 4 other plugins)

System:

   Android SDK Tools : 26.1.1 (/Users/myname/Library/Android/sdk/)
   NodeJS            : v9.4.0 (/Users/myname/.nvm/versions/node/v9.4.0/bin/node)
   npm               : 6.4.0
   OS                : macOS High Sierra

Describe the Bug
When I do ionic serve and open it in Android Lollipop's browser, Its giving below error.
Uncaught SyntaxError: Use of const in strict mode. vendor.js:71605

Activity

  1. yuankunluo commented on Sep 2, 2018

    @yuankunluo

    Cordova-ionic-webview plugin does not work well on Android under version 7.0 . Because Android system webview on these devices are outdated. This is a big problem for us, Android 6 is currently the most popular Android OS

  2. c350156378 commented on Sep 2, 2018

    @c350156378

    we may need another crosswalk?

  3. santosh-hegde commented on Sep 2, 2018

    @santosh-hegde
    Author

    @yuankunluo , Can we use different web view?
    It's not working in browsers as well. This was not the case with Ionic 3.
    Angular 6 apps work on these devices.

  4. yuankunluo commented on Sep 2, 2018

    @yuankunluo

    @santosh-hegdeI fell so bad right now, my team decide to use Ionic V4 to build our company's app ( i am the leader and I recommend them to use Ionic ).
    But now the most devices in China are on Android 6 and Android 7.0.0.
    My boss asks me how to solve this problem.
    Have no idea, I think ionic-team will fix this problem soon. Yeah, this is my Hope.
    :/

  5. santosh-hegde commented on Sep 2, 2018

    @santosh-hegde
    Author

    @yuankunluo , Not sure when will they fix it.
    In India, I need to support Android 5 at least in browsers.
    Till then I can't release my app. I don't see any response from @IonicProSupport as well.

    This is a serious issue and should be fixed as soon as possible.

  6. dex4er commented on Sep 2, 2018

    @dex4er

    It is because @ionic/core package is not transpiled to ES5. You can fix it by:

    git clone https://github.com/ionic-team/ionic
    cd ionic
    npm i
    cd core
    npm i
    npm run build
    $EDITOR tsconfig.json # replace setting: "target": "es5"
    npm run tsc
    find dist -name '*.d.ts' -delete
    npm pack

    then in ionic-core-4.0.0-*.tgz archive will be version transpiled to ES5 rather than to ES6 so vendor.js would be ok.

  7. santosh-hegde commented on Sep 2, 2018

    @santosh-hegde
    Author

    @dex4er , How to use ES5 converted ionic core in my project?

  8. dex4er commented on Sep 3, 2018

    @dex4er

    @santosh-hegde copy your generated dist directory to your node_modules/@ionic/core/dist or just npm i ionic-core-4.0.0-*.tgz ?

    Above procedure worked for me: application just started rather than showing only white page. Most of ionic components failed because they're not compatible with older CSS standards and missing shadow-DOM in the browser. But at least you can check the version of the browser and redirect user to Android Play for newer Webview or Chrome.

  9. joostvandoremalen commented on Sep 3, 2018

    @joostvandoremalen
  10. santosh-hegde commented on Sep 3, 2018

    @santosh-hegde
    Author

    @doender ,

    Crosswalk will increase the application size. And I can't support old Android browsers.

  11. paulstelzer commented on Sep 3, 2018

    @paulstelzer
    Contributor

    For me it's working under Android 6 and the ionic webview cordova plugins supports Android 5+

  12. santosh-hegde commented on Sep 4, 2018

    @santosh-hegde
    Author

    @paulstelzer ,

    If I build the ionic project for the browser, will it work in Android 5 with ionic webview cordova plugin??

  13. dex4er commented on Sep 4, 2018

    @dex4er

    @santosh-hedge it works if Android Webview package is up to date. That's why I check version number of navigator.userAgent and redirect to market page if it is too old.

  14. yuankunluo commented on Sep 5, 2018

    @yuankunluo

    @dex4er , this is maybe a solution for users in your area, in China we don't have a unified market like Google Play Store, every manufacturer has its own market and a lot of APK websites. It is hard to redirect the user to some good place to upgrade their System Web View. Especially some tech giant's APK website ( Tencent's YinYongBao for instance) required the user to install their market app first.

    This is a very bad experience.

  15. 139 remaining items

  16. JayzeeHuang commented on Dec 3, 2018

    @JayzeeHuang

    I also tried on android 9, flashed and force closed without any messages.
    BTW, Ionic 3 app works on android 5 to android 9.

  17. yiannis-spyridakis commented on Dec 3, 2018

    @yiannis-spyridakis

    It might be interesting to see whether Ionic 3 with angular 6+ is working on devices that Ionic 4 isn't working. In my recent experience I think it does (and hence the errors are not angular related). Of course we need a more systematic approach on this, has anyone tested this?

  18. shaxxx commented on Dec 3, 2018

    @shaxxx

    Ok, to make things more clear I've created simple plain HTML + Javascript example HERE

    It's just index.htm file with Ionic components similar to sidemenu starter.
    There is no Angular, Vue or some other 3rd party framework.
    Only Ionic components & polyfills loaded from CDN. And again it's not working even with WebComponents polyfills that includes Shadow DOM v1 support. I've got the page rendered on Webview 33 (even with Webview version 44) but sidemenu is not working, and styles are wrong. You can see it here. Obviously I included entire core.js polyfills to support old browsers. No errors in console.
    On webview 54 and greater works just fine.

    If I remove WebComponents polyfills page renders just fine but sidemenu is not working.

  19. shomid commented on Dec 4, 2018

    @shomid

    Unresolved issue in beta 17.
    Though the ionic team had promised to solve the problem in beta 17.
    Is the ionic team lied?

    There are no schedules
    There is no clear timetable for the future
    Unfortunately, the ionic team is unplanned
    The base has a problem
    ionic is not reliable

  20. amitairos commented on Dec 4, 2018

    @amitairos

    @paulstelzer We're with you, supporting Ionic and believing in it and in the team and community!

    We'd be very happy to see this fixed, but unfortunately I'm not experienced enough to find the issues.

    If there is any hint to what the problems are, please post it here and maybe the community can help.

    A warm thank you!

  21. shomid commented on Dec 4, 2018

    @shomid

    @shomid Ionic is a COMMUNITY framework, so everyone can make PRs. Instead of complaining it would be great if everyone can help by fixing issues, send PRs and make Ionic even better. Ionic 4 is using MODERN web features, so it's normal that older devices have problems with it. A lot of polyfills already included to make it work in older devices, but some are still missing.

    So all in all, please stop being mad and help by sending PRs. And if Ionic is not reliable, then use another framework. A lot of people working on it and invest a lot of time. But you did not even send one PR to solve any problems. Think about it! Ionic is only so strong as the community!

    the ionic team had promised to solve the problem in beta 17.
    Unresolved issue in beta 17.
    this problem very important.
    When resolve this problem ?

  22. joostvandoremalen commented on Dec 4, 2018

    @joostvandoremalen

    Unresolved issue in beta 17.
    Though the ionic team had promised to solve the problem in beta 17.
    Is the ionic team lied?

    There are no schedules
    There is no clear timetable for the future
    Unfortunately, the ionic team is unplanned
    The base has a problem
    ionic is not reliable

    As said earlier, just use Crosswalk if you're on a tight schedule. We're using it and it works fine on Android 4.4.

  23. shaxxx commented on Dec 4, 2018

    @shaxxx

    @doender Is there any way you can make repository with Ionic4 starter project + Crosswalk?
    I've tried it here but it's hacky and SVG icons are not shown. Or at least provide details how to do it? Polyfills didn't help.
    It would be much appreciated. Thanks.

  24. joostvandoremalen commented on Dec 4, 2018

    @joostvandoremalen

    @shaxxx Could it be because ligatures are not supported?

    For compatibility on Android 4.4 I'm using the material icon set using <i class="material-icons">&#xE87F;</i> instead of <i class="material-icons">feedback</i> since quite a long time.

    Maybe there's a better solution for this but I've never found it.

    This might also be relevant: google/material-design-icons#336

  25. shaxxx commented on Dec 4, 2018

    @shaxxx

    @doender Thanks for the tip, I will try it. But I'm more concerned about the way I made it "work". It just doesn't seem right with all the workarounds. That's why I asked if someone (you?) can provide basic starter project that has this working?

  26. comino commented on Dec 4, 2018

    @comino

    I kinda disagree with the "COMMUNITY framework" argument. This is not an everyday-opensource project made by volunteers. The Ionic framework is backed by a company which bases its revenue stream on this framework and communicates trustworthiness to users, that you can build serious products with this. And the communication of Ionic 4 beta is - "Ionic 4 is recommended for new projects". The CLI asks me if I want to use Ionic 4 for new products not mentioning, that this is still very unstable. etc.

    I'm not ranting, but the "just do a PR" argument which is in 90% of the cases valid, doesn't cut it here. This mission-critical issue here has class 1 bug (@shaxxx etc) reports and is just ignored for months. And there are other ciritcal bugs ignored as well.

    I'm a loyal Ionic user since version 1, spend money and time and feel too emotional invested to just move on to React Native.

    To bring at least something productive to the table: I can exactly reproduce @shaxxx report ...
    I tried to make it work with crosswalk - without any success so far.

  27. locked and limited conversation to collaborators on Dec 4, 2018
  28. mhartington commented on Dec 4, 2018

    @mhartington
    Contributor

    Locking this for now. The conversations are getting too heated over here.

    We are aware of this issue and have been working to fix it for some time. The main issue here is that there seems to be a constant stream of things that need to either be polyfill or reworked in order to support older Android. And to add to this, the android emulator is not always the best test ground

    As the older android emulators are not connected to google play, they do not receive updates to the browser, meaning that though a real android 5 device might have chrome 70, the emulator is stuck on chrome 37 (~1% of the global market), which is a drastically different environment.

    While we are making fixes internally in both stencil and ionic/(core,angular), devs can enable Angular Polyfills to fix some older features.

    For most cases though, people will not be seeing "older" webviews that devs are getting in the Android emulator. They will be getting new chrome (70+) and all the latest web features.

    We will we continuing to address this issue and make sure things work as expected.

  29. adamdbradley commented on Dec 14, 2018

    @adamdbradley
    Contributor

    Numerous fixes for Android 5 and browsers without es6 support went into beta.18. Closing this issue. Please create a new issues for any specific problems found. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions