0

We have a quite complex Xamarin.Android project that can be built using Debug version in Visual Studio 2019 v16.3.

Whenever I set it to build the Release version, I get this error:

Xamarin.Android.Common.targets(1657,2): error APT0000: string too large to encode using UTF-8 written instead as 'STRING_TOO_LARGE'.

Xamarin.Android.Common.targets(1657,2): error APT0000: string too large to encode using UTF-8 written instead as 'STRING_TOO_LARGE'.

I checked our strings.xml file and replaced all the 'long' texts (more that 30 characters) with a single letter but the error persists. Also checked the anim and drawable xml files but they don't contain long paths or anything resembling a long string.

Unfortunately the error does not tell what the string is...

How should I fix this?

UPDATE:

We tried to build it on a separate machine and the error appears there as well. It seems that actually there is a very long string somewhere in the code. Who designed that error message and thought that it would be useful…?

Nestor
  • 8,194
  • 7
  • 77
  • 156
  • try to clean you project ,delete the obj and bin file,and rebuild – Leo Zhu Oct 14 '19 at 09:43
  • @LeoZhu-MSFT Tried but no effect. I found a quite long `pathData` (with 11k+ character) in one of the drawables but when I remove it, the error remains. Can I somehow find the exact one? – Nestor Oct 14 '19 at 09:59

1 Answers1

0

It seems that software can find what the human eye can't…

I've created a Powershell script to count the characters inside the files and turned out that we have 2 drawables with lengths over 32k.

When I truncated them the build was successful. Strange that we could release the software with Visual Studio 16.2.

Nestor
  • 8,194
  • 7
  • 77
  • 156