Having problems exporting to APK

Whenever I try to export my android application I get an error, I have no idea what is going on and I have spent the past 5 hours looking on the internet for a solution. If anyone could help, that would be great.

Here is the error:

CommandInvokationFailure: Failed to re-package resources. See the Console for details.
E:\Users\Max\AppData\Local\Android\android-sdk\build-tools\24.0.0-preview\aapt.exe package --auto-add-overlay -v -f -m -J gen -M AndroidManifest.xml -S "res" -I "E:/Users/Max/AppData/Local/Android/android-sdk\platforms\android-23\android.jar" -F bin/resources.ap_

stderr[

]
stdout[

]
UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
UnityEditor.Android.PostProcessAndroidPlayer.Exec (System.String command, System.String args, System.String workingdir, System.String[] progress_strings, Single progress_value, System.String errorMsg)
UnityEditor.Android.PostProcessAndroidPlayer.CompileResources (System.String stagingArea, System.String packageName, UnityEditor.Android.AndroidLibraries androidLibraries)
UnityEditor.Android.PostProcessAndroidPlayer.PostProcessInternal (System.String stagingAreaData, System.String stagingArea, System.String playerPackage, System.String installPath, System.String companyName, System.String productName, BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry)
UnityEditor.Android.PostProcessAndroidPlayer.PostProcess (BuildTarget target, System.String stagingAreaData, System.String stagingArea, System.String playerPackage, System.String installPath, System.String companyName, System.String productName, BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry)
UnityEditor.HostView:OnGUI()

This is because Unity is using Preview build tools in Android SDK. Here’s the fix

Android SDK Manager > Tools (Preview Channel) > Delete (24rc2, 24rc3) packages. And try building it. It will work.