Base solution for your next web application
Open Closed

Adding Xamarin Forms Maps result in Theme.AppCompat error #4507


User avatar
0
riaan created

Hi,

Has any experience the below error when adding a Xamarin Forms Map to the ASPNET Zero Xamarin app?

On app startup during the splash display

Unhandled Exception:

Java.Lang.RuntimeException: Unable to start activity ComponentInfo{com.[PROJECTNAME].Mobile/md53fe6e38767471a4d81890f4256fb3813.SplashActivity}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.

It fails on the SplashActivity right after the OnCreate method:

protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            UserDialogs.Init(this);
            ConfigureFlurlHttp();
            SetExitAction();
        }

We are using Xamarin.Forms.Maps version 2.3.4.347 any newer version causes compile errors in the googleplayservices java classes

Any assistance would be greatly appreciated.

Thanks,

Riaan


2 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @riaan,

    Does this happen with the not modified app or are you trying to add a new item/page to Xamarin app ?

    You can also take a look at below links if you haven't already <a class="postlink" href="https://forums.xamarin.com/discussion/99303/getting-you-need-to-use-a-theme-appcompat-theme-or-descendant-with-this-activity-on-setcontentview">https://forums.xamarin.com/discussion/9 ... ontentview</a> <a class="postlink" href="https://stackoverflow.com/questions/48174193/you-need-to-use-a-theme-appcompat-theme-or-descendant-with-this-activity-xa">https://stackoverflow.com/questions/481 ... ctivity-xa</a>

    Thanks.

  • User Avatar
    0
    riaan created

    Hi @ismcagdas,

    I've only added the Xamarin.Forms.Maps nuget package to the Xamarin App's Droid project. Haven't added any new pages yet, so it is the only "modification" made to the app.