Resource.Designer.cs: "The resource ... does not contain a definition for ..."

Today I updated the NuGet packages for our version of Android (we are currently developing for Android and iOS). After the updates, I can no longer build the version of Android. This is a problem that I encountered every time after updating the packages so far, but this time I can not solve this problem. Normally restarting Xamarin or reinstalling NuGet packages helped.

I have 151 error message similar to this:

/Users/Username/Projects/MyAppName/Droid/Resources/Resource.designer.cs(118,118): Error CS0117:> MyAppName.Droid.Resource.Attribute 'does not contain a definition for mediaRouteSettingsDrawable' (CS0117) (MyAppName.Droid)

Here are all the steps that I have already tried to fix this problem (in that order):

  • Assembly → Clear All
  • Remove each NuGet package from each project (Droid, iOS, SyncLibrary (native library for SQL server communication) and UITest)
  • Delete everything inside the file "Resource.Designer.cs"
  • Close Xamarin
  • Install each package in the SDK Manager for each version
  • Delete package folder for solution
  • Delete the contents of /Users/Username/.local/share/Xamarin
  • Delete the contents of /Users/Username/.local/share/NuGet/cache
  • Launch Xamarin
  • Add Newtonsoft.Json Package to SyncLibrary
  • Add Android packages: add only the necessary packages, let NuGet resolve dependencies (e.g. Xamarin.Android.Support, Xamarin.GooglePlayServices, etc.) yourself. Installed packages (in this order):

    Xamarin.Forms ....................................... (2.2.0.45)
    Xamarin.Forms.Maps ........................... (2.2.0.45)
    XLabs.Forms ............................................ (2.0. 5782)
    ZXing.Net.Mobile .................................. (2.0.4.46)
    Newtonsoft.Json .................................... (8.0.3)
    Xam.Plugin.Geolocator ........................ (3.0.4)

  • Assembly → Clear All

  • Restart xamarin
  • Assembly new: SyncLibrary (therefore, when trying to create a version for Android there is no dependency error)
  • Create new version: Android version -> Error

I really don't know what to do next. Any help / ideas are appreciated, thanks in advance.

+7
android c # xamarin.android xamarin.forms xamarin-studio
source share
3 answers

Xamarin.Forms ... (2.2.0.45)

XLabs.Forms ..... (2.0.5782)

This is the point. The latest stable Xamarin.Forms has some problems that can cause build errors when using XLabs or another library.

The only solution I know is to use the preliminary version of XLabs.Forms - 2.2.0-pre02 .

In my case, I updated the XLabs packages and cleaned / rebuilt my solutions.

See the XLabs and Xamarin Bugzilla Question Tracking for more information.

+4
source share

I had similar errors, but I did not use XLabs.Forms. I saw that you used ZXing.Net.Mobile the same way I did - I updated this to the latest preliminary release (at time of writing: 2.1.0-beta1), as well as helpep.

0
source share

I have the same problem with my Xamarin solution

You tried:

  • Exit Visual Studio
  • Removing c: \ Users \ username \ AppData \ Local \ Xamarin
  • Reopen the solution.
  • Compile, wait until it is completely over.

Anyway, found this link, maybe it was useful: Xamarin: Build action EmbeddedResource

0
source share