question

TrevorOkwirri-0101 avatar image
0 Votes"
TrevorOkwirri-0101 asked LeonLu-MSFT edited

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

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?)

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

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

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.

· 1
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.

@TrevorOkwirri-0101 May I know if you have got any chance to check my answer? I am glad to help if you have any other questions

0 Votes 0 ·