cordova-plugin-crypto-file icon indicating copy to clipboard operation
cordova-plugin-crypto-file copied to clipboard

'Cordova/CDVURLProtocol.h' file not found on [email protected]

Open Wa-Lt opened this issue 4 years ago • 12 comments

Hi,

I am currently using Cordova CLI 9.0.0 and cordova-ios 6.0.0. However, when I install the plugin, I get an error.

Current setup for iOS

  • Cordova CLI 9.0.0
  • cordova-ios 6.0.0
  • cordova-plugin-crypto-file 1.4.0

The error I'm seeing

/~/platforms/ios/HelloCordova/Plugins/cordova-plugin-crypto-file/CDVCryptURLProtocol.h:9:9: fatal error:       'Cordova/CDVURLProtocol.h' file not found #import <Cordova/CDVURLProtocol.h>

I would be happy if cordova-ios 6.0.0 also has plugins available.

Wa-Lt avatar Jun 12 '20 11:06 Wa-Lt

Same here.

apache/cordova-ios#783

Read the above URL. breaking (CDVURLProtocol): delete by the Cordova-ios team.

Could you please fix this as soon as possible?

eyganeshv avatar Aug 10 '20 13:08 eyganeshv

Until this is not fixed, I forked this repo and created a version that is enabled on Android only, so that it does not break iOS platform.

cordova plugin add cordova-plugin-crypt-file-android

I hope this helps until the CDVURLProtocol dependency gets replaced with an alternative.

enricodente avatar Aug 31 '20 11:08 enricodente

@nasanchez is the plugin encryption gone on iOS with your method? Or is it still doing its job?

enricodente avatar Sep 02 '20 17:09 enricodente

no one managed to resolve this issue?

VYRNACH avatar Jan 21 '21 08:01 VYRNACH

Any solution for this issue ?

chorauoc avatar Feb 02 '21 04:02 chorauoc

I know this might be a dead repo now but has anyone taken a look at how the cordova-plugin-file accesses the local files? from what i know it works on the latest cordova-ios version.

lilmnm-kamikaze- avatar Aug 13 '21 03:08 lilmnm-kamikaze-

I know this might be a dead repo now but has anyone taken a look at how the cordova-plugin-file accesses the local files? from what i know it works on the latest cordova-ios version.

Thanks, did you try it with latest cordova/ios version? Did the app work for you? When I tried a few months ago -- it compiled fine but the app only showed a blank white screen when loading.

givethanks1 avatar Aug 13 '21 03:08 givethanks1

with this plugin xcode will not build the app as apache removed the CDVURLProtocol.h file from the cordova-ios platform repo at version 6.0.0 i do how ever have an ios app that is working fine with the cordova-file-plugin with the latest cordova-ios platform version. I am not that good with ios swift or objective c but i was looking at the code the other day and it looks like we can do with out the CDVURLProtocol.h file code and would need to adjust it to use the wkwebview code as i think cordova-ios is now only working with the wkwebview and doesnt use the uiwebview code. I can give it a go but I cant make many promises.

lilmnm-kamikaze- avatar Aug 13 '21 03:08 lilmnm-kamikaze-

with this plugin xcode will not build the app as apache removed the CDVURLProtocol.h file from the cordova-ios platform repo at version 6.0.0 i do how ever have an ios app that is working fine with the cordova-file-plugin with the latest cordova-ios platform version. I am not that good with ios swift or objective c but i was looking at the code the other day and it looks like we can do with out the CDVURLProtocol.h file code and would need to adjust it to use the wkwebview code as i think cordova-ios is now only working with the wkwebview and doesnt use the uiwebview code. I can give it a go but I cant make many promises.

Part of the problem is that the plugin code (objective-C) uses NSURL protocol to "intercept" file loading (so that it can decrypt it at runtime -- because your code is packaged encrypted in the IPA file).

But since moving to WkWebView -- NSURL protocol is not supported (it was only supported with UIWebView).

So, the "decryption" part of the plugin does not seem to work.

That was true 4 months ago. However things change, so I don't know what is currently the case / whether they have added support or someone has forked and updated the code and written it up so it works.

givethanks1 avatar Aug 13 '21 03:08 givethanks1

Correct. but the weird thing is that cordova-plugin-file also uses the NSURL protocol but still works with the latest cordova-ios version. i have looks at all the forks of this repo and of tkyaji's repo and none of them have been updated in over 2 years but again i started using this plugin not to long ago about the same time phonegap build was shut down.

Edit: here is the results with NSURLProtocol being used in the cordova-plugin-file repo

lilmnm-kamikaze- avatar Aug 13 '21 03:08 lilmnm-kamikaze-

Is there any chance this plugin will work on iOS again?

secretmoo35 avatar Aug 13 '21 14:08 secretmoo35

I think so. Cordova-ios 6.2.0 has a WKURLShemeHandler I think could be used to update this plugin.

lilmnm-kamikaze- avatar Aug 13 '21 17:08 lilmnm-kamikaze-