Closed pcbl closed 8 years ago
Hi, thank you for the patch. This is definitely cordova bug: windows
and windows8
is different platforms and only one platform.js
is needed. I'll accept your patch but I need to investigate little further to make sure everything works fine.
Fixing issue 82, where the following error was showing on windows apps: 0x800a139e - JavaScript runtime error: module cordova-plugin-app-preferences.platform already defined
Basically, on lines 90 and 97 you have something like this:
90: <js-module src="src/windows8/platform.js" name="platform">
97: <js-module src="src/windows8/platform.js" name="platform">
The problem is that, as you can see, the name "platform" is being used. And later, during the cordova_plugins.js generation, it turns out that this name is already taken by the main platform agnostic javascript:
Platform agnostic one(plugins/cordova-plugin-app-preferences/src/platform.js):
Platform specific one(plugins/cordova-plugin-app-preferences/src/windows8/platform.js):
That triggered the error!
With that in mind, I got it fixed, at least temporarily, by changing my plugin.xml to something like this:
90: <js-module src="src/windows8/platform.js" name="platform.w8">
97: <js-module src="src/windows8/platform.js" name="platform.windows">
Once I have done that, the cordova_plugins.js was generated without the duplication!!!
Platform agnostic one(plugins/cordova-plugin-app-preferences/src/platform.js):
Platform specific one(plugins/cordova-plugin-app-preferences/src/windows8/platform.js):