xamarin / urho

Code to integrate with the Urho3D engine
Other
462 stars 122 forks source link

Exception when FormsAppCompatActivity is used. #128

Closed mjeronimoa closed 8 years ago

mjeronimoa commented 8 years ago

Hi, It seems to be that the framework is incompatible with the use of FormsAppCompatActivity(needed if you want to use some UI controls of the Android Support Library). Exception "System.InvalidOperationException: Platform implementation is not referenced" is raised when trying to run the OnAppearing() method of the xamarin forms sample. SanderSchutten seems to have had the same problem according to this topic https://forums.xamarin.com/discussion/67735/android-renderers-timing-issue-when-using-masterdetailpage-with-formsappcompatactivity and he created a sample project.

EgorBo commented 8 years ago

"Platform implementation is not referenced" means more likely that you didn't add UrhoSharp.Forms package to your Android project. Urho uses Bait and Switch approach.

mjeronimoa commented 8 years ago

@EgorBo I do have installed UrhoSharp.Forms and Xamarin.Forms packages as it is in the sample project.

EgorBo commented 8 years ago

@mjeronimoa I see. I'll take a look at the sample.

mjeronimoa commented 8 years ago

@EgorBo Thanks a lot. Let me know if you need any help for reproducing the error

mjeronimoa commented 8 years ago

@EgorBo Any advance with it?have you eben able to reproduce it?

mahlm commented 8 years ago

I'm having the same error on iOS - UrhoSharp.Forms and Xamarin.Forms are referenced.

await _surface.Show<Lab3D> (
    new ApplicationOptions (assetsFolder: null) { 
        Orientation = ApplicationOptions.OrientationType.Portrait 
    }
);

I'll do some digging today.

mahlm commented 8 years ago

Fixed - i was initializing the UrhoSurface before adding to the ContentPage. Adding it to the Page before calling show on the surface resolved my problem. I'll just need to hide the containing view first.

@mjeronimoa Maybe you're running into the same problem - tell me how it goes.

mjeronimoa commented 8 years ago

@mahlm @EgorBo Now I'm really confused. After updating my laptop to Windows 10 and installing and unistalling visual studio, everything seems to be working fine. Any idea about what it can be related with?

migueldeicaza commented 8 years ago

Closing per last message.