Remove and re-add the Android platform from your Ionic/Cordova project after changing the app ID. This regenerates all platform specific code like config.xml. (If you still want to find out what caused the problem, generate your app twice with different app IDs and compare the generated folders and files to see how they differ)

Until the plugin author makes the necessary change, you can modify the file “plugin.xml” under /node_modules/cordova-plugin-x-socialsharing and add the android:exported=“true” there so that each time you compile, the generated manifest file for this plugin gets it:

 was ready to try to debug this error, so:

  • I update my ionic/cordova cli (2.1.0/6.3.1 respectively)
  • I did a
    ionic platform remove android
    ionic platform add android
  • I manually added google-services.json file to android root folder
  • I opened the build.gradle file and found defaultConfig section

Then I realised that there was a new line on that section (which didn't exist before)
applicationId privateHelpers.extractStringFromManifest("package")

So before touching any code I tried to compile with ionic build android and... voila! It's working like a charm now... Surely the guys from Ionic/Cordova fixed the problem for us! I'm very glad :P