question

kevindavid-3250 avatar image
0 Votes"
kevindavid-3250 asked RobCaplan edited

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

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


dotnet-xamarinazure-ad-libraries
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

JarvanZhang-MSFT avatar image
0 Votes"
JarvanZhang-MSFT answered JarvanZhang-MSFT edited

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.


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.