Maui Error
SalimiHabib opened this issue · comments
hi
in MAUI i try to use vpnhood in android platform but i get error on AndroidDevice
when i try to Device.Prepare(this );
private static readonly AndroidDevice Device = new();
private VpnHoodClient? _vpnHoodClient;
protected override void OnCreate(
Bundle bSavedInstanceState)
{
try
{
base.OnCreate(bSavedInstanceState);
Device.Prepare(this );
}}
Severity Code Description Project File Line Suppression State
Error CS0311 The type 'Android.App.Activity' cannot be used as type parameter 'T' in the generic type or method 'AndroidDevice.Prepare<T>(T)'. There is no implicit reference conversion from 'Android.App.Activity' to 'VpnHood.Client.Device.Droid.Utils.IActivityEvent'. aco.vpn.maui (net8.0-android) C:\Users\aaffddss\source\repos\Platforms\Android\MainActivity.cs 29 Active
thank you
Can I see your repo?
However, you use the old nuget; Your MainActitivity should inherit from ActivityEvent. Also I see you are using VpnHoodClient, it is for lowest level connection, if you are going to create a VPN app, I recommend you use VpnHood.Client.App that does a lot of jobs.