Skip to content
This repository was archived by the owner on Nov 7, 2018. It is now read-only.

Ionic app doesn't start after install wkwebview plugin #116

Closed
elrabelo opened this issue Mar 27, 2017 · 14 comments
Closed

Ionic app doesn't start after install wkwebview plugin #116

elrabelo opened this issue Mar 27, 2017 · 14 comments

Comments

@elrabelo
Copy link

elrabelo commented Mar 27, 2017

Error:
captura de tela 2017-03-26 as 21 43 16

Log:

2017-03-26 21:31:48.134848 App[944:212424] Apache Cordova native platform version 4.3.1 is starting.
2017-03-26 21:31:48.136583 App[944:212424] Multi-tasking -> Device: YES, App: YES
[INFO] GCDWebServer started on port 8080 and reachable at http://192.168.0.100:8080/
2017-03-26 21:31:48.329357 App[944:212424] CDVWKWebViewEngine: trying to inject XHR polyfill
2017-03-26 21:31:48.381751 App[944:212424] CDVWKWebViewEngine will reload WKWebView if required on resume
2017-03-26 21:31:48.381894 App[944:212424] Using Ionic WKWebView
2017-03-26 21:31:48.383264 App[944:212424] [CDVTimer][handleopenurl] 0.338018ms
2017-03-26 21:31:48.392021 App[944:212424] [CDVTimer][intentandnavigationfilter] 8.516967ms
2017-03-26 21:31:48.392445 App[944:212424] [CDVTimer][gesturehandler] 0.232995ms
2017-03-26 21:31:48.422647 App[944:212424] [CDVTimer][file] 29.697001ms
2017-03-26 21:31:48.447032 App[944:212424] [CDVTimer][intercom] 24.167001ms
2017-03-26 21:31:48.447449 App[944:212424] Starting Facebook Connect plugin
2017-03-26 21:31:48.447672 App[944:212424] [CDVTimer][facebookconnectplugin] 0.441968ms
2017-03-26 21:31:48.483503 App[944:212424] [CDVTimer][statusbar] 35.633028ms
2017-03-26 21:31:48.507188 App[944:212424] [CDVTimer][splashscreen] 23.449004ms
2017-03-26 21:31:48.507753 App[944:212424] [CDVTimer][mixpanel] 0.308990ms
2017-03-26 21:31:48.511885 App[944:212424] [CDVTimer][keyboard] 3.688037ms
2017-03-26 21:31:48.514426 App[944:212424] [CDVTimer][localstorage] 2.268016ms
2017-03-26 21:31:48.514608 App[944:212424] [CDVTimer][TotalPluginStartup] 131.767988ms
2017-03-26 21:31:48.533401 App[944:212424] createNotificationChecker
2017-03-26 21:31:48.533549 App[944:212424] not coldstart
2017-03-26 21:31:48.562606 App[944:212424] active
2017-03-26 21:31:48.563055 App[944:212424] PushPlugin skip clear badge
(lldb) 
@kleeb
Copy link

kleeb commented Mar 27, 2017

same for me

@elrabelo
Copy link
Author

I just forgot to add this to my config.xml. Sorry for that.
<preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" />

All changes in config.xml.

<allow-navigation href="http://localhost:8080/*"/>
<feature name="CDVWKWebViewEngine">
  <param name="ios-package" value="CDVWKWebViewEngine" />
</feature>

<preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" />

@elrabelo
Copy link
Author

To soon saying that..
It worked, now it's not working anymore and I didn't do anything...
Reopening issue...

@elrabelo elrabelo reopened this Mar 29, 2017
@gbelmm
Copy link

gbelmm commented Mar 30, 2017

+1 please

@manucorporat
Copy link

  1. Clean install:
rm -rf platforms
rm -rf plugins
  1. Recreate cordova
cordova platform add ios
  1. Make sure localhost is allowed:
<allow-navigation href="http://localhost:8080/*"/>
  1. Make sure WKWebView is the default engine:
<feature name="CDVWKWebViewEngine">
  <param name="ios-package" value="CDVWKWebViewEngine" />
</feature>

<preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" />
  1. Build ios
ionic build ios

did it work?

@kleeb
Copy link

kleeb commented Mar 31, 2017

localhost:8080 ?
does it mean you added a localhost server that is running na natives?

this will bring all the CORS problem to the iOS

@stansongman
Copy link

stansongman commented Mar 31, 2017

I am having the same problem. I did the clean re-install, and It is still happening. All loads well until here BUT, If I untether the phone and start the up, it comes up fine.

[VERBOSE] [::1:8080] ::1:52428 200 "GET /var/containers/Bundle/Application/03B2DC93-ACE3-419C-8F35-8AC8D594770E/MyApp.app/www/templates/signIn.html" (565 | 2024)
MyApp(651,0x1b5d10c40) malloc: *** error for object 0x1700af180: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
(lldb)

If I continue, the app crashes right after my signin view is rendered, UNLESS the phone is untethered.

@zakton5
Copy link

zakton5 commented Mar 31, 2017

Also seeing this issue. It used to work and then suddenly the app doesn't load anymore.

@stansongman
Copy link

Update: I found this on StackOverflow
which solved the issue for me.

@epetre
Copy link

epetre commented Apr 12, 2017

@kleeb I think there is a way to proxy the calls but I have no idea how we should do this now.

@JiaLiPassion
Copy link

@kleeb, @epetre , I have created a PR #115 to add a local proxy server to proxy all xhr request. maybe it can fulfill your requests.

@kleeb
Copy link

kleeb commented Apr 12, 2017

Wow. Thanks @JiaLiPassion
Looks really interesting and we will definitely take a look at it.

@epetre
Copy link

epetre commented Apr 29, 2017

I'm running on the webview engine now and it works well.

@manucorporat
Copy link

http://stackoverflow.com/questions/39927338/wkwebview-error-calling-any-javascript-in-ios-10-while-debugging/40085189#40085189

It looks like its a safari bug and therefore only appears when you are debugging your webview with safari. In Safari under Develop->Your_Device_Name uncheck "Automatically Show Web Inspector for JSContexts". This should resolve your issue.

closing...

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

No branches or pull requests

8 participants