0

I'm just in the starting phase of learning how to make apps with c# xamarin forms to make cross plattform apps. I'm using Visual Studio 2019 and i've installed Xamaring through Visual Studio Installer. When i've created a project and try to start the android project through a Android Emulator, Android Device Manager just start and then shut down without starting any emulator.

When i go to Android SDK Manager it is nothing there. I then went to Tools > Options > Xamarin > Android Settings and under Android SDK Location is says C:\Program Files (x86)\Android\android-sdk Everytime i start Visual Studio i need to agree to Android SDK licens and even if i click Accept it says waiting for licens agreement down to the left. So i tried accept everyting like this in the console %ANDROID_HOME%/tools/bin/sdkmanager --licenses which they recommended here Can't accept license agreement Android SDK Platform 24

The code i try to run when it doesntwork is this(I actually dont think that matter though)

using System;

using Android.App;
using Android.Content.PM;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Android.OS;

namespace test3.Droid
{
    [Activity(Label = "test3", Icon = "@mipmap/icon", Theme = "@style/MainTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
    public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
    {
        protected override void OnCreate(Bundle savedInstanceState)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource = Resource.Layout.Toolbar;

            base.OnCreate(savedInstanceState);

            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
            LoadApplication(new App());
        }
        public override void OnRequestPermissionsResult(int requestCode, string[] permissions, [GeneratedEnum] Android.Content.PM.Permission[] grantResults)
        {
            Xamarin.Essentials.Platform.OnRequestPermissionsResult(requestCode, permissions, grantResults);

            base.OnRequestPermissionsResult(requestCode, permissions, grantResults);
        }
    }
}

When i try to run the code it just says "The debug was canceled. Please create an android emulator to debug the application." But since i cant start Android device manager i cant to that.

0 Answers0