AndroidX migration getting error Android.Content.Res.Resources+NotFoundException

Chinmay Behera 1 Reputation point
2020-08-01T19:12:19.403+00:00

Hi, I am using MVVMCross and migrated my Xamarin Forms Android project to AndroidX. After migration it asked to install 2 packages. When I build it build successfully. But at run time it throws error in MainActivity.cs.

Android.Content.Res.Resources+NotFoundException: 'Resource ID #0x7f0b0047'

protected override void OnCreate(Bundle bundle)
{
// base.Window.RequestFeature(WindowFeatures.ActionBar);
// Name of the MainActivity theme you had there before.
// Or you can use global::Android.Resource.Style.ThemeHoloLight
//base.SetTheme(Resource.Style.MainTheme);

        base.OnCreate(bundle); //Error occurs here
        //Instanace = this;
        Xamarin.Essentials.Platform.Init(this, bundle);

        TabLayoutResource = Resource.Layout.tabs;
        ToolbarResource = Resource.Layout.toolbar;
    }
Not Monitored
Not Monitored
Tag not monitored by Microsoft.
39,573 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Roy Li - MSFT 33,371 Reputation points Microsoft Vendor
    2020-08-03T02:06:04.797+00:00

    Hello,

    Welcome to Microsoft Q&A!

    Currently, Microsoft Q&A supports the products listed over here: supported topics (more to be added later on).

    Your question about Xarmain android is not supported yet now. You could ask about this in Xarmain's official forums.

    Thank you.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.