Monogame 3.5 with android API 16 (4.1)

Hi,

I did some test on android creating a default android project. I works as it is but when I try to target the 4.1 (API 16) I have a compilation error (error below). Did I do something wrong ? or Monogame is not compatible with old version of android. For info I work on mac with xamarin, I don’t if it change anything.

Cheers,

MonoGameAndroidGameView.java(3,3): Error: error: no suitable constructor found for AndroidGameView(Context,AttributeSet,int,int)
super (p0, p1, p2, p3);
constructor AndroidGameView.AndroidGameView(Context) is not applicable
(actual and formal argument lists differ in length)
constructor AndroidGameView.AndroidGameView(Context,AttributeSet) is not applicable
(actual and formal argument lists differ in length)
constructor AndroidGameView.AndroidGameView(Context,AttributeSet,int) is not applicable
(actual and formal argument lists differ in length)
(XamAndroid)

I currently have a default Android project working targeting Android 4.0 because I’ve a tablet with that version of Android and it works perfect.

I don’t know how to help you fix that because I’m using Visual Studio.

Check this guideline carefully it may help http://www.monogame.net/documentation/?page=Android

Robe.

Thanks @vcRobe,

I didn’t view the android notes, I’ll try to compile monogame sources to target the 4.4 and have a minimum version of 4.1, and see how it can work. Maybe using older version monogame would fix it.

Cheers

I’m glad to help you!

You don’t need to recompile MonoGame from the sources to target a specific Android version. In the link I sent you is explained how to target the Android version you desire.

I did the test using the last stable release version of MonoGame 3.5.1. You can download the binaries here http://www.monogame.net/2016/03/17/monogame-3-5/

Just found the solution,

In my first attempt, I install monogame package from nuget. I start a new project (Monogame addin for xamarin) and it works. Thanks @vcRobe, you saved my day :slight_smile:

Cheers.

Glad you got this resolved :wink: