MvvmCross.Platforms.Android namespace missing from MvvmCross 6.0.0 package

Created on 17 Apr 2018  路  16Comments  路  Source: MvvmCross/MvvmCross



As seen on the 6.0.0 release announcement:

With MvvmCross 6 there are some changes to the NuGet packages. The following packages are obsolete and included in the main MvvmCross package:

MvvmCross.Core
MvvmCross.Platform
MvvmCross.Binding

But it appears the platform namespace is missing (at least for Android)...

Steps to reproduce :scroll:

  1. Create a new project

  2. add MvvmCross 6.0.0 package on .NET 2.0 Core and Droid project

Expected behavior :thinking:

Should have a bunch of Android related classes (MvxActivity, MvxAndroidSetup...) inside the MvvmCross.Platforms.Android namespace.

Actual behavior :bug:

No MvvmCross.Platforms.Android namespace in the Droid project.

Configuration :wrench:

Version: 6.0.0

Platform:

  • [ ] :iphone: iOS
  • [x] :robot: Android
  • [ ] :checkered_flag: WPF
  • [ ] :earth_americas: UWP
  • [ ] :apple: MacOS
  • [ ] :tv: tvOS
  • [ ] :monkey: Xamarin.Forms
invalid

All 16 comments

Uninstalling and installing the mvvmcross package fixed the issue. Still very odd only the platform namespace was missing.

Same problem here, but reinstalling mvvmcross package does not change anything. I've also updated visual studio. Only namespace with "platforms" is MvvmCross.Platforms.Console.

@alekchr042 I'm seeing that too in WPF

@code-mc : Hey, facing the same issue on Visual Studio 2017 version - 6.0.1

@code-mc : Hey, After getting 6.0.1 version i was still getting the issue, Now I have resolved it by updating the version of Mono.Android. Strange but it's seems like there are old dll are referring that might be not updating.

Thanks.

I had the same problem. Got it working on a computer, then moved to another and could not find the Platforms namespace, got back to the first computer, removed and re-installed the NuGet package, now both computers can't compile.

The problem is that the MvvmCross reference points to the DLL that is located in the netstandard2.0 folder (inside packages, I mean), rather than the one in monoandroid81.

I fixed it this way:

  • I removed the MvvmCross reference
  • I added it back by using "Browse" and pointing to the correct DLL

Of course this cannot be considered a stable fix. Is it possible that the NuGet package has some bad configuration?

The correct DLL is referenced ONLY IF the build destination is Android 8.1 Oreo. After setting that, one must close the solution and re-open it. Then, removing and re-installing the NuGet package works.

The docs should point out this requirement.

This will be related to multi targeting of the mvvmcross package. If you鈥檙e not targeting android 8.1 it will bind to the netstandard assembly which won鈥檛 work.

Is this by design? Why is targetting Mono Android <8.1 not supported?

I experienced this error in 06.06.2019 and switching to Oreo 8.1 didn't work. When I changed to Pie 9 it starts.

I made a github repo that shows this behaviour. It happened on VS 2019 on Win 10 with a colleague of mine and I had it yesterday on my Mac with Rider. The demo Repo is here: https://github.com/hot33331/MvxNamespace The error shows in MainApplication.cs in the Droid Project . Platform namespace seems not to be available.

GitHub
Contribute to hot33331/MvxNamespace development by creating an account on GitHub.

@hot33331 that project is missing a item_template layout. Adding that it builds and runs just fine.

And I have no issues with that namespace in the MainApplication class, neither in VS for Mac or Rider on Mac. Will check it out on Windows later today.

Make sure your Android project has TargetFrameworkVersion set to v9.0 before restoring packages.

Sorry, my fault, I managed to force push a working version over it. I corrected the link to point to another one, that now has that version and I will not touch anymore: https://github.com/hot33331/MvxNamespace
sorry for the hassle.

GitHub
Contribute to hot33331/MvxNamespace development by creating an account on GitHub.

Yeah, the repo has wrong target framework:

<TargetFrameworkVersion>v8.1</TargetFrameworkVersion>

Thanks - maybe it would be a good idea to add this to the TipCalc tutorial (which Framework to target), since new users might struggle with that.

Was this page helpful?
0 / 5 - 0 ratings