Bug 46108 - Cannot Build Xamarin.Forms From Source Code
Summary: Cannot Build Xamarin.Forms From Source Code
Status: RESOLVED ANSWERED
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: unspecified
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2016-10-27 23:16 UTC by Hakan
Modified: 2017-06-16 19:58 UTC (History)
4 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED ANSWERED

Description Hakan 2016-10-27 23:16:15 UTC
I have downloaded the Xamarin.Forms solution from GitHub and I am trying to build the solution. Visual Studio does not build, generating more than 70 errors, as simple as the one below:

"The type or namespace name 'IOnClickListener' could not be found (are you missing a using directive or an assembly reference?"in Xamarin.Forms.Platform.Android\AppCompat\ButtonRenderer.cs

When I investigate the code, I see that there is really no reference to Android.Views.View in the using statements, so it seems fair.

Additional note:  I have the Android SDK's installed and I accepted Visual Studio's prompt to restore the NuGet packages. I did not install Bing Maps SDK or UWP development tools because I am only interested in the Android part for now, so I can unload the Windows projects. But still I get 70+ errors for the Android part.
Comment 1 Samantha Houts [MSFT] 2016-10-28 16:47:21 UTC
Upon opening the Xamarin.Forms solution, you will find that there are a number of errors and warnings under the Error List pane; you can resolve this by changing the filter from Build + IntelliSense to Build Only. At this point, you should be able to successfully build the solution.

Warm regards,
Xamarin Forms Team
Comment 2 Samantha Houts [MSFT] 2016-10-28 17:01:50 UTC
If you continue to receive errors after switching your filter, please let us know what the errors are. 

Warm regards,
Xamarin Forms Team
Comment 3 Hakan 2016-10-28 20:54:19 UTC
Yes, I continue to receive errors preventing a successful build. There are 70+ basic errors such as:

"The type or namespace name 'IOnClickListener' could not be found (are you missing a using directive or an assembly reference?"in Xamarin.Forms.Platform.Android\AppCompat\ButtonRenderer.cs

When I investigate the code, I see that there is really no reference to Android.Views.View in the using statements.
Comment 4 adrianknight89 2016-11-02 16:06:04 UTC
You're receiving those errors because your SDK Manager configuration isn't right. Install API 24 (latest revision [probably 2]) and then build tools 24.[same revision]. Make sure the revisions in both match. Do not install a higher build tools version.

Install the latest on SDK Tools and SDK Platform-tools.

Install jdk 1.8 and make sure you're using it. Tools -> Options/Settings -> Xamarin -> Android. Change from 1.7 to 1.8. I think 1.8 is installed in Program Files once you install it.
Comment 5 adrianknight89 2016-11-02 16:10:10 UTC
Also, if you are using VS 15 preview 5, then updating Xamarin will break everything (at least for me it did). VS 2015 is fine.

https://bugzilla.xamarin.com/show_bug.cgi?id=46168