Bug 57281 - XAML IntelliSense only works when iOS target is set, not Android
Summary: XAML IntelliSense only works when iOS target is set, not Android
Status: VERIFIED FIXED
Alias: None
Product: Android
Classification: Xamarin
Component: MSBuild ()
Version: 7.4 (15.3)
Hardware: PC Windows
: --- blocker
Target Milestone: 15.4
Assignee: dean.ellis
URL:
: 34023 35075 45848 52908 57275 ()
Depends on:
Blocks:
 
Reported: 2017-06-08 18:11 UTC by Pierce Boggan [MSFT]
Modified: 2017-08-14 10:10 UTC (History)
21 users (show)

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


Attachments
Logs (27.34 KB, application/x-zip-compressed)
2017-06-08 18:11 UTC, Pierce Boggan [MSFT]
Details
Logs Android (3.06 KB, application/x-zip-compressed)
2017-08-14 10:10 UTC, Jacky Waswani
Details


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:
VERIFIED FIXED

Description Pierce Boggan [MSFT] 2017-06-08 18:11:20 UTC
# Steps to reproduce
1. File -> New -> Cross-Platform -> Cross-Platform App -> Blank Forms App.
2. Open MainPage.xaml.
3. Try to type and get XAML IntelliSense.

# Expected behavior
XAML IntelliSense functions properly for Android target.

# Actual behavior
XAML IntelliSense functions properly only for iOS target, as seen here:
https://www.screencast.com/t/zM8MJ6Qb

# Supplemental info (logs, images, videos)
Logs attached.

# Test environment (full version information)
Environment Info: https://gist.github.com/pierceboggan/5b5fba9ff76ed6f5841a0136303b9d4a
Comment 1 Pierce Boggan [MSFT] 2017-06-08 18:11:32 UTC
Created attachment 22782 [details]
Logs
Comment 2 Adrian Alonso 2017-06-15 13:02:06 UTC
I could reproduce the issue. However after building the Android project and reopening the solution, the xaml intellisense started to work with any target selected. So probably the cause of the issue is some lack of metadata at the time of opening the solution. Since there are a couple of workarounds (selecting iOS or building Android and reoponing the solution) I would postpone this issue for 15.4, decrease importance from blocker to normal and also ping XAML lang service guys to take a look at it. Please let me know if you think we should tackle before 15.4
Comment 3 Alan McGovern 2017-06-16 09:30:40 UTC

*** This bug has been marked as a duplicate of bug 56629 ***
Comment 4 Alan McGovern 2017-06-16 09:30:53 UTC
Oops, wrong bug!
Comment 5 Pierce Boggan [MSFT] 2017-06-19 18:29:52 UTC
This issue is affecting the critical path of most of our users: File -> New -> Forms app. Even though there is a workaround, IntelliSense is a high visibility issue as developers expect it to just "work" out of the box. Issues affecting IntelliSense also affect first run, as there is no way for users to discover XAML controls from within the IDE (as there is no toolbox for XAML controls).
Comment 7 Jon Goldberger [MSFT] 2017-06-20 00:39:38 UTC
I just experienced this as well. However after building the solution and closing and re-opnening visual studio, although selecting Xamarin.Android as the target worked for Intellisense, selecting the UWP target did not. With the UWP target selected, I only got intellisense for UWP types, not Xamarin.Forms types.
Comment 8 Pierce Boggan [MSFT] 2017-06-20 20:04:43 UTC
*** Bug 45848 has been marked as a duplicate of this bug. ***
Comment 9 Adrian Alonso 2017-06-21 19:48:20 UTC
*** Bug 35075 has been marked as a duplicate of this bug. ***
Comment 10 Adrian Alonso 2017-06-21 19:48:52 UTC
*** Bug 34023 has been marked as a duplicate of this bug. ***
Comment 11 Juan Marcelo Tondato 2017-06-23 20:32:07 UTC
This issue is related to designTimeBuild, in this mode XA skip task `GetAdditionalResourcesFromAssemblies` and the cache required for `Aapt` task is not saved.

Moving the bug to Android for visibility from the right team.
Comment 12 Juan Marcelo Tondato 2017-06-27 13:01:20 UTC
*** Bug 57275 has been marked as a duplicate of this bug. ***
Comment 13 Juan Marcelo Tondato 2017-06-28 20:32:42 UTC
*** Bug 52908 has been marked as a duplicate of this bug. ***
Comment 14 dean.ellis 2017-07-18 15:50:51 UTC
Pierce

Can we retest this on d15-4?

Cheers.
Comment 15 Jonathan Pryor 2017-07-18 15:52:24 UTC
This might be fixed by: https://github.com/xamarin/xamarin-android/pull/668
Comment 16 dean.ellis 2017-07-28 10:13:01 UTC
PR 688 did not fix the problem :/
Comment 17 dean.ellis 2017-07-28 12:38:50 UTC
We have a bit of a dilemma it seems. The warnings in the intelligence build come from the fact that the additional resources have not been downloaded. But we don't want to download them because they can take ages to get. So to fix them we need to download the resources. But we can't download the resources because it will probably lock up the IDE while it downloads. 

I'll investigate to see if there is a work around we can do
Comment 18 Pierce Boggan [MSFT] 2017-07-28 20:18:50 UTC
Also worth noting in my debugging with @Alan that this is only happening with Shared Projects, not library projects.
Comment 19 dean.ellis 2017-07-31 10:05:47 UTC
The reason it does not work for Shared projects is because they are built as part of the android app.. and its the android app that needs all the support libraries in place to build property. Currently that is not done for designative builds because of the problems with getting stuff from the internet (which might take a while and lock the IDE)

I am in the process of Reworking GetAdditionalResourcesFromAssemblies. 
The idea being that in a DesignTimeBuild we can do everything BUT download zips.. 
So if the required resource files are in the android-idk/extras directory they will be extracted. However if the Task needs to hit the internet , it won't...(for desigtime) locking up the IDE for 10 minutes while it downloads something in a designative build is a HUGE problem, and will make things look allot worse for the user.
Comment 20 dean.ellis 2017-08-01 11:52:34 UTC
Hopefully this will be fixed by xamarin-android/master/1cd582ec

This fix will only work IF the m2repository files are installed in android-sdk/extras. If they are not and the system needs to download the files, this bug will persist. 
There is nothing I can do about that until we start packaging the resources in the Nuget packages.
Comment 23 Jacky Waswani 2017-08-14 10:10:31 UTC
Created attachment 24164 [details]
Logs Android