Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

NCrunch fails to build Xamarin.Android project
DanHil
#1 Posted : Saturday, July 13, 2013 4:53:08 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 11/12/2012(UTC)
Posts: 85

Thanks: 11 times
Was thanked: 3 time(s) in 3 post(s)
NCrunch can't build my Xamarin.Android project in VS 2013 Preview 1.

I get the following output:
Quote:
NCrunch: If you are experiencing problems in getting this project to build, have a look at http://www.ncrunch.net/d..._project-build-issues#0
..\..\..\..\..\..\..\..\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets (564)#1: Could not copy the file "Resources\Layout\LoginView.axml" because it was not found.
..\..\..\..\..\..\..\..\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets (564)#2: Could not copy the file "Resources\Values\Strings.xml" because it was not found.
..\..\..\..\..\..\..\..\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets (564)#3: Could not copy the file "Resources\Layout\SplashScreen.axml" because it was not found.
..\..\..\..\..\..\..\..\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets (564)#4: Could not copy the file "Resources\Values\Styles.xml" because it was not found.
..\..\..\..\..\..\..\..\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets (564)#5: Could not copy the file "Resources\Values\MvxBindingAttributes.xml" because it was not found.
..\..\..\..\..\..\..\..\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets (564)#6: Could not copy the file "Resources\Drawable\Logo.png" because it was not found.
..\..\..\..\..\..\..\..\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets (564)#7: Could not copy the file "Resources\Drawable\Icon.png" because it was not found.
..\..\..\..\..\..\..\..\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets (564)#8: Could not copy the file "Resources\Drawable\splash.png" because it was not found.
Remco
#2 Posted : Saturday, July 13, 2013 11:59:10 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,161

Thanks: 964 times
Was thanked: 1296 time(s) in 1202 post(s)
Hi Daniel -

It looks to me as though NCrunch isn't aware of the resource files needed to build this project, so it doesn't copy them to the workspace. You can probably fix this by including them with the 'Additional files to include' setting.

Are you able to share how these files are referenced? My assumption is that this isn't being done from the project file ... a resx perhaps?


Cheers,

Remco
DanHil
#3 Posted : Sunday, July 14, 2013 6:59:09 AM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 11/12/2012(UTC)
Posts: 85

Thanks: 11 times
Was thanked: 3 time(s) in 3 post(s)
They are referenced from the project file but with a Xamarin.Android specific build action of "AndroidResource".
Remco
#4 Posted : Sunday, July 14, 2013 10:23:39 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,161

Thanks: 964 times
Was thanked: 1296 time(s) in 1202 post(s)
Thanks - that should be easy to fix. Is there any chance you could share the XML declaration?
DanHil
#5 Posted : Sunday, July 14, 2013 6:09:07 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 11/12/2012(UTC)
Posts: 85

Thanks: 11 times
Was thanked: 3 time(s) in 3 post(s)
Which XML declaration do you mean? Are you asking for the project file?
Remco
#6 Posted : Sunday, July 14, 2013 10:56:55 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,161

Thanks: 964 times
Was thanked: 1296 time(s) in 1202 post(s)
Just the XML in the project file that declares a reference to the AndroidResource. My guess is that it's something like:

<AndroidResource Include="MyResource.Resource" />

.. I just want to be certain that I add the correct parsing to the loader :)
DanHil
#7 Posted : Monday, July 15, 2013 6:26:32 AM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 11/12/2012(UTC)
Posts: 85

Thanks: 11 times
Was thanked: 3 time(s) in 3 post(s)
I sent you the project file via the contact page.
Additionally, I sent you one from Xamarin.iOS. I think it has a few build actions on its own:
- BundleResource
- InterfaceDefinition

Finally: Wouldn't it be better if NCrunch would simply copy all files referenced from an attribute "Include" that belongs to a tag that is the direct child of a "ItemGroup" tag?
Maybe with a black list for well-known tags that shouldn't result in a copy operation like "BootstrapperPackage" or "ProjectReference"
Remco
#8 Posted : Monday, July 15, 2013 7:00:08 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,161

Thanks: 964 times
Was thanked: 1296 time(s) in 1202 post(s)
Thanks Daniel - this gave me all the information I need :)

Broadly, there are two approaches .. either by whitelisting the files that are needed, or by blacklisting the ones that are not. Trial and error has proved that the whitelisting gives more predictable results with error messages that are generally easier to troubleshoot. Blacklisting can result in some very, very strange problems, and is also subject to certain limitations within MSBuild itself. When an item type is not deliberately considered by NCrunch, it is essentially an unknown - which can be dangerous to make any kind of assumptions about. MSBuild and project templates can unfortunately be full of surprises.
DanHil
#9 Posted : Thursday, July 18, 2013 6:06:49 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 11/12/2012(UTC)
Posts: 85

Thanks: 11 times
Was thanked: 3 time(s) in 3 post(s)
Remco;4390 wrote:
Thanks Daniel - this gave me all the information I need :)


Nice! :-)
Will you release a new version that supports those?
Remco
#10 Posted : Friday, July 19, 2013 12:00:38 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,161

Thanks: 964 times
Was thanked: 1296 time(s) in 1202 post(s)
This will be included in the next maintenance release ... which at the moment I'm thinking will likely be around September. Because it's possible to work around it (i.e. with Additional files to include), it isn't really worth the risk of a separate release in short order, but it will definitely be in V1 :)
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.051 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download