Capacitor: Proxy is not defined at new CapacitorWeb 馃槶

Created on 22 Oct 2018  路  12Comments  路  Source: ionic-team/capacitor

I just call Device from '@capacitor/core' and run app , what's the wrong ?

image

All 12 comments

Looks to be running on a very old version of Android. We support 5 and above. What version is that?

This is 5.1.1 version, I tried to run on actual device (8 version) and it was good but on emulator not working

The problem is the same as on
https://github.com/ionic-team/capacitor/issues/456

Proxy is not available in your device. In Android it should work, but as you are testing in an emulator it鈥檚 probably out of date. Try updating the sdks for emulators and the system Webview/chrome if possible.

This issue is occurs when we use capacitor plugins in lower android devices like android 5, 5.1, 6. But if you remove the capacitor plugin usage application will work but then css will not render properly. Style will not apply as you want.
Can any one help.... otherwise i have to move ionic 3

Having the same issue when i use capacitor PushNotification plugin.
I'm using android 8.1 device for test.

ionic info output

Ionic:

   ionic (Ionic CLI)             : 4.12.0 (/usr/local/lib/node_modules/ionic)
   Ionic Framework               : @ionic/angular 4.3.0
   @angular-devkit/build-angular : 0.13.8
   @angular-devkit/schematics    : 7.2.4
   @angular/cli                  : 7.3.8
   @ionic/angular-toolkit        : 1.4.1

Capacitor:

   capacitor (Capacitor CLI) : 1.0.0-beta.19
   @capacitor/core           : 1.0.0-beta.19

Cordova:

   cordova (Cordova CLI) : 9.0.0
   Cordova Platforms     : none
   Cordova Plugins       : no whitelisted plugins (0 plugins total)

System:

   ios-deploy : 1.9.4
   ios-sim    : 8.0.0
   NodeJS     : v10.15.3 (/usr/local/bin/node)
   npm        : 6.9.0
   OS         : macOS Mojave
   Xcode      : Xcode 10.1 Build version 10B61

Would be good to know the device, android 8 devices should use the webview based on the installed chrome. Which chrome do you have installed? What do you get if you run navigator.userAgent?

I tested now with another device Infinix X606 Build/O11019 and it works.

Navigator agent Mozilla/5.0 (Linux; Android 8.1.0; Infinix X606 Build/O11019; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/73.0.3683.90 Mobile Safari/537.36

If i understand, users should have chrome installed on their phone before my app can run ?

@deveshmishra34 No. I鈥檓 not using emulator. I鈥檓 using real android device. I鈥檒l try updating chrome on the device that had the issue.
But I鈥檓 wondered if it is problem with chrome How do can I request updating chrome version on users before my app is installed ?

Starting on Android 7.0, Google started shipping Chrome with Android.
I've tested on my Android 7, 8 and 9 devices and I can't uninstall Chrome on any of them.
I can only disable it, but that doesn't seem to affect any of my apps, the reported version still matches my chrome version.
https://developer.android.com/about/versions/nougat/android-7.0

Looks like some vendors managed to not ship Chrome or use a different WebView instead of the based on Chrome. In that cases the results are unpredictable for us.

As of how to notify the users, you can probably check the user agent and show some custom message if they are below Chrome 67 as that's the version that included proxy.

The best solution is don't use capacitor plugins...instead user push plugin for push notification. Until someone come with a patch. I had a same issues, i just remove capacitor plugin usage in my app. And it works fine.

It should be something like this锛寃hen JS change ES6 to ES5锛宼he "Proxy" from ES6 is not change and can't be recognized by ES5锛宻o the solution is to implement custom "Proxy" for ES5.

Same here. Because Ionic build on Angular9 has a issue, https://github.com/ionic-team/ionic-cli/issues/4262. I built with the conf, "target": "es5" in tsconfig.json. When I open it on the mobile Chrome v79, "The proxy is not defined error" happens.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

peterpeterparker picture peterpeterparker  路  3Comments

ebk46 picture ebk46  路  3Comments

nicobytes picture nicobytes  路  3Comments

natevw picture natevw  路  3Comments

alexcroox picture alexcroox  路  3Comments