Mathieu Gasciolli
Mathieu Gasciolli

Reputation: 138

Namespace 'App' not found in default blank app

I just started a new project using Xamarin.forms with Visual Studio 2017 for Android and iOS. I selected 'blank' and '.net standard' and when it openned I got this error: in Android MainActivity, LoadApplication(new App()); App is not found. What can I do ?

Here's an image:

https://i.postimg.cc/L5VhCdcP/Capture.png

Thanks !

Upvotes: 1

Views: 131

Answers (2)

Mathieu Gasciolli
Mathieu Gasciolli

Reputation: 138

If a name contains spaces, directories will be made with spaces but VS will replace them by _.

Solution is to avoid ' ' and replace it by '_' or only one word.

Upvotes: 1

FreakyAli
FreakyAli

Reputation: 16449

Well, I have faced this issue so many times that I have written the steps down:

  • After creating a new project first clean build everything.
  • Check the AppDelegate and MainActivity if they have any red lines(by that I mean unfound references)
  • If there are(unfound references) restart VS if not continue.
  • Now update the Xamarin.Forms package to the desired version.
  • Update the Android Support libraries to the max supported version for that version of Xamarin.Forms, you "might" face issues here which you can pretty much solve with James's Blog here.
  • If everything goes well and you reach to this point remove the bin and obj folders for all your projects and since you have updated Xamarin.Forms VS will prompt for a restart with a SnackBar type popup on the top below the toolbar, restart the vs.
  • Once restarted you would want to build the .Net Standard/PCL project first, And once this builds correctly try building the other two projects and it should work

Good luck

Revert in case of queries.

Upvotes: 0

Related Questions