Reputation: 21
When I try to build a .apk file it gives me the following 2 errors:
Error building Player: Win32Exception: ApplicationName='C:/Users/Teodor/AppData/Local/Android/android-sdk/platforms/android-18\aapt.exe', CommandLine='package -v -f -m -J gen -M AndroidManifest.xml -S "res" -I "C:/Users/Teodor/AppData/Local/Android/android-sdk/platforms/android-18\android.jar" -F bin/resources.ap_', CurrentDirectory='Temp/StagingArea' UnityEditor.HostView:OnGUI()
and
Exception: Error building Player: Win32Exception: ApplicationName='C:/Users/Teodor/AppData/Local/Android/android-sdk/platforms/android-18\aapt.exe', CommandLine='package -v -f -m -J gen -M AndroidManifest.xml -S "res" -I "C:/Users/Teodor/AppData/Local/Android/android-sdk/platforms/android-18\android.jar" -F bin/resources.ap_', CurrentDirectory='Temp/StagingArea' UnityEditor.BuildPlayerWindow.BuildPlayerWithDefaultSettings (Boolean askForBuildLocation, BuildOptions forceOptions) (at C:/BuildAgent/work/842f9557127e852/Editor/Mono/BuildPlayerWindow.cs:367) UnityEditor.BuildPlayerWindow.GUIBuildButtons (Boolean enableBuildButton, Boolean enableBuildAndRunButton, Boolean canInstallInBuildFolder) (at C:/BuildAgent/work/842f9557127e852/Editor/Mono/BuildPlayerWindow.cs:972) UnityEditor.BuildPlayerWindow.ShowBuildTargetSettings () (at C:/BuildAgent/work/842f9557127e852/Editor/Mono/BuildPlayerWindow.cs:953) UnityEditor.BuildPlayerWindow.OnGUI () (at C:/BuildAgent/work/842f9557127e852/Editor/Mono/BuildPlayerWindow.cs:726) System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation. System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at C:/BuildAgent/work/842f9557127e852/Editor/Mono/GUI/DockArea.cs:225) UnityEditor.HostView.Invoke (System.String methodName) (at C:/BuildAgent/work/842f9557127e852/Editor/Mono/GUI/DockArea.cs:218) UnityEditor.HostView.OnGUI () (at C:/BuildAgent/work/842f9557127e852/Editor/Mono/GUI/DockArea.cs:119)
and I dont know how to fix it.
In Unity 4.2.0 it doesn't give me any errors, but in 3.4.2 even if the project contains just the main camera and a cube it gives me these errors and the .apk file is not built. How can I resolve this?
Upvotes: 2
Views: 8106
Reputation: 3491
I had an error very similar to this. What solved it for me was installing the Android SDK Build Tools using the Android SDK Manager.
Upvotes: 1
Reputation: 6726
Try to search the Android SDK directory for the file aapt.exe. In the later versions, it was moved to android-sdk/build-tools/18.0.0/. Look there and, if you find it, copy it from there to your android-sdk/platforms/android-18 folder.
Upvotes: 1
Reputation: 9217
There are some new Tools introduced in Android sdk -18 so the old unity version will not work with new android tools as most of them are changed.
Upvotes: 0