CommandInvokationFailure: Failed to re-package resources. I've tried everything! Dx

So I had a problem a few days ago. That my SSD was full. I don’t really store a lot on it, only some core programs and the likes. I also had the Android SDK on it. And that took up some 65GB. So, not finding anything else to move which would free up a lot of space. I decided to move the Android SDK to my hard drive. I uninstalled it using the android sdk manager. And reinstalled it on a folder in my hard drive. Only now, when I build the apk. I get this error when it tries to package the resources

Error building Player: CommandInvokationFailure: Failed to re-package resources. See the Console for details.
E:\AndroidSDK\build-tools\24.0.0-preview\aapt.exe package --auto-add-overlay -v -f -m -J gen -M AndroidManifest.xml -S "res" -I "E:/AndroidSDK\platforms\android-23\android.jar" -F bin/resources.ap_ --extra-packages com.google.example.games.mainlibproj:com.google.android.gms.base:com.google.android.gms:com.google.android.gms.drive:com.google.android.gms.games:com.google.android.gms.nearby:com.google.android.gms.plus:android.support.v4:com.unity3d.ads.android -S "C:\Users\Highwalker\Documents\ReeferMadness\Temp\StagingArea\android-libraries\play-services-base-8.4.0\res" -S "C:\Users\Highwalker\Documents\ReeferMadness\Temp\StagingArea\android-libraries\play-services-basement-8.4.0\res" -S "C:\Users\Highwalker\Documents\ReeferMadness\Temp\StagingArea\android-libraries\play-services-drive-8.4.0\res" -S "C:\Users\Highwalker\Documents\ReeferMadness\Temp\StagingArea\android-libraries\play-services-games-8.4.0\res" -S "C:\Users\Highwalker\Documents\ReeferMadness\Temp\StagingArea\android-libraries\play-services-nearby-8.4.0\res" -S "C:\Users\Highwalker\Documents\ReeferMadness\Temp\StagingArea\android-libraries\play-services-plus-8.4.0\res" -S "C:\Users\Highwalker\Documents\ReeferMadness\Temp\StagingArea\android-libraries\support-v4-23.1.1\res" -S "C:\Users\Highwalker\Documents\ReeferMadness\Temp\StagingArea\android-libraries\unityads-release\res"

stderr[

]
stdout[
Configurations:
 (default)

Files:
  drawable\unityads_background_button_pause.xml
    Src: () C:\Users\Highwalker\Documents\ReeferMadness\Temp\StagingArea\android-libraries\unityads-release\res\drawable\unityads_background_button_pause.xml
  drawable\unityads_icon_play.xml
    Src: () C:\Users\Highwalker\Documents\ReeferMadness\Temp\StagingArea\android-libraries\unityads-release\res\drawable\unityads_icon_play.xml
  drawable\unityads_icon_speaker_base.xml
    Src: () C:\Users\Highwalker\Documents\ReeferMadness\Temp\StagingArea\android-libraries\unityads-release\res\drawable\unityads_icon_speaker_base.xml
  drawable\unityads_icon_speaker_triangle.xml
    Src: () C:\Users\Highwalker\Documents\ReeferMadness\Temp\StagingArea\android-libraries\unityads-release\res\drawable\unityads_icon_speaker_triangle.xml
  drawable\unityads_icon_speaker_waves.xml
    Src: () C:\Users\Highwalker\Documents\ReeferMadness\Temp\StagingArea\android-libraries\unityads-release\res\drawable\unityads_icon_speaker_waves.xml
  layout\unityads_button_audio_toggle.xml
    Src: () C:\Users\Highwalker\Documents\ReeferMadness\Temp\StagingArea\android-libraries\unityads-release\res\layout\unityads_button_audio_toggle.xml
  layout\unityads_button_pause.xml
    Src: () C:\Users\Highwalker\Documents\ReeferMadness\Temp\StagingArea\android-libraries\unityads-release\res\layout\unityads_button_pause.xml
  layout\unityads_view_video_paused.xml
    Src: () C:\Users\Highwalker\Documents\ReeferMadness\Temp\StagingArea\android-libraries\unityads-release\res\layout\unityads_view_video_paused.xml
  layout\unityads_view_video_play.xml
    Src: () C:\Users\Highwalker\Documents\ReeferMadness\Temp\StagingArea\android-libraries\unityads-release\res\layout\unityads_view_video_play.xml
  values\values.xml
    Src: () C:\Users\Highwalker\Documents\ReeferMadness\Temp\StagingArea\android-libraries\unityads-release\res\values\values.xml
  AndroidManifest.xml
    Src: () AndroidManifest.xml

Resource Dirs:
  Type drawable
    drawable\unityads_background_button_pause.xml
      Src: () C:\Users\Highwalker\Documents\ReeferMadness\Temp\StagingArea\android-libraries\unityads-release\res\drawable\unityads_background_button_pause.xml
    drawable\unityads_icon_play.xml
      Src: () C:\Users\Highwalker\Documents\ReeferMadness\Temp\StagingArea\android-libraries\unityads-release\res\drawable\unityads_icon_play.xml
    drawable\unityads_icon_speaker_base.xml
      Src: () C:\Users\Highwalker\Documents\ReeferMadness\Temp\StagingArea\android-libraries\unityads-release\res\drawable\unityads_icon_speaker_base.xml
    drawable\unityads_icon_speaker_triangle.xml
      Src: () C:\Users\Highwalker\Documents\ReeferMadness\Temp\StagingArea\android-libraries\unityads-release\res\drawable\unityads_icon_speaker_triangle.xml
    drawable\unityads_icon_speaker_waves.xml
      Src: () C:\Users\Highwalker\Documents\ReeferMadness\Temp\StagingArea\android-libraries\unityads-release\res\drawable\unityads_icon_speaker_waves.xml
  Type layout
    layout\unityads_button_audio_toggle.xml
      Src: () C:\Users\Highwalker\Documents\ReeferMadness\Temp\StagingArea\android-libraries\unityads-release\res\layout\unityads_button_audio_toggle.xml
    layout\unityads_button_pause.xml
      Src: () C:\Users\Highwalker\Documents\ReeferMadness\Temp\StagingArea\android-libraries\unityads-release\res\layout\unityads_button_pause.xml
    layout\unityads_view_video_paused.xml
      Src: () C:\Users\Highwalker\Documents\ReeferMadness\Temp\StagingArea\android-libraries\unityads-release\res\layout\unityads_view_video_paused.xml
    layout\unityads_view_video_play.xml
      Src: () C:\Users\Highwalker\Documents\ReeferMadness\Temp\StagingArea\android-libraries\unityads-release\res\layout\unityads_view_video_play.xml
  Type values
    values\values.xml
      Src: () C:\Users\Highwalker\Documents\ReeferMadness\Temp\StagingArea\android-libraries\unityads-release\res\values\values.xml
Including resources from package: E:\AndroidSDK\platforms\android-23\android.jar
applyFileOverlay for drawable
trying overlaySet Key=ic_plusone_medium_off_
]

I saw several posts on similar invokation failures. But none of the extra details match my error. And I’ve tried every single thing which was suggested to fix this error. From further research, I found tht it might be due to some xml is probably refrencing the old sdk path somewhere. But I can’t find a path like that anywhere in any of the xml files. And I’m just completely stumped on how to fix it. Please help. This has taken up days of my time.

Go into %appdata% on Windows and delete all .android folders you see (in Roaming , and up one folder in Local and LocalLow . These each represent a portion of the Android SDK.)

You cannot just “move the SDK” to another hard drive, it must be installed there (the resgistry needs to know where various utilities like adb.exe are located.) You should delete the copied folder, and install the SDK fresh on your new disk.

If you need even more space free consider:
CCleaner with CCEnhancer (get the free versions).
https://www.piriform.com/ccleaner/download/standard

Edit Normally when something confusing and inexplicable happens, I will use the Unity Editor 5 Packaging system to export my entire Scene + Dependencies (90% of my project if I have no unused assets, e.g: lean project); and import them into a new project. Sometimes something just broke along the way.

Same error and more or less same error logs for I have been using Facebook SDK and Unity Ads.Initially, there was a problem with “minsdk” in Android manifest , I fixed that. After that this error took place.The things I did follow

Step 1: Deleted SDK version 23 Preview in SDK manager. what to delete

Step 2: Restart SDK manager.

Step 3: Log out Unity Services (if you have unity Ads enabled).

Step 4: Reimport All in Unity3d.

Step 5: Log in Unity Services and enable Ads now.

Thats all I did and the problem fixed.Hope this helps .