How to enable downloads in webview To reopen Issue


#1

found the topic here but its locked.
I have the file plugin already in but when i add the file transferplugin either from the git url or from the search it errors out saying that cordova-file plugin needs to be ^4.0. I am using 6.0.


#2

Hi,
can you share the implemtation code for your cordova-file plugin?
Some other users have also issues with the mentioned plugin. But more that it is offline.

You can try to enter a specific version of the file plugin in your config.xml file.

Regards
Andy


#3

Ok. this is the list of plugins being used:
< plugin name=“cordova-plugin-device” spec=""/>
< plugin name=“cordova-plugin-inappbrowser” spec="
"/>
< plugin name=“cordova-plugin-media” spec=""/>
< plugin name=“cordova-plugin-media-capture” spec="
"/>
< plugin name=“cordova-plugin-whitelist” spec=""/>
< plugin name=“com.ludei.webviewplus.ios” spec="
"/>
< plugin name=“com.ludei.webviewplus.android” spec=""/>
< plugin name=“cordova-plugin-camera” spec="
"/>
< plugin name=“https://github.com/chrisdurfee/cordova-android-camera-permissions.git” spec=“https://github.com/chrisdurfee/cordova-android-camera-permissions.git”/>
< plugin name=“https://github.com/chrisdurfee/cordova-ios-photo-permissions.git” spec=“https://github.com/chrisdurfee/cordova-ios-photo-permissions.git”/>
< preference name=“CocoonSplashScaleMode” value=“scaleAspectFill”/>
< preference name=“CocoonSplashBackgroundColor” value="#FFFFFF"/>
< preference name=“cocoon-version” value=“2.1.0”/>
< preference name=“CocoonSplashDelay” value=“1”/>
< preference name=“android-targetSdkVersion” value=“22”/>
< plugin name=“https://github.com/NeoLSN/cordova-plugin-android-permission.git” spec=“https://github.com/NeoLSN/cordova-plugin-android-permission.git”/>
< plugin name=“https://github.com/TheCocoaProject/cordova-plugin-nativestorage.git” spec=“https://github.com/TheCocoaProject/cordova-plugin-nativestorage.git”/>
< plugin name=“cordova-plugin-file” spec=""/>
< plugin name=“file-transfer2” spec="
"/>

This is the error message for android and ios:

Version of installed plugin: “cordova-plugin-file@6.0.0” does not satisfy dependency plugin requirement “cordova-plugin-file@^4.0.0”. Try --force to use installed plugin as dependency.

This stops the app from compiling every time.


#4

The same error message is found using any version of the cordova file transfer plugin found in the cocoon plugin area in the project settings.


#5

I opened a stackoverflow question here: https://stackoverflow.com/questions/48069490/how-to-handle-download-links-in-cordova-web-view

I have found that removing the cordova-file-plugin allows the app to compile as the cordova-file-transfer plugin will include the dependencies.

Also I have had to add a plugin to include the file write permissions for android.