Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An unhandled exception occured. Running Demo.Droid #38

Open
farp opened this issue Jul 12, 2015 · 4 comments
Open

An unhandled exception occured. Running Demo.Droid #38

farp opened this issue Jul 12, 2015 · 4 comments
Assignees

Comments

@farp
Copy link

farp commented Jul 12, 2015

I tried it in my own solution, getting an error: Java.Lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.TypedArray android.content.Context.obtainStyle…

Then I cloned just clonned this repo and executed Demo.Droid on Nexus 4 with Lollipop.

An unhandled exception occured.

07-12 14:03:33.344 E/mono-rt (20815): [ERROR] FATAL UNHANDLED EXCEPTION: System.TypeLoadException: Could not load type 'NativeCode.Mobile.AppCompat.FormsAppCompat.AppCompatFormsActivity' from assembly 'NativeCode.Mobile.AppCompat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
07-12 14:03:33.344 E/mono-rt (20815): at (wrapper managed-to-native) System.MonoType:GetMethodsByName (System.MonoType,string,System.Reflection.BindingFlags,bool,System.Type)
07-12 14:03:33.344 E/mono-rt (20815): at System.MonoType.GetMethodImpl (System.String name, BindingFlags bindingAttr, System.Reflection.Binder binder, CallingConventions callConvention, System.Type[] types, System.Reflection.ParameterModifier[] modifiers) [0x0000a] in :0
07-12 14:03:33.344 E/mono-rt (20815): at System.Type.GetMethod (System.String name, BindingFlags bindingAttr, System.Reflection.Binder binder, CallingConventions callConvention, System.Type[] types, System.Reflection.ParameterModifier[] modifiers) [0x00052] in :0
07-12 14:03:33.344 E/mono-rt (20815): at System.Type.GetMethod (System.String name, BindingFlags bindingAttr, System.Reflection.Binder binder, System.Type[] types, System.Reflection.ParameterModifier[] modifiers) [0x00000] in :0
07-12 14:03:33.344 E/mono-rt (20815): at System.Delegate.GetCandidateMethod (System.Type type, System.Type target, System.String method, BindingFlags bflags, Boolean ignoreCase, Boolean throwOnBindFailure) [0x000a4] in :0
07-12 14:03:33.344 E/mono-rt (20815): at System.Delegate.CreateDelegate (System.Type type, System.Type target, System.String method, Boolean ignoreCase, Boolean throwOnBindFailure) [0x00017] in :0
07-12 14:03:33.344 E/mono-rt (20815): at System.Delegate.CreateDelegate (System.Type type, System.Type target, System.String method) [0x00000] in :0
07-12 14:03:33.344 E/mono-rt (20815): at Android.Runtime.JNIEnv.RegisterJniNatives (IntPtr typeName_ptr, Int32 typeName_len, IntPtr jniClass, IntPtr methods_ptr, Int32 methods_len) [0x001f9] in /Users/builder/data/lanes/1879/5f55a9ef/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.cs:153

@mikepham
Copy link
Contributor

I'll take a look. Might have to do with some recent theme changes.

@mikepham mikepham self-assigned this Jul 12, 2015
@mikepham
Copy link
Contributor

That looks like the error from Xamarin Android 5.1.4. You can verify your version with the following:

  • Visual Studio: Help -> About Microsoft Visual Studio, scroll down and look for the Xamarin.Android version. 5.1.3.1 currently works without issue, anything higher than that currently has issues (please see the PSA in the README).
  • Xamarin Studio: Help -> About -> Show Details.

If you can't downgrade, you can set the Linker option to None in the project properties. However, you'll find that you can't debug your Android app (this is not due to the library itself).

If you're currently running 5.1.3 and are still having issues, please let me know.

Please see this thread.

@farp
Copy link
Author

farp commented Jul 13, 2015

Thank for your quick response.

I currently running 5.1.3.1

I´ll try it in an emulator running Lollipop. I already heard about another issue (resource not found) that happens only in Nexus devices with Lollipop.

@mikepham
Copy link
Contributor

Unfortunately, I don't have access to a Nexus 4 but I did run it successfully on a Nexus 7 tablet with 5.1.1 and it ran on the Xamarin Android Player. Please let me know if you run into further problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants