Error When Build The New Project

EmreAltanEmreAltan USMember ✭✭

Hello,
I'm new with Xamarin and try to learn but I'm getting stupid errors since I started to try. I'm creating new Blank Xamarin.Forms PCL project and building it without any change. Then I'm getting these errors:

'Resource.Layout' does not contain a definition for 'Tabbar'
'Resource.Layout' does not contain a definition for 'Toolbar'

My MainActivity.cs file:

namespace Deneme.Droid
{
    [Activity(Label = "Deneme", Icon = "@drawable/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 bundle)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource = Resource.Layout.Toolbar;

            base.OnCreate(bundle);

            global::Xamarin.Forms.Forms.Init(this, bundle);
            LoadApplication(new App());
        }
    }
}

I also got these errors on Native Android app too. What am I doing wrong?

Please help me, I'll start to crush my PC now. Thanks..

Best Answer

Answers

  • ArtdemsArtdems FRMember ✭✭

    If this is the original solution, in your Android project, you can have a "Resources" file. In this file we find "layout" and, in this case, we have the last "Tabbar.axml" and Toolbar.axml ". Can you show this two files please?

  • EmreAltanEmreAltan USMember ✭✭

    @Artdems Hi, thanks for the fast reply. My Solution Explorer looks like this;

    As I said before, I didn't made any change after creating project.

  • ArtdemsArtdems FRMember ✭✭

    Okay, I think we have to stop VS, restart and clean and rebuild. I had problems like this when VS stopped recognizing some of my code, and the off/on-> clean / rebuild function still works for me.

  • EmreAltanEmreAltan USMember ✭✭

    @DarshanJS Thanks for help. The error was about SDK. I deleted Android SDK Build-tools Rev. 24 and errors have resolved.

  • hello, I have the same problem it's been days since I'm trying to figure that out. what to do

Sign In or Register to comment.