Mvvmcross: Android: "Method 'Array.Empty' not found" after upgrading to MvvmCross 4.1.5

Created on 19 May 2016  Â·  25Comments  Â·  Source: MvvmCross/MvvmCross

Debug build. Regression from previous MvvmCross version. I get this from OnCreate in the splash screen (or any activity):

05-19 11:09:32.301 I/MonoDroid( 4626): UNHANDLED EXCEPTION:
05-19 11:09:32.302 I/MonoDroid( 4626): System.MissingMethodException: Method 'Array.Empty' not found.
05-19 11:09:32.302 I/MonoDroid( 4626):   at MvvmCross.Droid.Views.MvxActivityViewExtensions.OnViewCreate (IMvxAndroidView androidView, Android.OS.Bundle bundle) [0x00055] in <filename unknown>:0 
05-19 11:09:32.302 I/MonoDroid( 4626):   at MvvmCross.Droid.Views.MvxActivityAdapter.EventSourceOnCreateCalled (System.Object sender, MvvmCross.Platform.Core.MvxValueEventArgs`1 eventArgs) [0x0000c] in <filename unknown>:0 
05-19 11:09:32.302 I/MonoDroid( 4626):   at (wrapper delegate-invoke) System.EventHandler`1[MvvmCross.Platform.Core.MvxValueEventArgs`1[Android.OS.Bundle]]:invoke_void_object_TEventArgs (object,MvvmCross.Platform.Core.MvxValueEventArgs`1<Android.OS.Bundle>)
05-19 11:09:32.302 I/MonoDroid( 4626):   at MvvmCross.Platform.Core.MvxDelegateExtensionMethods.Raise[T] (System.EventHandler`1 eventHandler, System.Object sender, MvvmCross.Platform.Core.T value) [0x00000] in C:\vcs\git\MvvmCross\MvvmCross\Platform\Platform\Core\MvxDelegateExtensionMethods.cs:21 
05-19 11:09:32.302 I/MonoDroid( 4626):   at MvvmCross.Platform.Droid.Views.MvxEventSourceActivity.OnCreate (Android.OS.Bundle bundle) [0x00014] in <filename unknown>:0 
05-19 11:09:32.302 I/MonoDroid( 4626):   at MvvmCross.Droid.Views.MvxSplashScreenActivity.OnCreate (Android.OS.Bundle bundle) [0x00017] in <filename unknown>:0 
05-19 11:09:32.302 I/MonoDroid( 4626):   at Android.App.Activity.n_OnCreate_Landroid_os_Bundle_ (IntPtr jnienv, IntPtr native__this, IntPtr native_savedInstanceState) [0x00011] in /Users/builder/data/lanes/3236/ee215fc9/source/monodroid/src/Mono.Android/platforms/android-23/src/generated/Android.App.Activity.cs:2857 
05-19 11:09:32.302 I/MonoDroid( 4626):   at (wrapper dynamic-method) System.Object:9d1dec28-a475-47d8-bf75-9f8825205101 (intptr,intptr,intptr)
05-19 11:09:32.309 W/art     ( 4626): JNI RegisterNativeMethods: attempt to register 0 native methods for md52ce486a14f4bcd95899665e9d932190b.JavaProxyThrowable

Most helpful comment

I agree. Although I'm ok with running beta Xamarin on my box, I think the stable NuGet packages should only be released when built on Xamarin stable. Otherwise, I think we're just asking for confusion.

All 25 comments

I'm seeing this too, is there a work around? (downgrade to an older version)?

I'm seeing the issue as well.

@gertjaap The only workaround I have been able to come up with so far is to revert back to the previous version.

I downgraded to 4.1.0 and my app starts now. I actually just started using MvvmCross, so I did not have a "Known working state". Basically considered something wrong in my own set-up since i'm just getting started with this. But happy to see that i can move ahead.

I'm seeing this as well in Debug and Release modes when deploying Xamarin.Android projects. Reverting to version 4.1.4 causes the problem to disappear. Perhaps the changes to binding reflections in 4.1.5 brought about this change? Also, since it sounds similar to an old Mono vs .NET 4.6 bug....I should not that I am currently running Windows 10 with .NET 4.6

Same problem here...

Same problem here .

After I add the Plugin.DownloadCache . It just not doing well

It seems run bebore when i do my N+4 video with Kitten

Please stop leaving "me too" comments. They do not contribute to solving the issue.

What would be helpful is that you described your environment. More importantly whether you are running Stable, beta or alpha of Xamarin tools. I suspect it has something to do with differences in mono versions and this is why you are seeing this.

Hello,
i´ve got this issue on my Windows 10 PC with latest stable Xamarin in VS 2015 Enterprise,
but it running well on my MAC (OSX 10.11) with alpha Xamarin in XS 6.1 (build 817), Mono 4.4.0.

This appears to be related to a mono issue: https://github.com/NancyFx/Nancy/issues/2064

It looks like it only affects .NET 4.6 dev environment, which is why the issue isn't occurring on Mac environments.

I have the same issue with the following setup:

=== Xamarin Studio Business ===

Version 5.10.3 (build 51)
Runtime:
Mono 4.2.3 (explicit/832de4b)
GTK+ 2.24.23 (Raleigh theme)

Package version: 402030004

=== Xamarin.Android ===

Version: 6.0.3.5 (Xamarin Business)
Supported Android versions:
2.3 (API level 10)
4.0.3 (API level 15)
4.2 (API level 17)
4.4 (API level 19)
5.0 (API level 21)
5.1 (API level 22)
6.0 (API level 23)

SDK Tools Version: 25.1.1
SDK Platform Tools Version: 23.1
SDK Build Tools Version: 23.0.3

java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)

=== Build Information ===

Release ID: 510030051
Git revision: f3c0d982165f785772d125f02668370d929014fb
Build date: 2016-03-24 18:51:31-04
Xamarin addins: ee5cfd3ecb6b20de47c1d25efb9a9abc101e8ce7
Build lane: monodevelop-lion-cycle6-c6sr3

=== Operating System ===

Mac OS X 10.11.4

That rules out the .net issue then.
On May 20, 2016 9:03 AM, "Relaxguy" [email protected] wrote:

I have the same issue with the following setup:

=== Xamarin Studio Business ===

Version 5.10.3 (build 51)
Runtime:
Mono 4.2.3 (explicit/832de4b)
GTK+ 2.24.23 (Raleigh theme)

Package version: 402030004

=== Xamarin.Android ===

Version: 6.0.3.5 (Xamarin Business)
Supported Android versions:
2.3 (API level 10)
4.0.3 (API level 15)
4.2 (API level 17)
4.4 (API level 19)
5.0 (API level 21)
5.1 (API level 22)
6.0 (API level 23)

SDK Tools Version: 25.1.1
SDK Platform Tools Version: 23.1
SDK Build Tools Version: 23.0.3

java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)

=== Build Information ===

Release ID: 510030051
Git revision: f3c0d982165f785772d125f02668370d929014fb
Build date: 2016-03-24 18:51:31-04
Xamarin addins: ee5cfd3ecb6b20de47c1d25efb9a9abc101e8ce7
Build lane: monodevelop-lion-cycle6-c6sr3

=== Operating System ===

Mac OS X 10.11.4

—
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
https://github.com/MvvmCross/MvvmCross/issues/1330#issuecomment-220599708

So I see a pattern here.

I think the reason you are all seeing these issues is that the machine I built on if I recall correctly is on beta or alpha of Xamarin. Which uses a much newer version of mono than you have installed. So this makes this build incompatible with stable.

So what do you people want? A new build soon-ish that is built against stable or are you OK with waiting for the new stuff in beta/alpha to hit stable?

beta/alpha are good for me

Since Xamarin is kind of hot this day

with MVVMcross that is like beer and burger

Sorry can I just confirm are you're asking...

is it ok that the latest stable release of MvvmCross available in nuget only works if you're using the alpha or beta channel of Mono?

Surely that can't be what you're asking...

I agree. Although I'm ok with running beta Xamarin on my box, I think the stable NuGet packages should only be released when built on Xamarin stable. Otherwise, I think we're just asking for confusion.

So I get the issue on iOS too.
ShowViewModel() is as low as I could get when using a custom AppStart.
It's not hitting any of the constructors in the ViewModel so I think is something to do with the Reflection like suggested earlier.
I also saw some posts about this error in previous dotnet threads verifying the versioning issues suggested: https://connect.microsoft.com/VisualStudio/feedback/details/1097462/missingmethodexception-additional-information-method-not-found-0-system-array-empty
I am rolling back.

Regards,

B

Rolled back to MvvmCross 4.1.4 and all is well again.
If you struggle to roll back use this post for Xamarin studio:
http://stackoverflow.com/questions/20802905/is-there-a-package-manager-console-in-xamarin-studio

Later guys.

B

@Cheesebaron the stable nuget should only be built against the xamarin stable update channel. If some Xamarin Alpha or Beta update breaks it, we release alpha builds that work on that channel.

Ideally, this would mean CI test agents that would run stable builds in Xamarin Stable and Alpha update channel.

Well the problem is that MvvmCross does not have its own CI so I build this on my own machine every time. And to be honest, I don't want to downgrade each and every time I wan't to make a release.

Bitrise which we use right now, does not build for the Windows platforms, I don't think it builds Xamarin.Mac projects either.

We need something else that fits our needs such as VSTS or TeamCity or whatever else that can build for all the platforms we target.

Same issue, but running OSX version 10.11.4 building for iOS on Xamarin Community 5.10.3. I have tried downgrading al my MVVMcross packages to MVVM 4.1.4 as suggested, by changing what's in the PackageManager.config file. Packages say they've restored to that version correctly, but I still get the same error. I thought it might be because the only picturechooser plugin available is version 4.2.1, so I tried removing it but still getting same "array.empty" missing error.

Am I doing something wrong with my downgrade strategy? This has cut me short in the middle of a sprint, any help gratefully appreciated!

If you just edit package.config you are not actually changing the references in the csproj files. So it is still referencing 4.1.5

Thanks so much for the quick response @Cheesebaron. That did it - for others (for whom it's not teaching their grandmother to suck eggs), I unloaded my projects, then edited the .csproj files manually to change all 4.1.5 references to 4.1.4, restored packages, rebuilt, and hey presto, working fine.

@AdamDiment you can use the Package Manager Console to downgrade your packages manually:

_PM> Update-Package MvvmCross -Version 4.1.4_

I had the same issue here, deleted bin/obj folders and everything works fine. I'm using the last release on alpha channel, xamarin studio/osx.

Pushing new packages built against latest stable.

Was this page helpful?
0 / 5 - 0 ratings