EddyVerbruggen / SocialSharing-PhoneGap-Plugin

👨‍❤️‍💋‍👨 Cordova plugin to share text, a file (image/PDF/..), or a URL (or all three) via the native sharing widget
MIT License
1.78k stars 906 forks source link

deploy ionic app with plugin to Windows device #481

Closed JohanBeumer closed 8 years ago

JohanBeumer commented 8 years ago

Hi,

I am having problems deploying an ionic app which includes the "cordova-plugin-x-socialsharing" plugin to a device.

In Visual Studio 2015 community I installed the project template "Ionic Tabs App" and created a new project for that. I added an empty directory "hooks". I added an empty file "package.json". Through "Package manager console" I installed the plugin "ionic plugin add cordova-plugin-x-socialsharing".

To get the app running at all I followed the instructions of this blog : http://blogs.msdn.com/b/saqib/archive/2015/08/19/making-ionic-apps-run-on-windows-phone-using-visual-studio-2015.aspx

When I then start the app for the emulator (Windows Phone Universal and both Windows 8.1 and Windows 10) everything is ok. When I deploy the app to an actual device (Windows 8.1 or Windows 10) it doesn't work. The error I get is :

"Error: Compile filter argument specified non-existent file: D:\IonicCordovaProject1\IonicCordovaProject1\platforms\windows\build\phone\bld\MSIL\plugins\cordova-plugin-x-socialsharing\src\wp8\SocialSharingSDK\Newtonsoft.Json.dll Invalid argument"

Indeed "Newtonsoft.Json.dll" isn't at that location so the error seems logical. But why is it looking in a wp8 location? The dll is available at "D:\IonicCordovaProject1\IonicCordovaProject1\platforms\windows\build\phone\bld\MSIL".

Do you have any suggestion for what I am doing wrong or a suggestion for how to solve this?

Thanks in advance!

EddyVerbruggen commented 8 years ago

Must have something to do with this recent addition: https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin/commit/0f1603b555482d86d2798f9a6dcbf63e6b8c2ad0

EddyVerbruggen commented 8 years ago

Could you try a fresh install with the plugin's master repo? I changed the plugin.xml a bit.

JohanBeumer commented 8 years ago

Thanks for the quick response!

Unfortunately it doesn't seem to work. The error is the same. I also tried changing the path in plugin.xml to the fully qualified path, but it keeps looking in the wp8 location.

EddyVerbruggen commented 8 years ago

I don't have VS currently so I hope someone else is able to help you..

ajeesh13 commented 8 years ago

I have also the same problem.Could you please provide us a quick solution.

Thanks in advance

EddyVerbruggen commented 8 years ago

If you need a quick solution please use an older version (5.0.6 or older).

raymens commented 8 years ago

I'm experiencing the same issue

JohanBeumer commented 8 years ago

In the meantime I succeeded in deploying my Ionic app including the social-sharing plugin (5.0.8) to my device.

In a very short summary this is what happened :

At this point I get the following builderror : MakeAppx : error : Error info: error C00CE015: App manifest validation error: The app manifest must be valid as per schema: Line 26, Column 200, Reason: The attribute 'ToastCapable' on the element '{http://schemas.microsoft.com/appx/manifest/uap/windows10}VisualElements' is not defined in the DTD/Schema.

Ignore this error and take a look at the new solution "CordovaApp" in "platforms/windows" which is created by the build proces. Open that new solution with Visual Studio. For the Universal Windows project doubleclick "package.windows10.appxmanifest". This will give an error, but you can open the file with the xml-editor. Look for 'ToastCapable="true"' and remove that. Now you can reopen "package.windows10.appxmanifest" by doubleclicking and you get a nice graphical tool for editing. But more importantly, you can also deploy the app to your device! At least I can.

Strangely, no error about the social sharing plugin. I have no clue if that has to do with changes to the plugin or the way I deploy it. But it works so I'm happy!

EddyVerbruggen commented 8 years ago

The wp8 issue of the newtonsoft.dll has now been fixed, available in 5.0.9.

The socialsharingproxy warning is related to the windows platform. I may look at it later, but this issue was for the wp8 problem.

raymens commented 8 years ago

5.0.9 did indeed not fix this for the windows platform. Should I create a new issue?

EddyVerbruggen commented 8 years ago

Yeah please do, thank you!

raymens commented 8 years ago

Actually, it seems to be the same problem. It's looking for Error: Compile filter argument specified non-existent file: D:\Workspaces\project\platforms\windows\build\phone\bld\MSIL\plugins\cordova-plugin-x-socialsharing\src\wp8\Newtonsoft.Json.dll Invalid argument that's actually located in D:\Workspaces\project\platforms\windows\plugins\cordova-plugin-x-socialsharing\src\wp8

I don't have any cordova plugin experience, but maybe windows needs to be added to cordova.platforms in package.json? Because it's missing, Cordova might fall back to the wp8 version when trying to compile the windows version?