Bug 60878 - Android design-time intellisense doesn't process global cache AARs
Summary: Android design-time intellisense doesn't process global cache AARs
Status: VERIFIED FIXED
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: Android ()
Version: 4.8.0 (15.5)
Hardware: PC Windows
: --- major
Target Milestone: 15.5.1
Assignee: dean.ellis
URL:
Depends on:
Blocks:
 
Reported: 2017-11-27 21:39 UTC by Jérémie Laval
Modified: 2018-01-17 08:02 UTC (History)
6 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 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 Jérémie Laval 2017-11-27 21:39:04 UTC
When using a NuGet package that downloads AARs dynamically (and thus is stored in `C:\Users\[user]\AppData\Local\Xamarin\` (like older support libraries or Google Play Services) the design-time build doesn't include those resources in the parsing even when they are present and unpacked by an actual build.

To reproduce create a Android app that references support libraries and note that:

 - If using 25.x.x then the Resource class contains all the right IDs
 - If using 24.x.x then the Resource class *does not* contain all the right IDs.

Diagnostics:

The managed resource generator only includes `AdditionalResourceDirectories="@(LibraryResourceDirectories)"` to parse extra resources which misses those that are coming from the cache. That Aapt task includes both:

```
AdditionalResourceDirectories="@(LibraryResourceDirectories)"
AdditionalAndroidResourcePaths="@(_AdditonalAndroidResourceCachePaths)"
```

Effects:

No intellisense will be provided and red squiggles will be shown for any NuGet that uses the shared cache. Compilation will work though.
Comment 1 dean.ellis 2017-11-28 12:54:00 UTC
PR https://github.com/xamarin/xamarin-android/pull/1050
Comment 2 dean.ellis 2017-11-28 16:01:22 UTC
Fixed in Xamarin-android/master/14e2f92
Comment 3 dean.ellis 2017-11-28 16:01:39 UTC
Needs to be CP'd over to d15.5
Comment 5 Gaurav Ganorkar 2017-12-07 13:03:32 UTC
I have checked this issue on the build d15svc build  - 27130.2002.d15svc
The issue is FIXED and have been Verified on the below config

Microsoft Visual Studio Enterprise 2017 d15svc
Version 15.5.0 Preview 6.0 [27130.2002.d15svc]
VisualStudio.15.int.d15svc/15.5.0-pre.6.0+27130.2002.d15svc
Microsoft .NET Framework
Version 4.7.02053

Installed Version: Enterprise

Xamarin   4.8.0.753 (6575bd113)
Xamarin Designer   4.8.183 (2577c82ea)
Xamarin.Android SDK   8.1.0.24 (HEAD/9cfa7836b)
Xamarin.iOS and Xamarin.Mac SDK   11.6.1.2 (6857dfc)

Full Build info - 
https://gist.github.com/GLjackyvaswani/4c4ec6a703b5e3293a680a7572d7bc76

Screencast link- 
https://www.screencast.com/t/DAHXqg2aTDwd

Syntax highlighting  are proper and Types are properly recognized (colored in light blue/teal, no red underlines).

Hence marking this defect as VErified FIXED
Comment 6 Luis Aguilera 2018-01-16 23:37:23 UTC
@gaurav, please re-test this with 15.6 builds... in d15svc (aka 15.5.3 and 15.5.5) the Android DTB feature is disabled, hence this problem does not occur. In 15.6 however, the feature has been re-enabled, and we need to make sure that this is fixed correctly therein.
Comment 7 Gaurav Ganorkar 2018-01-17 08:02:52 UTC
Hello Luis,

I have verified this issue again on 15.6 Preview 2 builds and Issue seems to be Fixed there too. Verified on Below builds 

Microsoft Visual Studio Enterprise 2017 d15.6stg
Version 15.6.0 Preview 3.0 [27308.9000.merge]
VisualStudio.15.int.d15.6stg/15.6.0-pre.3.0+27308.9000.merge
Microsoft .NET Framework
Version 4.7.02556

Installed Version: Enterprise

Xamarin   4.9.0.705 (7bd7821d7)
Xamarin Designer   4.10.40 (1f43fcf56)
Xamarin.Android SDK   8.2.0.6 (HEAD/af4c56a1a)
Xamarin.iOS and Xamarin.Mac SDK   11.8.0.8 (eaff169)

Full Build info-
https://gist.github.com/GLjackyvaswani/8fbf5146f0a904681a6deb44c22f88d8

Supported nuget package used - the Xamarin.Android.Support.v7.AppCompat v25.4.0.2 NuGet package.

Screencast link-
https://www.screencast.com/t/3DONSCspobWu


 Types are properly recognized (colored in light blue/teal, no red underlines) aslo Syntax highlighting is displayed as expected