CocosSharp Android Unhandled Exception

XantangoXantango BHMember ✭✭

Well, I have tried several CocosSharp Android sample on both Visual Studio 2013 ad 2012.
None of those attempts was successful, as I always get an Unhandled Exception Error message, which I can not trap by try... catch block.
I noticed that, when comment out this line: SetContentView(application.AndroidContentView);
I do not receive an exception, but the nothing would show up, of course :)
So, has anyone encountered this issue, or it is something that I'm just missing :)

Answers

  • VictorChelaruVictorChelaru USMember ✭✭

    Have you tried the sample projects linked in the walkthrough for CocosSharp? They include starter projects as well as a "complete" game that displays elements. If these work for you then they could serve as a starting point to get you past the issue you're having:

    http://developer.xamarin.com/guides/cross-platform/game_development/cocossharp/first_game/

  • XantangoXantango BHMember ✭✭

    Yes, i did... even the empty project did not work...
    I guess it is all about the following line:
    SetContentView(application.AndroidContentView);

  • VictorChelaruVictorChelaru USMember ✭✭

    I don't know if this will matter but it might help to know which device/emulators you're targeting.

  • XantangoXantango BHMember ✭✭

    Device: Samsung S4
    Emulators: API 21 and API 15
    IDE: Xamarin for Visual Studio

  • XantangoXantango BHMember ✭✭

    CocosSharp 1.2.1

  • XantangoXantango BHMember ✭✭

    Well, I has worked... somehow... :confused:

  • IMIM USMember

    How were you able to resolve it?

    This is my environment, actually 2 environments:
    Windows 7 and Windows 8
    Visual Studio 2013 Community
    Emulators: API 21 and API 10
    CocosSharp PCL 1.4.0, 1.3.0, 1.2.1

    All of the combinations fail with the exception below.
    SetContentView(application.AndroidContentView);

    Tried reinstalling Xamarin, and Android SDK, no success.
    Tried BouncingGame sample source without making any changes, tried empty projects, same result.

    Tried CocosSharp templates suggested on other threads, still the same.

  • IMIM USMember

    With this Xamarin's player it seems to be working.
    https://xamarin.com/android-player

  • XantangoXantango BHMember ✭✭

    Try going to your emulator settings, and make sure that the GPU option is ticked.

Sign In or Register to comment.