Since updating to today's stable release 4.6.2 of Xaramin.Android, I've been unable to build my app successfully:
'[app].Resource.String' does not contain a definition for 'library_name'
It compiled fine prior to the update. Has anyone else encountered this? How do I resolve is?
I need to have a build ready in the next 30 minutes! It's always the way...
Posts
[REMOVED]
The generated Resource.desginer.cs classes are slightly different now. I don't have time to mess around with this though - I just need to get a build out!
How can I roll back to the previous Xamarin.Android release?
You could go to your store page and download the previous version at https://store.xamarin.com/account/my/subscription/downloads
Thanks. Downloading 4.6 now...
Rolling back to 4.6 has addressed the problem [phew].
So... It looks like there is an issue with Resource.designer.cs generation in 4.6.2
Go to your Subscription Downloads page.
Click the
View all versions
link:Under e.g. Xamarin.Android, click the down arrow next to your desired platform, e.g. Windows Installer.
Click the desired version you wish to download.
Thanks. I managed to roll back to 4.6, and it did enable me to re-build successfully again.
4.6.2 appears to have an issue with Resource.designer.cs generation.
As no one else is coming on here to report the same problem, I guess I should report it as an issue (now that I have a spare few moments)...
I submitted a ticket yesterday after upgrading to 4.6.2 my project errors with LegacyBar send them a example this morning with the issue
I'm getting the exact same issue now as well...
Like MilkyJoe, I was able to downgrade to 4.6.0 and the app recompiles again without the error.
Dave Wright posted one work around at Bug 11697 Libraries no longer compile.
So does it say 4.6.2 has an issue ?
4.6.2 has the issue. 4.6.4 fixes it.
Weirdly, I've just started to experience a similar issue to this after updating to 4.7.9, earlier today:
xxx.Resource.String.ApplicationName = yyy.Resource.String.ApplicationName;
xxx.Resource.String.Hello = yyy.Resource.String.Hello;
xxx.Resource.String does not contain a definition for 'ApplicationName'
And where did the 'Hello' reference come from?!
This morning I had a working solution with 2 Android projects with linked files to shared sources.
As I didn't like the situation with linked files I have created 2 C# libary projects. Right after that I got as well that error:
[app].does not contain a definition for 'Hello'
I currently have version 4.10.2 installed.
I could solve the issue by providing the string "Hello" in the resources. Where does that "Hello" come from?
I'm having this issue now as well. This seems to be a recurring bug?
I cleaned up the solution, build it again and worked.
If you look in the android documentation for localization it mentions storing application resource string in an xml file. Apparently there are some hard coded values in the android Xamarin.Forms Resource.Designer.cs. To fix it in the resources folder under values add an XML file named String.xml and in it put: