-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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 4 won't work in android 5 #15438
Comments
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 |
we may need another crosswalk? |
@yuankunluo , Can we use different web view? |
@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 ). |
@yuankunluo , Not sure when will they fix it. This is a serious issue and should be fixed as soon as possible. |
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. |
@dex4er , How to use ES5 converted ionic core in my project? |
@santosh-hegde copy your generated 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. |
Why don't you use Crosswalk to solve this?
|
@doender , Crosswalk will increase the application size. And I can't support old Android browsers. |
For me it's working under Android 6 and the ionic webview cordova plugins supports Android 5+ |
If I build the ionic project for the browser, will it work in Android 5 with ionic webview cordova plugin?? |
@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. |
@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. |
An Android device manufactured by Meizu with Flyme Os ( base on Android 7.0.0) still failed with Blank Screen. Debug information is still syntax error in vendor.js. We have downloaded the newest Android System Web View APK but it does not help. |
refers to #15191 |
Hi there. Can you please make sure you have the latest beta (beta 7). This was an issue in stencil that is fixed now. |
@mhartington i see no any difference: find node_modules/@ionic/core/dist -name '*.js' | xargs grep -r '=>' node_modules/@ionic/core/dist/collection/utils/transition.js:const iosTransitionAnimation = () => import('./animations/ios.transition');
node_modules/@ionic/core/dist/collection/utils/transition.js:const mdTransitionAnimation = () => import('./animations/md.transition');
node_modules/@ionic/core/dist/collection/utils/transition.js: return new Promise((resolve, reject) => {
node_modules/@ionic/core/dist/collection/utils/theme.js: .filter(c => c != null)
node_modules/@ionic/core/dist/collection/utils/theme.js: .map(c => c.trim())
node_modules/@ionic/core/dist/collection/utils/theme.js: .filter(c => c !== '');
node_modules/@ionic/core/dist/collection/utils/theme.js: getClassList(classes).forEach(c => map[c] = true); etc... |
Searching in |
@mhartington components are ES6 version only: ~/src/js/ionic-hello-world-sidemenu$ grep '=>' www/vendor.js | tail
// this operation has side effects => route state is being affected
.map(entry => entry.split('='))
.map(([key, value]) => [decodeURIComponent(key), decodeURIComponent(value)])
.filter(([key]) => startsWith(key, IONIC_PREFIX))
.map(([key, value]) => [key.slice(IONIC_PREFIX.length), value])
.forEach(([key, value]) => {
cssClasses.forEach(c => el.classList.add(c));
return (...args) => {
platforms.forEach(p => classList.add(`plt-${p}`));
return Object.keys(PLATFORMS_MAP).filter(p => PLATFORMS_MAP[p](win)); This is an empty project generated with |
hi @dex4er nice, what is the minimum browser version you check? Ios/android... |
It sounds like a very good sound. |
good news |
Emulators Test Results: Andorid 6.0 Api 23: Blank Screen |
@bryce13950 What webview version where you testing with? Bug is not related with Android version, but with webview version. If it's lower than 54 it didnt work. |
@shaxxx I'm honestly not sure what web view it was, and I honestly don't know how to do that. Can you give me some instructions on how to do that? |
still problem not solved in old browser in beta17. |
Is support for Android 4.4 in the plan? |
It would be great if you guys could test a BLANK angular project first and tell us if this works before using Ionic components in it. Somewhere in the issues I posted a summary about Angular / Ionic and Android Support, but cannot find it. The most problems who exist come from Angular because there is an issue it's not working on older Android devices (with an older Webview app). If you add the polyfills the app starts, but the Ionic components have no styles (missing polyfill) |
Was this on the emulator? There are specific problems with the android emulators, but a real device should work. |
@paulstelzer May I ask about the approximate release time of the final version? Which version is the minimum fit? |
@yixiaohou i think next January we will have RC1 |
@paulstelzer I've tried with all the polyfils from polyfills.ts and it's not working. By not working I mean I'm getting blank screen on webview version 44 with all the polyfills uncommented. No console errors, no devcat errors. My latest tests
Test procedure
Lenovo A2010 Samsung Galaxy Nexus I9250 Android x86 Emulator Now, let's test standalone Angular project
Test procedure
Lenovo A2010 Samsung Galaxy Nexus I9250 Android x86 Emulator Conclusion: Angular is working just fine on tested devices. Ionic 4 is not working on Android Webview < 54. Yes, I know some of you will have Ionic 4 working on KitKat 4.4, or Lolipop or Marshmallow, but it only means these devices are running Android Webview version 54 or later (by mercy of system updates and ROM providers). Even stock Nougat (Android 7.0 & 7.1) is coming with Webview 52 and Ionic 4 will not work on these devices (this is very limited number of devices since most of manufacturers upgraded this, but they still exist). Ionic 3 is working like a dream on all tested devices/emulators. @mhartington is there anything community can do anymore? There is no error to work with, and we've provided more than enough feedback. Is this something you're looking/working on at this moment? Do you have plans? If not, can you at least provide the info if this is considered to be bug, and not something that's just being left out. I think that would be fair to all people starting with Ionic4 projects. |
Still not work on android 5.1 assuming 5.0 as well. `Ionic: ionic (Ionic CLI) : 4.5.0 (/usr/local/lib/node_modules/ionic) Cordova: cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1) System: NodeJS : v8.12.0 (/usr/local/bin/node)
|
I also tried on android 9, flashed and force closed without any messages. |
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? |
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. If I remove WebComponents polyfills page renders just fine but sidemenu is not working. |
Unresolved issue in beta 17. There are no schedules |
@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! |
the ionic team had promised to solve the problem in beta 17. |
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. |
@shaxxx Could it be because ligatures are not supported? For compatibility on Android 4.4 I'm using the material icon set using Maybe there's a better solution for this but I've never found it. This might also be relevant: google/material-design-icons#336 |
@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? |
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 ... |
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. |
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. |
Bug Report
Ionic Info
Run
ionic info
from a terminal/cmd prompt and paste the output below.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
The text was updated successfully, but these errors were encountered: