Android.* is not working in xamarin.forms

Mahesh Balasubramanian 1 Reputation point
2021-06-06T04:47:33.303+00:00

Hi,

I am using Xamarin.forms and none of the android class members are available post update yesterday.

My App was using Android.App.Application.Context.GetExternalDirectoryFile("").AbsolutePath. Now I am getting an error in vs stating "Android" doesn't contain a definition for "App" . Even Android.OS or .Content is throwing the same error.

Could someone please help resolving the issue. Target version was Androidv11.0 and even by changing it to 10.0, I am seeing the error.

Regards,
Mahesh B

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,378 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Mahesh Balasubramanian 1 Reputation point
    2021-06-06T05:50:03.747+00:00

    I got the answer myself. I Used below code in place of Android.App.Application...

    "var path = Xamarin.Essentials.FileSystem.AppDataDirectory;"

    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.