Szabolcs Kubovics created CB-11825:
--------------------------------------
Summary: Windows dll file won't be copied as resource while adding
custom plugin to a UWP project
Key: CB-11825
URL: https://issues.apache.org/jira/browse/CB-11825
Project: Apache Cordova
Issue Type: Bug
Security Level: Public (Anyone can view this level - this is the default.)
Components: Plugins, Windows
Affects Versions: 6.3.1
Environment: Windows10 UWP projects
Reporter: Szabolcs Kubovics
Priority: Critical
Fix For: 6.3.2
I have created a custom plugin which uses a Windows Runtime Component (e.g.
"foo.winmd") file. In this winmd I have a referenced library class (e.g.
"bar.dll").
My plugin.xml looks like:
<platform name="windows">
...
<resource-file src="windows/windows10/bin/SayHelloLib.dll"
target="plugins/com.plugin.test.myPlugin/SayHelloLib.dll" versions="<=0.0"/>
<framework src="windows/windows10/bin/Plugin.Test.winmd"/>
</platform>
With Cordova 6.2.0 the resource file will be copied to the target place and if
I add the plugin to a cordova project the winmd file will find it.
With Cordova 6.3.1 the mentioned dll file won't be copied and I get
FileNotFoundException (because it is not there).
"Exception calling native with command :: SayHelloToName :: sayHello
::exception=WinRTError: The system cannot find the file specified.
System.IO.FileNotFoundException: Could not load file or assembly 'SayHelloLib,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its
dependencies. The system cannot find the file specified.
at Plugin.Test.TestPlugin.getName(String name)
cordova.js (993,13)"
I created a test package to easily reproduce this scenario. The test
application can be downloaded from the external issue URL.
- SayHelloLib: the library which is referred in the winmd (output of
PluginProject solution)
- PluginProject: contains the plugin proxy and the dll resource as cross
referenced project (just for convenience)
- MyPlugin: the custom plugin, contains the plugin .js and .xml files and
windows specific resources from PluginProject solution
- www: the index.html, it has to be copied to the www folder of the newly
created Cordova project
Repro steps:
1) build PluginProject project on x64 platform
2) copy built files:
PluginProject\MyTestPlugin\windows\src\myPlugin_proxy.js ->
MyPlugin\windows\src
PluginProject\Plugin.Test\Plugin.Test.UWP\bin\x64\Debug\Plugin.Test.winmd ->
MyPlugin\windows\windows10\bin
PluginProject\Plugin.Test\Plugin.Test.UWP\bin\x64\Debug\SayHelloLib.dll
-> MyPlugin\windows\windows10\bin
3) cordova create Cordova631 cordova631.test.plugin Cordova631
4) cd Cordova631
5) cordova platform add windows
6) cordova plugin add com.plugin.test.myPlugin --searchpath
<path_to_MyPlugin_folder>
7) copy file:
www\index.html -> Cordova631\platforms\windows\www
8) build the CordovaApp.sln on x64 platform
9) start the application
10) write something in the "Name" textbox
11) click "Say hello" button
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]