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.
android c # xamarin.android xamarin.forms xamarin-studio
Tobe
source share