realm-dotnet icon indicating copy to clipboard operation
realm-dotnet copied to clipboard

Remove osx dependencies from Xamarin Android project

Open TRtomasz opened this issue 4 years ago • 1 comments
trafficstars

Goals

Build project without warnings and not valid references

Expected Results

I would like to get rid of osx dependenceis and warning that you can find below. This is empty xamarin android navigation drawer template app with only realm nuget package added. Tried to solve Microsoft.Csharp issue but adding it as a nuget package didnt help.

Actual Results

image

Dependency "Microsoft.CSharp, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a". 1> Could not resolve this reference. Could not locate the assembly "Microsoft.CSharp, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. 1> For SearchPath "C:\Users\troki\.nuget\packages\realm\10.1.1\lib\netstandard2.0". 1> Considered "C:\Users\troki\.nuget\packages\realm\10.1.1\lib\netstandard2.0\Microsoft.CSharp.dll", but it didn't exist. 1> For SearchPath "{TargetFrameworkDirectory}". 1> Considered "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v9.0\Microsoft.CSharp.dll", but it didn't exist. 1> Considered "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v8.1\Microsoft.CSharp.dll", but it didn't exist. 1> Considered "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v8.0\Microsoft.CSharp.dll", but it didn't exist. 1> Considered "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v7.1\Microsoft.CSharp.dll", but it didn't exist. 1> Considered "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v7.0\Microsoft.CSharp.dll", but it didn't exist. 1> Considered "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v6.0\Microsoft.CSharp.dll", but it didn't exist. 1> Considered "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v5.1\Microsoft.CSharp.dll", but it didn't exist. 1> Considered "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v5.0\Microsoft.CSharp.dll", but it didn't exist. 1> Considered "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v4.4.87\Microsoft.CSharp.dll", but it didn't exist. 1> Considered "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v4.4\Microsoft.CSharp.dll", but it didn't exist. 1> Considered "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v1.0\Microsoft.CSharp.dll", 1> but its name "Microsoft.CSharp, Version=2.0.5.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" 1> didn't match the expected name "Microsoft.CSharp, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a". 1> Considered "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v1.0\Facades\Microsoft.CSharp.dll", but it didn't exist. 1> Required by "C:\Users\troki\.nuget\packages\realm\10.1.1\lib\netstandard2.0\Realm.dll".

Steps to Reproduce

1.Create Xamarin android project 2. Add realm dependency 3. Unload and reload project to see ios dependencies

Code Sample

Version of Realm and Tooling

  • Realm Object Server Version: ? (you can see this as well in Studio once connected to a Realm instance)
  • Flavor:
    • [ ] Realm Cloud
    • [ ] Self-Hosted
  • Server OS & Version: ? (e.g. CentOS 6)
  • Client SDK Version: ?
  • Client OS & Version: ?

TRtomasz avatar Mar 17 '21 11:03 TRtomasz

Hi TRtomasz,

The ios references that show up under "References" are a known visualization bug in VS. Unfortunately we can't do much about that. Of course, because of this those references won't end up in the final apk. You can verify this last statement by yourself, just decompress the built apk and look into the lib folder, selecting any of the listed architectures. You should not see any of the dylib listed in VS.

Regarding the CSharp warning, we are going to look into removing that.

LaPeste avatar Mar 17 '21 16:03 LaPeste