Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Xamarin.Forms previewer fails with shared project that doesn't follow specific naming pattern #5038

Closed
mfeingol opened this issue Jan 23, 2019 · 17 comments
Assignees
Labels
forms-previewer s/unverified New report that has yet to be verified

Comments

@mfeingol
Copy link

mfeingol commented Jan 23, 2019

Description

Currently the previewer expects a specific naming convention when associating a shared project and a platform project

<Project>.Android
<Project>.projitems

If the shared project has a name like

<Project>.Xamarin.projitems 

Than the previewer is unable to figure out what project to associate the shared project with.

Shared projects are being deprecated so I'm not sure how fixing this will get prioritized

Original Description

I have a Xamarin.Forms Android project that uses a shared project for XAML and code-behind. I recently discovered the existence of the Xamarin.Forms XAML Previewer. Unfortunately, it does not appear to work with my project. The error displayed is the following:

"An android application project must reference a project containing this xaml file in order to render in the previewer"

Since the shared project is, well, shared, there's no way to reference it from the Android project.

The app works well otherwise, and has been shipping to the Google Play Store for some time now.

Any ideas on how to troubleshoot this? Thanks.

Steps to Reproduce

Expected Behavior

Actual Behavior

Basic Information

  • Version with issue: Latest
  • Last known good version: Unknown
  • IDE: VS 15.9.5
  • Platform Target Frameworks:
    • Android: Latest
  • Android Support Library Version: Latest
  • Nuget Packages:
  • Affected Devices:

Screenshots

image

Reproduction Link

VS bug #775811

@mfeingol
Copy link
Author

Any ideas on what might be causing this? I'd be happy to add you to my Azure DevOps project if you'd like.

@drewgillies
Copy link

@mfeingol I'd be interested to see whether this issue continues to reproduce with the latest VS 2019 preview. Please try it and see if we've fixed this one (I believe we have). If not, we'll take a deeper look.

@drewgillies
Copy link

Just repro'd this myself. As you were.

@mfeingol
Copy link
Author

mfeingol commented Mar 5, 2019

Confirmed it still repros in 2019 RC as well. :-)

@TimBarham
Copy link
Contributor

TimBarham commented Apr 5, 2019

Since the shared project is, well, shared, there's no way to reference it from the Android project.

So, it is "referenced" from the Android project via including the shared project's projitems file in the Android project. For example:

<Import Project="..\BlankApp\BlankApp.projitems" Label="Shared" />

Perhaps not ideal wording for that error message for the shared project scenario, but regardless, it should work out of the box, and it is an issue if it does.

@mfeingol
Copy link
Author

mfeingol commented Apr 5, 2019

@TimBarham: you're right, my Android project has a Label="Shared" reference. However, the XF previewer doesn't work out of the box.

@arvindrajachourasiya
Copy link

Same issue I am facing....killing my time

@samhouts samhouts added the s/unverified New report that has yet to be verified label Apr 9, 2019
@PureWeen
Copy link
Contributor

PureWeen commented Jun 1, 2019

@mfeingol can you try again on the latest vs 2019?

I tested with the following shared project
Archive.zip

And for me that's showing up on vsmac and vs2019 now

@PureWeen PureWeen added the s/needs-info ❓ A question has been asked that requires an answer before work can continue on this issue. label Jun 1, 2019
@mfeingol
Copy link
Author

mfeingol commented Jun 1, 2019

@PureWeen: works with your sample projects. Still doesn't work with my own projects.

Want me to add you to my Azure DevOps project?

@PureWeen
Copy link
Contributor

PureWeen commented Jun 1, 2019

Yea! shneuvil at microsoft.com

@mfeingol
Copy link
Author

mfeingol commented Jun 1, 2019

You're in.

@mfeingol
Copy link
Author

mfeingol commented Jun 5, 2019

@PureWeen: let me know if you have any problems accessing the project or reproducing the issue.

@samhouts samhouts removed the s/needs-info ❓ A question has been asked that requires an answer before work can continue on this issue. label Jun 10, 2019
@samhouts
Copy link
Member

@PureWeen ping!

@PureWeen
Copy link
Contributor

It looks like I have access

I'm pulling down the project now and I'll let you know what I find.

Apologies for the delay

@mfeingol
Copy link
Author

No worries. You can ping me internally if you have questions.

@PureWeen PureWeen changed the title Xamarin.Forms previewer fails: android application project must reference project containing this xaml file Xamarin.Forms previewer fails with shared project that doesn't follow specific naming pattern Jun 26, 2019
@PureWeen
Copy link
Contributor

@mfeingol I updated the description with how to work around the issue.

@drewgillies
Copy link

Thanks for the issue. I'm doing a sweep of Xamarin.Forms previewer issues to close them as we're focusing on areas with greater impact for now. We will keep the issue on file, however, for future reference. Thanks again!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
forms-previewer s/unverified New report that has yet to be verified
Projects
None yet
Development

No branches or pull requests

6 participants