Xamarin forms error Droid.Resource does not contain a definition for a string

Here the problem is the red lines below the line.

I am developing a xamarin form application and I am using a plugin to store PCL .. I think this is what causes the problem and I don’t know how to fix it. The problem occurs in my solution for Android.

public static void UpdateIdValues() { global::PCLStorage.Resource.String.ApplicationName = global::XamarinClients.Droid.Resource.String.ApplicationName; global::PCLStorage.Resource.String.Hello = global::XamarinClients.Droid.Resource.String.Hello; } 

I get this error:

Error 6 'XamarinClients.Droid.Resource' does not contain a definition for 'String' pathtomyapplication \ Resources \ Resource.Designer.cs

Has anyone had this problem?

+6
source share
2 answers

If you look in the Android documentation for localization, it mentions saving the application resource string in an xml file. There seem to be some hardcoded values ​​in android Xamarin.Forms Resource.Designer.cs. To fix it in the resource folder by values, add an XML file called String.xml and put in it:

 <?xml version="1.0" encoding="utf-8"?> <resources> <string name="ApplicationName">ApplicationName</string> <string name="Hello">Hello</string> </resources> 
+11
source

Often this can be solved by simply clearing the project and then selecting Rebuild.

0
source

All Articles