CS0246 The type or namespace name 'Android' could not be found (are you missing a using directive or an assembly reference?) ParentalControl.App.Mobile

kevin david 161 Reputation points
2021-12-23T05:45:04.993+00:00

In my Android Xamarin project it presented that error, although in the references I do have the Mono.Android.ddl, I exported it again but it did not work.

159952-error-appmobile-1.png

159938-error-appmobile-2.png

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,292 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,437 questions
0 comments No comments
{count} votes

Accepted answer
  1. JarvanZhang 23,936 Reputation points
    2021-12-24T02:29:43.72+00:00

    Hello,​

    Welcome to our Microsoft Q&A platform!

    Shared project just shares code for each platform project that references the shared project. Assembly references should be added in each platform projects(android,ios etc), not the shared project. So please remove the Assemblies from the shared project and remove the Android.* namespace from the page class. If you want to use the Android library, please handle the work in the Android platform project and you could use DependencyService to call the method from the shared project.

    Best Regards,

    Jarvan Zhang


    If the response is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

0 additional answers

Sort by: Most helpful