Xamarin.Android release build fails with 'STRING_TOO_LARGE' message - xamarin.android

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…?

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.

Related

Specflow generated feature.cs file not working

Last time it actually worked: Monday 27/07/2018
I've been using specflow for around 2 years now. But as of today (this week) I've got an issue I never encountered before. When changing even a single letter in the .feature file as usual Specflow will regenerate the .feature.cs file. But there it's going wrong. The file becomes blank with just a single line which is a reference to my temp folder C:\Users\Me...
The thing about my username is that it's my real name and it contains a special character: "ë". Could there be a new bug introduced in the newest version from monday 6/08/2018? If so, is there a workaround while waiting for it to be fixed? Or is something entirely different going wrong?
There is a bug in the latest version of the Visual Studio extension which has problems with special chars in the username, because it's used in the path to the temp directory.
There is a post about it in the forum (https://groups.google.com/forum/#!topic/specflow/977_H2ICwT8).
The quickest way to workaround this, is to change the generation mode to AppDomain (Tools\Options\SpecFlow)
The better way is to switch to the MSBuild generation, as we will remove the AppDomain generation mode in the next months.

Jenkins Change Assembly Info Plugin not working on Linux Host and Windows Slave

I have a configuration using a Linux Jenkins master and a Windows 10 slave. I'm using it to do an msbuild operation on the slave and generate an install executable as an artifact. I have this working on a Jenkins Windows 10 master system (same one I'm using as a slave), and this all works fine. However, when I run the same job remotely I get the dreaded "CS1031" error:
Properties\AssemblyInfo.cs(1,1): error CS1031: Type expected [C:\slave2Workspace\workspace\SDB Projects\CCMonitor\CCMonitor\CCMonitor\CCMonitor.csproj]
This is pointing at the first character in the file. If I omit the job step with the Change Assembly Info plugin, everything works fine and I get the output correct. What I found was that the AssemblyInfo.cs file was missing the characters 0xEB 0xBB at the front of the file -- these somehow got dropped in the translation. Sounds like a character set issue, but it is only an issue with this plugin step.
Is there something that needs to be configured differently?
thanks!!
So I had this same issue today and found the solution. Not sure if you ever figured this one out, so I wanted to drop the solution just in case.
Turned out to be an encoding issue. The assembly file is encoded UTF-8 with signature. As a workaround to avoid the characters being added to the beginning of the file, change the encoding to UTF-8 without signature.
I did this by opening the files in notepad++ and then selecting Encoding -> Encode in UTF-8
If you are working with Visual Studio (2017 in my case)
Open the file with the problem
Select File | Save As
On the Save button there is drop down with option stating Save with Encoding
In the list with encodings select UTF-8 without signature
VS may tell you that there is already such file, you select to overwrite it.
Commit>Push with your source control (git in my case), and voila - that's it.

What is “Character Encoding” used for in Rational Team Concert?

I’m a bit confused about the “Character Encoding” in Rational Team Concert, while having trouble with UTF-8 encoded files that are now stored in RTC. (I never had any trouble with these files before.)
The “Character Encoding” shows up in the Eclipse client (at least) here:
File Compare.
Jazz SCM Properties.
The “Character Encoding” is not displayed in the Visual Studio RTC client, at least I could not find it. (Of course, VS has its own ways to display and change encoding of files, but these are independent of RTC.)
I saw several files that are version controlled with MIME Type text/plain which have different “Character Encoding”s for nearly every revision, sometimes changing from UTF-8 to Cp1252 back and forth. Usually, only a few lines in a large file are changed.
It seems to me that automatic merge with the Visual Studio client regularly, but not always, gets confused with encoding and/or byte order marks and changes non 7-bit-ASCII characters. I cannot reproduce this.
I learned several things from a good answer:
Encoding isn’t stored on the server, it is client-only.
scm set property file.encoding sets a user property (and this even can be set to random value such as foo). However:
As far as I can see, file.encoding is completely ignored by Visual Studio, although this doc says:
To change the encoding for files that are checked in from the CLI or Rational Team Concert Client for Microsoft Visual Studio IDE, run scm set property [...] Example: scm set property file.encoding UTF-8 path/to/file.
tl;dr: My question is: Is this “Character Encoding” and/or “file.encoding” of any relevance, and if yes, what is it used for?
Following the FAQ, it is used by an RTC Client (Eclipse or VS) at the checkin phase.
If the encoding specified there differs from the one used in the file you want to check-in, there will be an error:
Basically, there is a text file that Jazz attempted to read when checking in the project contents that it could not because the content does not adhere to the encoding rules. The error message should provide you with the name of file that caused the problem.
Within Eclipse, you have a default encoding for text files.
To see what it is, from the toolbar select Windows > Preferences... > General > Workspace.
If this is not the encoding for most of your text files, you should change it here.
When working within a team you should decide upon a common encoding that you and your team will use. That encoding should also be available on the server (for annotate to work well). You will need to communicate with the rest of your team what the encoding is.

Srctool.exe returns -1 error code in TFS

We just set up TFS 11 for the first time. Running a gated check in, it succeeds but returns this message:
'srctool.exe' returned an unexpected exit code: '-1'. An error
occurred when opening a file "CustomDllName.dll": Assembly
"CustomDllName.dll" is not a valid .NET assembly and will be skipped
for analysis.
Well, it's right: that file is a legacy Visual Basic 6 DLL that we don't have much control over. It's included in the project for COM access to some of the methods.
Is there a way to instruct srctool.exe/TFS to skip that file when doing the inspection? Or another way to attack this?
Here is the solution that ultimately worked for me
A member of the TFS 11 team at Microsoft mentioned to me that the problem is due to a change in behavior that the Windows 8 team made to the srctool.exe tool.
By copying this file from the Windows 7 SDK (WinDBG) toolkit and overriding the one included in TFS 11 Beta, I was able to successfully run a build without any errors.
Is this a srctool.exe error from the shipped IndexSources activity? srctool.exe in this activity does one thing, which is to list the source files information in the pdb. I am not a srctool expert so I don't know why it fails in this case. I do know that srctool.exe has some behavioral changes in version 11, most of those are fixes from the previous version.
There is a workaround which requires udpating the build template. It is not very nice but it works. Srctool.exe is run (inside IndexSources activity) for each pdb file in the SymbolFiles collection. Now that you know which pdb fails, you can update the build template to add a RemoveFromCollection activity before the IndexSources activity that remove the troubled pdb from the SymbolFiles collection. This is by far the most straightforward workaround I can think of.
Alternatively, you can edit FindMatchingFiles activity's search pattern to exclude the pdb files you don't want to have sources indexed.
Based on the error message you got, it doesn't seem to be related to the known issue Ed mentioned. We fixed this issue for the next release, so if it's related, it should be fixed :-)
Let me know if you have any issue with VS11 Beta around the build templates.
Thanks.

Error in xml file while creating a project in black berry

I just created a new project in the eclipse and as soon as it was created, it is created with the error below
InvalidRegex:
Pattern value '([a-zA-Z_]{1,63}[\s-a-zA-Z_0-9.]{0,63}[;]?)*' is not a valid
regular expression.
The reported error was: ''-' is an invalid character range.
Write '\-'.' at column '{2}'.
BlackBerry_App_Descriptor.xml Unknown XML Problem.
This is the problem which we will get when there is jre7 in our system which is not supported by eclipse
What is the problem here? How can i rectify this? thank you
Google shows this is related to Java 7. Check these two links:
http://supportforums.blackberry.com/t5/Java-Development/problem-with-the-BlackBerry-App-Descriptor-xml-in-Eclipse-Plug/td-p/959029 and http://cdrussell.blogspot.com/2011/09/blackberry-eclipse-error-invalid-regex.html
The second one tells:
Turns out this could be caused by having Java JRE 7 installed on your
machine. The BlackBerry plugin doesn't support this yet, Eclipse might
be trying to use that.
The fix? You simply have to edit the eclipse.ini that will live in the
same directory as your eclipse.exe that you use to start the IDE.
Closing Eclipse and making a backup of eclipse.ini before you do this
would be a good idea.
Find the line "openFile" and immediately after, add the following:
-vm C:/Program Files/Java/jre6/bin/javaw.exe [or wherever your jre6 directory might be]
Cross your fingers and restart Eclipse. Rebuild your projects.

Resources