Edit

Share via


.NET for Android error/warning APT2000

Example APT2000 error messages

  • error APT2000 Cannot find the specified file
  • error APT2000: Resource entry resource_name is already defined.
  • error APT2000: No resource found that matches the given name (at 'resource_name' with value '@string/foo').
  • error APT2000: invalid resource directory name: "obj\Debug\dir with spaces" "dir with spaces".
  • warning APT2000: warn: removing resource com.companyname.example:drawable/foo without required default value.

Issue

This message indicates that aapt2 (Android Asset Packaging Tool) reported an error or warning. aapt2 is part of the Android SDK and is used internally by .NET for Android to process and compile resources into binary assets.

Errors reported by aapt2 are outside of .NET for Android's control, so a general error code of APT2000 is used to report the exact message coming from aapt2.

Solution

Reading the actual error message and looking at the diagnostic log output can usually give you enough information to solve the issue yourself. It can be helpful to do an internet search for the error message. Looking at solutions which are for Java based Android applications can also help.

To learn more about aapt2 and Android resources, see the Android documentation.