Skip to content
This repository has been archived by the owner on Dec 5, 2019. It is now read-only.

Build fails with Error code 65 on cordova-ios 4.0.1 #209

Open
klyonrad opened this issue Jan 5, 2016 · 50 comments
Open

Build fails with Error code 65 on cordova-ios 4.0.1 #209

klyonrad opened this issue Jan 5, 2016 · 50 comments

Comments

@klyonrad
Copy link

klyonrad commented Jan 5, 2016

not posting the full error output but this seems to be the important part

/Users/user/some_path/CordovaApp/platforms/ios/CordovaApp/Plugins/com.telerik.plugins.wkwebview/MyMainViewController.m:4:9: fatal error: 
'Cordova/CDVLocalStorage.h' file not found
#import <Cordova/CDVLocalStorage.h>
    ^
1 error generated.

Downgrading to cordova-ios 3.9.2 seems to have helped the issue

@EddyVerbruggen
Copy link
Contributor

Yeah they made a whole bunch of 'internal' plugins (like CDVLocalStorage) 'private', so this plugin can no longer access that class. Should be able to work around it, but I'm wondering if cordova-ios-4 compatibility is needed since Cordova now (with the cordova-ios-4 release) has official support for WKWebView with their own plugin.

Would love to hear everybody's input on this matter.

@mathiasmuller4sh
Copy link

Hi, They do support WKWebView but there is stil the issue for ajax call from file://
So ionic or angular app are not able to work

@EddyVerbruggen
Copy link
Contributor

Oh, that's not very useful then.. unless you use inline angular templates I guess. I'll try and make an effort. The hardest part is making it backward compatible with cordova-ios-3.

@mathiasmuller4sh
Copy link

Inline template is indeed a nice work around.
Haven't tried it.
I stopped my test when i saw this error:
the Origin null is not allowed by Access-Control-Allow-Origin error on each template..

@andreialecu
Copy link
Contributor

Cordova's WKWebView support is iOS9 only. This plugin supports iOS 8 as well.

@EddyVerbruggen
Copy link
Contributor

You're best off sticking with cordova-ios-3 for now. cordova-ios has been significantly restructured and a lot of things this plugin needs are now private, so inaccessible.

@EddyVerbruggen
Copy link
Contributor

For folks using cordova-ios4 and targeting iOS8 and iOS9 who want to use WKWebView today, there is also this plugin. I didn't test it, but it may be worth a shot.

@klyonrad
Copy link
Author

klyonrad commented Jan 8, 2016

Should be able to work around it, but I'm wondering if cordova-ios-4 compatibility is needed since Cordova now (with the cordova-ios-4 release) has official support for WKWebView with their own plugin.

I personally have also come acrosse the issue of indexedDB not being available with the official plugin.

there is also this plugin. I didn't test it, but it may be worth a shot.

I would assume that they'll drop support for this one in favor of the new plugin.

So I suggest at least pointing out the compatibility issue in the README of your plugin

@EddyVerbruggen
Copy link
Contributor

Good point, added the warning near the top.

@popaprozac
Copy link

Downgrading to 3.9.2 helped. No errors while building. Testing with an Ionic 2 app. Great performance boost.

Thanks!

@hussfelt
Copy link

hussfelt commented Feb 2, 2016

👍 on 3.9.2! Thanks @zb0t

@prabhu2003ece
Copy link

Yup downgrading to 3.9.2 works 👍 . Looks like 4.0 Version has cordovaLib separates Cordova/CDVLocalStorage.h as private plugin which xcode not including them.

@EddyVerbruggen
Copy link
Contributor

Exactly (grrr) and a few other issues as well.

@nitzanwilnai
Copy link

Any update on this?

@ghost
Copy link

ghost commented Mar 10, 2016

The hardest part is making it backward compatible with cordova-ios-3.

Sounds like a breaking change. Would it be possible to only support cordova-ios-4 with any new versions?

@popaprozac
Copy link

Official plugin works with ios@4.

https://github.com/apache/cordova-plugins/blob/master/wkwebview-engine-localhost/README.md

For use with a project with android, platform specific content src is required. The above plugin with set a local host while a crosswalk android build requires the default index.html

@ghost
Copy link

ghost commented Mar 10, 2016

@zb0t with ios8?

@popaprozac
Copy link

@alexkavon I have tested it with a physical device running 9.2 and simulator. Will try iOS 8 right now and report back

@popaprozac
Copy link

@alexkavon Works like a charm on 8.4 simulator!

@jpike88
Copy link

jpike88 commented Mar 11, 2016

Why on Earth are you trying to maintain iOS 8 support? The vast majority of iOS are already on iOS 9 (or can update to it) and it's holding this project back. If you literally cannot support Cordova iOS 4 because of a select few users who can't be bothered to update their devices then I think that's a poor decision.

I'm sticking with cordova-plugin-wkwebview-engine for now (although the crash recovery on your one looks cool) and have been using it for a few months. It works great and the code is simple. I seriously think you guys should consider ditching iOS 8 support and allowing this plugin to take advantage of Cordova iOS, WKWebView is still cutting edge so why can't this plugin be too?

@jpike88
Copy link

jpike88 commented Mar 11, 2016

Better yet, why not approach the Cordova guys and ask them to move their repo to Github (as it's currently just being mirrored there from a crappy apache git server) to facilitate some sort of merge, as this one's crash recovery sounds handy?

@EddyVerbruggen
Copy link
Contributor

@zb0t Please also check a real device as AFAIK the simulator is able to load files from the file:// protocol. That's bitten me when testing WKWebView in the past.

@popaprozac
Copy link

@EddyVerbruggen Okay I will test on a physical device

@helgetan
Copy link

Any updates on this?

@popaprozac
Copy link

On a physical iOS 9 device it appears to work just fine. Looking for a device with iOS 8!

@andreialecu
Copy link
Contributor

There are certain workarounds implemented in this plugin that cordova's doesn't have, and various critical issues in that one as well that are not present in this one due to the use of the local web server. For example this one is critical for my app and I can't swap to that one: https://issues.apache.org/jira/browse/CB-10237?jql=project%20%3D%20CB%20AND%20labels%20%3D%20wkwebview-known-issues

Would be great if there could be a way to update the plugin to work with new cordova versions.

@andreialecu
Copy link
Contributor

By the way, another plugin I'm using has figured out how to be compatible with both cordova-ios 3 and 4. It involves reading the platforms/package.json file on build using a hook, and depending on the iOS version, changing some macros in its source.

See:
https://github.com/nordnet/cordova-hot-code-push/blob/master/scripts/lib/iosBackwardsCapabilitySupport.js
https://github.com/nordnet/cordova-hot-code-push/blob/master/scripts/afterPrepareHook.js

Unfortunately I don't have time to figure it out myself so I'm leaving it here for someone else.

@jcesarmobile
Copy link

For those complaining about the cordova plugin (https://github.com/apache/cordova-plugin-wkwebview-engine) and the issues that it has, those are apple bugs.
The way to workaround the bugs is using a local webserver like this plugin does.

So, if you are using the cordova plugin, you just have to install this plugin too to add a webserver.
https://github.com/apache/cordova-plugins/tree/master/wkwebview-engine-localhost

After installing both, it should work the same way this plugin works, and if you still see bugs, create new issues on http://issues.cordova.io/

BTW, the crosswalk plugin adds WKWebView support too, not sure if it works with cordova ios 4 though.

@akofman
Copy link

akofman commented Apr 13, 2016

@EddyVerbruggen Thanks for your awesome job, I'm a fan !

screen shot 2016-03-31 at 17 19 32

Concerning this plugin I think the official WKWebView is still young and needs time.
So far it didn't consider settings configuration (I did a PR in order to fixe that point).
Also I'm just encountering some issues with the localstorage, and the scroll behaviour looks different. That's what I can see from my side but I guess other developers could find other regressions.

As @jcesarmobile said, using wkwebview-engine-localhost should help but I don't think it's enough at the moment (from my point of view). And yes it's a very good idea to create issues in order to improve it 👍

Why I'm rekindling this thread is just because a lot of projects can't be migrated to the official plugin because of regression issues and are just stuck with cordova-ios@3.9.2. I think it would be better to encourage people to migrate to the latest cordova-ios version and wait for some fixes on the official WKWebView plugin before using it (and it could take time).

So to conclude, that will be awesome if you could fix this issue 😄
But if you don't have time to do it, I could understand and I'll try to do something.

@andreialecu
Copy link
Contributor

andreialecu commented Apr 19, 2016

I gave the official wkwebview plugin a try and it has so many issues (that are resolved in this one) that it is unusable.

For example, it is impossible to use cdvfile:// urls without the local webserver engine plugin, and even then, I could not get CDVFileTransfer to work properly, getting various permission errors while trying to save files. I think it tries to be smart and override urls automatically but something doesn't work somewhere along the way and breaks a lot of things.

From my experience attempting this migration, my conclusion is that there are so many problems with the official plugin that it is definitely not usable for any moderately complex app at this point - and I'm not seeing any signs that they're actively maintaining it. There are barely any people using it from what I can see, because there is a severe lack of discussion regarding most of these issues.

That said, however, I think it might be easier to fork the official plugin and add the functionality included in this plugin (specifically the local file system proxy via http://localhost:12344/Library/, /Documents/, etc), the auto-restart functionality, and the various other tweaks that evolved here.

@jsbranco
Copy link

jsbranco commented May 1, 2016

@andreialecu, @klyonrad I recently faced the same issue where the CDVLocalStorage file was failing the build. I didn't want to downgrade to an older version of cordova so I tried the official wekwebview but ended up with troubles using the FILE_URI from Cordova Camera to Cordova File Transfer. What I did was to actually use the cdvfille:// with the temp folder
val localPath ="cdvfile://"+imageData.substring(imageData.lastIndexOf("/Users/"),imageData.length)

(imageData, comes from the Cordova Camera)

This did the trick for me actually.

I also agree if we could have the features of this library added to the Official plugin it would be really great as the official does lack of essential features

@Ramblurr
Copy link

Ramblurr commented May 3, 2016

Just starting to use this plugin in an existing project. I was already on ios 4.x. Is there any update regarding 4.x support?

@barocsi
Copy link

barocsi commented May 3, 2016

@branco91 can you please elaborate?
Is your solution for Teleriks or the official WKWebview?
Is it to work with images selected from gallery?
Right now every taken picture returns a fileURL not the direct imagedata.
https://github.com/apache/cordova-plugin-camera#module_camera.getPicture suggests using FILE_URI instead of DATA_URL because of crashes.

NOTE: Photo resolution on newer devices is quite good. Photos selected from the device's gallery are not downscaled to a lower quality, even if a quality parameter is specified. To avoid common memory problems, set Camera.destinationType to FILE_URI rather than DATA_URL.

@barocsi
Copy link

barocsi commented May 3, 2016

Is this a sort of 22 catch. Accessing photos requires webserver. Requires this plugin, the other one does not work. However this one never compiles for cordova ios 4. But other plugins might require that so basically we re stuck on the 3.9.2. level.
So how others solve this issue while keeping wkwebview support?
Even need to discover whether this repo is even maintained.

@EddyVerbruggen
Copy link
Contributor

Can you give examples of plugins requiring cordova-ios-4? That's not a requirement I like to impose on projects.

@barocsi
Copy link

barocsi commented May 3, 2016

I have just ran into https://github.com/phonegap/phonegap-plugin-push/releases requires ios 4 above 1.5.3, and is at 1.6.3 already with many essential fixes.

@apparition47
Copy link

cordova-plugin-iosrtc (WebRTC for iOS) also requires Cordova iOS 4.

@clauderic
Copy link

clauderic commented May 17, 2016

For my app, the fix that this plugin provides for KeyboardDisplayRequiresUserAction is essential, so moving to the official cordova wkwebview plugin will never be an option unless they implement something of the sort, which I doubt will ever happen.

I also would like to use https://github.com/phonegap/phonegap-plugin-push/, but it requires cordova-ios-4

@guyromb
Copy link

guyromb commented May 24, 2016

Is there any milestone planed to fix this issue?

@dbpieter
Copy link

@clauderic We have exactly the same issue. You can fix KeyboardDisplayRequiresUserAction by implementing the same hacky fix that was implemented in the telerik wkwebview : 04e8296

@clauderic
Copy link

Yeah, that's exactly what I ended up doing @dbpieter. Works like a charm.

@Michael-Stanford
Copy link

@EddyVerbruggen "Can you give examples of plugins requiring cordova-ios-4? That's not a requirement I like to impose on projects."

Installing "phonegap-plugin-push" for ios
Plugin doesn't support this project's cordova-ios version. cordova-ios: 3.9.2, failed version requirement: >=4.3.0

@jcesarmobile
Copy link

@Michael-Stanford, he said that 8 months ago, in the meantime Xcode 8 was released requiring .entitlement files for push notifications and cordova-ios 4.x.x dealt with them, so it's a requirement now

@Michael-Stanford
Copy link

Michael-Stanford commented Jan 10, 2017

@jcesarmobile Thanks for your quick response. The Readme at https://github.com/Telerik-Verified-Plugins/WKWebView says "At the moment this plugin is NOT compatible with Cordova-iOS-4 (so use 3.x), see #209 for details." Does this mean that this WKWebView is no longer supported?

@JEGardner
Copy link

The need for me to upgrade to cordova-ios 4 to work with XCode 8 has meant that I've unfortunately had to stop using this plugin on all our apps, which is a real shame as it's great. Had to revert to UIWebView for now as I couldn't get Cordova's version to work with the camera etc.

@mxmzb
Copy link

mxmzb commented Feb 10, 2017

This is a kinda sad thread :( bye native transitions. Ionic doesn't cease to disappoint the more you dig into it (not flaming any of the contributor guys of this plugin or anything, just bit disappointed from the overall Ionic experience).

@phyr0s
Copy link

phyr0s commented Aug 20, 2017

So.... this plugin will be deprecated forever?

@PierBover
Copy link

Ionic doesn't cease to disappoint the more you dig into it (not flaming any of the contributor guys of this plugin or anything, just bit disappointed from the overall Ionic experience).

This is a bug with WkWebView. You can blame Apple for nor fixing it:
https://bugs.webkit.org/show_bug.cgi?id=154916

@schumannd
Copy link

So is this plugin abandoned then? Would be nice to read in the README

@EddyVerbruggen
Copy link
Contributor

@schumannd See the comments at the top of the readme, and the issue it refers to. Since then Ionic created its own plugin, we're just keeping this one for older Cordova versions.

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