Search code examples
c#xamarinxamarin.iosrider

Rider cannot resolve symbols related to Xamarin.iOS framework


JetBrains Rider states that it cannot resolve quite a lot of symbols including UITableViewCell, ContentView, bool, decimal, string, void and many more.

Rider IDE

In the solution explorer, Rider indicates a warning sign for all the Assemblies.

assemblies

Below are my build settings,

build settings

.csproj of the iOS project contains,

...
<ItemGroup>
    <Reference Include="Microsoft.CSharp" />
    <Reference Include="System" />
    <Reference Include="System.IO.Compression" />
    <Reference Include="System.Net.Http" />
    <Reference Include="System.Runtime" />
    <Reference Include="System.Xml" />
    <Reference Include="System.Core" />
    <Reference Include="Xamarin.iOS" />
...

I've tried restoring NuGet packages and restarting Rider after Invalidating Caches.

I'm using the latest stable version of Rider 2022.2.4 and I've even tried the latest EAP version 2022.3 EAP 9 but nothing seems to work. However, the project runs/debugs without an issue in both physical devices and iOS simulators in Rider. Visual Studio 17.4 doesn't show these errors and works fine. Running on MacOS 12.6.1 if that's relevant.

Any help is highly appreciated.


Solution

  • Update Feb 08, 2024: Issue once again appeared in Rider version 2023.3.3. Now even restarting the IDE does not work.


    Update Oct 23, 2023: This has not been an issue for me since the Rider version 2023.2.2. It seems that the issue is fixed now.


    Update Mar 09, 2023: At this point my solution to this problem is just restarting Rider until it gets fixed. I know this is not a stable solution but it works with 2-3 restart attempts. Just close Rider, open it again and wait for the project to sync.


    Update Feb 10, 2023: Found the previous solution to be unreliable. It doesn't always work. The issue appeared again after updating the MacOS to 13.2; I hardly believe it's related to the MacOS update.


    So the issue was that NuGet packages were not getting restored properly in Rider. The solution was to restore NuGet packages using Visual Studio.

    • Open Visual Studio
    • Switch to the iOS solution and choose the correct configuration (Debug/Release) and platform (Device/Simulator)
    • Right-click on the project name in the Solution panel
    • Click Restore NuGet Packages

    Wait until the restoration completes, switch to Rider, and wait for it to synchronise project files if it still has the issue try restarting Rider.