Repository: EddyVerbruggen/SocialSharing-PhoneGap-Plugin

Issue #754: Failed to find configured root that contains
Created: 2017-01-18T08:03:44Z
I am getting the following error when trying to share a file from a remote URL.

Here is my code.
var options = {
          message: 'share this', // not supported on some apps (Facebook, Instagram)
          subject: 'the subject', // fi. for email
          files: ["http://ngcordova.com/img/ngcordova-logo.png"], // an array of filenames either locally or remotely
          url: 'http://ngcordova.com/',
          chooserTitle: 'Pick an app' // Android only, you can override the default share sheet title
        }

        var onSuccess = function (result) {
          alert("Share completed? " + result.completed); // On Android apps mostly return false even while it's true
          alert("Shared to app: " + result.app); // On Android result.app is currently empty. On iOS it's empty when sharing is cancelled (result.completed=false)
        }

        var onError = function (msg) {
          alert("Sharing failed with message: " + msg);
        }

        window.plugins.socialsharing.shareWithOptions(options, onSuccess, onError);

Duplicate issue #755: Failed to find configured root that contains - Twitter Android
Created: 2017-01-18T18:52:58Z
The full error message is: cannnot share via twitter "Failed to find configured root that contains /storage/emulated/0/Android/data/org.cchd.NeonToNature/files/socialsharing-downloads/www.x-services.nl"
Using:

Ionic Modules v1.x
Ionic CLI v2.1.18
Cordova-Android v5.2.2
Cordova CLI v6.4.0
LG Risio Device H343 with Android OS v6.0 installed
ngCordova v0.1.27-alpha
cordova-plugin-x-socialsharing v5.1.4

When a button is clicked, a $scope function is triggered having the following code:
$scope.shareViaTwitter = function() {
  console.log('[controllers.js] you want to share via twitter');
  
  $cordovaSocialSharing
    .canShareVia(
      "twitter",
      "hello",
       null,
      "http://www.x-services.nl"
  )
  .then(function(result) {
       // Success!
       console.log("can share via twitter...");
       $cordovaSocialSharing
       .shareViaTwitter(
          "hello",
          null,
          "http://www.x-services.nl"
       )
       .then(function() {
          console.log("successfully shared via twitter");
       }, function(err2) {
          console.log("failed to share via twitter " + JSON.stringify(err2));
       });
    }, function(err1) {
      // An error occurred. Show a message to the user
      console.log("cannnot share via twitter " + JSON.stringify(err1));
    });
};

The Twitter app for Android is installed and I have successfully logged in to it.
I'm not sure what the error message is or how to fix it. And after multiple attempts, I cannot send a message to Twitter via this mobile app project.
The last time I remember that this plugin worked was last August 2016. And that, the Cordova-Android was version 5.1.1.
Without .canShareVia() and only using .shareViaTwitter(), the Twitter app shows up. And, I can change the message and tap the tweet button. The console log says "successfully shared via twitter" but the post never gets posted to Twitter. There are no other messages or notifications from the plugin or the Twitter app if the post was truly a success or a failure. This has also been done multiple times and the posts do not show up on Twitter.

Closing comment (2017-01-20T20:00:01Z): This is a duplicate of #754