Xamarin-Forms-Practices icon indicating copy to clipboard operation
Xamarin-Forms-Practices copied to clipboard

The current source does not compile.

Open marcusts opened this issue 4 years ago • 19 comments

Platform (please complete the following information):

  • OS: [iOS/Android/Both] Both
  • Device: [iPhone6/iPhoneSimulator/Pixel/AndroidEmulator/...] any phone
  • Sdk vervion: [iOS 11/Android SDK 21] any current
  • Xamarin.Forms: [3.4.0.1029999] didn'tchange your version

Describe the bug The source code does not compile.

To Reproduce Steps to reproduce the behavior:

  1. Clone the source
  2. Compile
  3. Review errors
  4. Also, cannot fix NuGet issues, as they cause further issues

Output (partial): Severity Code Description Project File Line Suppression State Error : XamlC error XFC0000 : Cannot resolve type "ViewSwitcher". SillyCompany.Mobile.Practices M:\MyDocs\Dev\Xamarin-Forms-Practices\SillyCompany.Mobile.Practices\Presentation\Views\DudeDetails\SillyDudePage.xaml 1 Error : XamlC error XFC0000 : Cannot resolve type "ViewSwitcher". SillyCompany.Mobile.Practices M:\MyDocs\Dev\Xamarin-Forms-Practices\SillyCompany.Mobile.Practices\Presentation\Views\SurfaceDuo\TwoPanePage.xaml 1 Error : XamlC error XFC0000 : Cannot resolve type "ViewSwitcher". SillyCompany.Mobile.Practices M:\MyDocs\Dev\Xamarin-Forms-Practices\SillyCompany.Mobile.Practices\Presentation\Views\TabsLayout\SillyBottomTabsPage.xaml 1

SillyDudePage.xaml - many errors xmlns:tabs="http://sharpnado.com" ... seems to be the root cause

marcusts avatar Nov 04 '20 22:11 marcusts

This is the code from the Silly! app (the sample app) not the Sharpnado.Presentation.Forms.

roubachof avatar Nov 04 '20 23:11 roubachof

So now that we are in the good repo :) First XF version in the project is 4.7: https://github.com/roubachof/Xamarin-Forms-Practices/blob/cb079cb22bf579310a412d6f29032c69dc5595d6/SillyCompany.Mobile.Practices/SillyCompany.Mobile.Practices.csproj#L38 Then I cannot replicate your issues, everything builds fine on my end... Some of my users met also this issue, but it's a VS issue and even if it shows error it seems to compile and run fine.

roubachof avatar Nov 04 '20 23:11 roubachof

I'm having the same problem. When the project first loads Visual Studio complains that it cannot find many files:

/Sharpnado.Tabs/Tabs/Tabs/Tabs.csproj
/Sharpnado.Tabs/Tabs/Tabs.Droid/Tabs.Droid.csproj

and others

If you look at the Git repo for the sample you see that the files it complains about are in linked repos. When you download the sample from GitHub it doesn't download these linked repos. You must manually download each one and then place the files in the empty folders that were created. Luckily there are only 3.

TrueGeek avatar Nov 30 '20 20:11 TrueGeek

Guys could you please please read the readme file:

https://github.com/roubachof/Xamarin-Forms-Practices#installation

roubachof avatar Nov 30 '20 20:11 roubachof

@roubachof I totally missed that due to not reading the documentation at all. 😀 Sorry about that.

TrueGeek avatar Nov 30 '20 21:11 TrueGeek

First, thank you SO much for the awesome libraries and this sample code you've created, @roubachof! I love it! I wanted to get up to speed on some of the work you've done since I originally implemented Sharpnado tabs, but ran into trouble when trying to get the submodules.

It seems like the issue I'm running into may be slightly different, so please let me know if it would be better to open a new issue for this (or if this is simply a PEBKAC error).

I followed the instructions to clone the repo and then run git submodule update --init. The clone went just fine, but when I try to run the second command I get a series of errors (see below). Any ideas on what I might be doing wrong, or if this is a genuine issue?

jbachelor /Users/Shared/src/sharpNado/Xamarin-Forms-Practices (master)> git submodule update --init
Cloning into '/Users/Shared/src/sharpNado/Xamarin-Forms-Practices/Sharpnado.HorizontalListView'...
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
fatal: clone of '[email protected]:roubachof/Sharpnado.HorizontalListView.git' into submodule path '/Users/Shared/src/sharpNado/Xamarin-Forms-Practices/Sharpnado.HorizontalListView' failed
Failed to clone 'Sharpnado.HorizontalListView'. Retry scheduled
Cloning into '/Users/Shared/src/sharpNado/Xamarin-Forms-Practices/Sharpnado.MaterialFrame'...
Warning: Permanently added the RSA host key for IP address '192.30.255.112' to the list of known hosts.
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
fatal: clone of '[email protected]:roubachof/Sharpnado.MaterialFrame.git' into submodule path '/Users/Shared/src/sharpNado/Xamarin-Forms-Practices/Sharpnado.MaterialFrame' failed
Failed to clone 'Sharpnado.MaterialFrame'. Retry scheduled
Cloning into '/Users/Shared/src/sharpNado/Xamarin-Forms-Practices/Sharpnado.Tabs'...
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
fatal: clone of '[email protected]:roubachof/Sharpnado.Tabs.git' into submodule path '/Users/Shared/src/sharpNado/Xamarin-Forms-Practices/Sharpnado.Tabs' failed
Failed to clone 'Sharpnado.Tabs'. Retry scheduled
Cloning into '/Users/Shared/src/sharpNado/Xamarin-Forms-Practices/Sharpnado.HorizontalListView'...
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
fatal: clone of '[email protected]:roubachof/Sharpnado.HorizontalListView.git' into submodule path '/Users/Shared/src/sharpNado/Xamarin-Forms-Practices/Sharpnado.HorizontalListView' failed
Failed to clone 'Sharpnado.HorizontalListView' a second time, aborting
jbachelor /Users/Shared/src/sharpNado/Xamarin-Forms-Practices (master)> 

jbachelor avatar Jan 05 '21 21:01 jbachelor

mmmh, it's weird looks like an ssh issue: https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/error-permission-denied-publickey

Did you clone the Xamarin-Forms-Practices repo with ssh? If yes maybe clone it with classic https url.

roubachof avatar Jan 06 '21 08:01 roubachof

Thanks so much for your reply, @roubachof!

I'm afraid I did indeed use https for cloning. I'm on a Mac, and just booted up my Windows VM and got the same results as on the Mac side. I'll try to get my hands on a completely separate computer to try it on a wholly untarnished system.

Results from my Windows VM:

C:\src> git clone https://github.com/roubachof/Xamarin-Forms-Practices.git
Cloning into 'Xamarin-Forms-Practices'...
remote: Enumerating objects: 800, done.
remote: Counting objects: 100% (800/800), done.
remote: Compressing objects: 100% (443/443), done.
Receiving objects: 100% (1795/1795), 24.18 MiB | 11.88 MiB/sd 506 (delta 357), pack-reused 995
Receiving objects: 100% (1795/1795), 25.48 MiB | 11.85 MiB/s, done.
Resolving deltas: 100% (1273/1273), done.
C:\src> git submodule update --init
fatal: not a git repository (or any of the parent directories): .git
C:\src> cd .\Xamarin-Forms-Practices\
C:\src\Xamarin-Forms-Practices [master ≡]> git submodule update --init
Submodule 'Sharpnado.HorizontalListView' ([email protected]:roubachof/Sharpnado.HorizontalListView.git) registered for path 'Sharpnado.HorizontalListView'
Submodule 'Sharpnado.MaterialFrame' ([email protected]:roubachof/Sharpnado.MaterialFrame.git) registered for path 'Sharpnado.MaterialFrame'
Submodule 'Sharpnado.Tabs' ([email protected]:roubachof/Sharpnado.Tabs.git) registered for path 'Sharpnado.Tabs'
Cloning into 'C:/src/Xamarin-Forms-Practices/Sharpnado.HorizontalListView'...
Host key verification failed.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
fatal: clone of '[email protected]:roubachof/Sharpnado.HorizontalListView.git' into submodule path 'C:/src/Xamarin-Forms-Practices/Sharpnado.HorizontalListView' failed
Failed to clone 'Sharpnado.HorizontalListView'. Retry scheduled
Cloning into 'C:/src/Xamarin-Forms-Practices/Sharpnado.MaterialFrame'...
Host key verification failed.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
fatal: clone of '[email protected]:roubachof/Sharpnado.MaterialFrame.git' into submodule path 'C:/src/Xamarin-Forms-Practices/Sharpnado.MaterialFrame' failed
Failed to clone 'Sharpnado.MaterialFrame'. Retry scheduled
Cloning into 'C:/src/Xamarin-Forms-Practices/Sharpnado.Tabs'...
Host key verification failed.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
fatal: clone of '[email protected]:roubachof/Sharpnado.Tabs.git' into submodule path 'C:/src/Xamarin-Forms-Practices/Sharpnado.Tabs' failed
Failed to clone 'Sharpnado.Tabs'. Retry scheduled
Cloning into 'C:/src/Xamarin-Forms-Practices/Sharpnado.HorizontalListView'...
Host key verification failed.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
fatal: clone of '[email protected]:roubachof/Sharpnado.HorizontalListView.git' into submodule path 'C:/src/Xamarin-Forms-Practices/Sharpnado.HorizontalListView' failed
Failed to clone 'Sharpnado.HorizontalListView' a second time, aborting
C:\src\Xamarin-Forms-Practices [master ≡]>

jbachelor avatar Jan 06 '21 17:01 jbachelor

Hello, I encountered the same issue as jbachelor, did you find a solution since last month ?

Thank you ! :)

DrMozze avatar Feb 05 '21 19:02 DrMozze

@DrMozze - I'm ashamed to say I never did figure it out. Sorry I cannot be of more help.

jbachelor avatar Feb 05 '21 19:02 jbachelor

Even I am also facing same issue ;

git submodule update --init
fatal: not a git repository (or any of the parent directories): .git

sattasundar avatar Feb 19 '21 05:02 sattasundar

Hi,

I managed to clone the 3 submodules via HTTPS by

  1. Modifying the (hidden) .gitmodules file (replace the 3 urls with the HTTPS urls from the repos, e.g. https://github.com/roubachof/Sharpnado.Tabs.git)
  2. git submodule sync
  3. git submodule update --init

@roubachof Unfortunately, I get some errors in the IDE during package restore (followed, of course, by build errors).

@sattasundar I guess your working directory is not the previously cloned repo.

Thanks

kolex avatar Feb 24 '21 19:02 kolex

@DrMozze @jbachelor @sattasundar I just fixed the .gitmodules file. Should be fine by now

roubachof avatar Feb 26 '21 15:02 roubachof

I'm still getting this error when using 'git submodule update --init' :

fatal: remote error: upload-pack: not our ref f5869a681ded2b180f45d192e4665322e609c552
Fetched in submodule path 'Sharpnado.HorizontalListView', but it did not contain f5869a681ded2b180f45d192e4665322e609c552. Direct fetching of that commit failed.

crashnnburn avatar Nov 20 '21 17:11 crashnnburn

@crashnnburn for some reason the .gitmodules was not updated, should be fine now.

roubachof avatar Nov 26 '21 15:11 roubachof

Strange, now I'm getting:

fatal: No url found for submodule path 'Sharpnado.HorizontalListView' in .gitmodules

After checking your gitmodules file, it's not included. I tried adding it manually but after checking, it seems that repository is obsolete and was replaced by CollectionView. So I'm not sure where it's still being called from, since the gitmodules config doesn't list the module.

crashnnburn avatar Nov 29 '21 16:11 crashnnburn

Same here...

fatal: No url found for submodule path 'Sharpnado.HorizontalListView' in .gitmodules

danieldefreitasleite avatar Feb 04 '22 19:02 danieldefreitasleite

as @crashnnburn points out - how does it gets pulled in if not in the .gitmodules? image But moreover why does git and the cs projects want it? as HorizontalListView is now CollectionsView so I think is a misleading error from VS: image

Here is how I got it working:

I was getting errors about MaterialFrame.dll -> So I built that project first: image

I also built all the parent projects (not .ios or.droid) of CollectionView, Configuration, and Tabs In the Sharpnado Folder, then had to fix some using statements (not sure if neccesary, just VS probably complaining) and reload the solution (restart visual studio for me), and then all errors were resolved and the Mobile.Practices project built and I ran on my Android.

twofingerrightclick avatar Mar 03 '22 18:03 twofingerrightclick

could you try again? I tried to fix the submodule file

roubachof avatar Apr 01 '22 11:04 roubachof