question

MaheshBalasubramanian-9478 avatar image
0 Votes"
MaheshBalasubramanian-9478 asked MaheshBalasubramanian-9478 answered

Android.* is not working in xamarin.forms

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

dotnet-xamarin
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

MaheshBalasubramanian-9478 avatar image
0 Votes"
MaheshBalasubramanian-9478 answered

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

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

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.