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

Trying to compile for Android #138

Open
joaoroque opened this issue Feb 22, 2020 · 2 comments
Open

Trying to compile for Android #138

joaoroque opened this issue Feb 22, 2020 · 2 comments

Comments

@joaoroque
Copy link

joaoroque commented Feb 22, 2020

Hi,

I have an old project I developed with lidgren when I feel there was a bit more documentation than now. But now 5 years later I can't remember most things.

I'm doing a xamarin android app that uses lidgren. So I added the Lidgren.Network project to my solution and added the "ANDROID" compilation symbol to the build options of lidgren project.

Now when trying to compile I get the exception: "The name Android does not exist in the current context" on a bunch of lines. For example in:

Android.Util.Log.WriteLine(Android.Util.LogPriority.Verbose, "", message);

The project doesn't even compile because of that.

Anyone knows what I'm doing wrong?

Thanks,

João

@joaoroque
Copy link
Author

joaoroque commented Feb 23, 2020

After some trial and error I figured it out. I'll leave here the steps to get lidgren working on Xamarin Android.

  • The current version is bugged on android. It uses a mutex which is not supported by mono from what I've read. So, download the zip from this commit: https://github.com/lidgren/lidgren-network-gen3/tree/e26203f6526835779dcf7d2357e4ebab642e72e6 It is the most recent commit before they introduce the change that breaks on Android.

  • Add the Lidgren.Network project from the zip you downloaded to your solution that contains the Android project.

  • Add Mono.Android refrence to Lidgren.Network project. You can check the folder path on your Android project as it is already being used there.

  • Add Lidgren.Network as a project reference to your Android project.

  • Go to Lidgren.Network project properties, then build tab and set the following as the conditional compilation symbol (both for debug and release): __ANDROID__

  • Add INTERNET permission to your app.

@xafgun
Copy link

xafgun commented Mar 21, 2020

After some trial and error I figured it out. I'll leave here the steps to get lidgren working on Xamarin Android.

  • The current version is bugged on android. It uses a mutex which is not supported by mono from what I've read. So, download the zip from this commit: https://github.com/lidgren/lidgren-network-gen3/tree/e26203f6526835779dcf7d2357e4ebab642e72e6 It is the most recent commit before they introduce the change that breaks on Android.
  • Add the Lidgren.Network project from the zip you downloaded to your solution that contains the Android project.
  • Add Mono.Android refrence to Lidgren.Network project. You can check the folder path on your Android project as it is already being used there.
  • Add Lidgren.Network as a project reference to your Android project.
  • Go to Lidgren.Network project properties, then build tab and set the following as the conditional compilation symbol (both for debug and release): __ANDROID__
  • Add INTERNET permission to your app.

Is this version work on IOS 13.3.1 ?

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