I have run into an error while creating Android Xamarin App.

Trevor Okwirri 1 Reputation point
2022-04-05T13:29:40.493+00:00

Here's the error. Please help me:
Error CS0246 The type or namespace name 'AndroidX' could not be found (are you missing a using directive or an assembly reference?)
Error CS0246 The type or namespace name 'AppCompatActivity' could not be found (are you missing a using directive or an assembly reference?)
Error CS0115 'MainActivity.OnCreate(Bundle)': no suitable method found to override App1
Error CS0115 'MainActivity.OnRequestPermissionsResult(int, string[], Permission[])': no suitable method found to override App1
Error NU1101 Unable to find package Xamarin.AndroidX.AppCompat. No packages exist with this id in source(s): Microsoft Visual Studio Offline
Error NU1101 Unable to find package Xamarin.Essentials. No packages exist with this id in source(s): Microsoft Visual Studio Offline Packages
Error NU1101 Unable to find package Xamarin.Google.Android.Material. No packages exist with this id in source(s): Microsoft Visual Studio Offline Packages
Error CS0234 The type or namespace name 'Essentials' does not exist in the namespace 'Xamarin' (are you missing an assembly reference?)
Error CS0103 The name 'SetContentView' does not exist in the current context App1 C:\Users\mohse\source\repos\App1\MainActivity.cs
Error CS0234 The type or namespace name 'Essentials' does not exist in the namespace 'Xamarin' (are you missing an assembly reference?)

Developer technologies | .NET | Xamarin
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Anonymous
    2022-04-06T01:06:11.013+00:00

    Hello,

    Error NU1101 Unable to find package Xamarin.AndroidX.AppCompat. No packages exist with this id in source(s): Microsoft Visual Studio Offline

    Please open Tools -> Nuget Package Manager -> Package Source ->click Settings(⚙ icon) to check if the nuget.org package source is missing. If so, click the '+' menu to add the source manaually:

    Best Regards,
    Leon Lu


    If the answer is the right solution, 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.


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.