Bug 56805 - res/layout/somelayout.xml.tmp(1): error APT0000: Resource entry somelayout is already defined.
Summary: res/layout/somelayout.xml.tmp(1): error APT0000: Resource entry somelayout i...
Status: RESOLVED NORESPONSE
Alias: None
Product: Android
Classification: Xamarin
Component: General ()
Version: 7.3 (15.2)
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Jonathan Pryor
URL:
Depends on:
Blocks:
 
Reported: 2017-05-24 14:43 UTC by Justin Toth
Modified: 2017-08-21 22:28 UTC (History)
2 users (show)

Tags: bb
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 NORESPONSE

Description Justin Toth 2017-05-24 14:43:38 UTC
I'm infrequently getting some variation of the below error when building my Android project:

res/layout/accountsignupstep1emailsent.xml.tmp(1): error APT0000:  Resource entry accountsignupstep1emailsent is already defined.

Here is the full build log: https://gist.github.com/justintoth/c6738daf2d0a36df087c0a4afce63964

This is definitely a bug and not a valid error, as it happens randomly and is resolved by simply re-running the project without any changes. It happens maybe once out of every 20 times I build the project.

It's happening on Visual Studio for Mac, however I know that Xamarin Studio also suffers from the same issue because I've been seeing this issue consistently over the past 6 months or so.

Here are my environment settings:

Visual Studio Community 2017 for Mac
Version 7.0 (build 3146)
Installation UUID: 62cf1ad2-0db0-41e1-ac78-aeb509d79f60
Runtime:
	Mono 5.0.0.100 (2017-02/9667aa6) (64-bit)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 500000100

NuGet
Version: 4.0.0.2323

.NET Core
Runtime: /usr/local/share/dotnet/dotnet
SDK: /usr/local/share/dotnet/sdk/1.0.3/Sdks
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/5.0.0/lib/mono/msbuild/15.0/bin/Sdks

Xamarin.Profiler
Version: 1.5.4
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

Xamarin.Android
Version: 7.3.1.1 (Visual Studio Community)
Android SDK: /android/sdk
	Supported Android versions:
		5.0 (API level 21)
		5.1 (API level 22)
		6.0 (API level 23)
		7.0 (API level 24)
		7.1 (API level 25)

SDK Tools Version: 25.2.5
SDK Platform Tools Version: 25.0.5
SDK Build Tools Version: 25.0.2

Java SDK: /Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home
java version "1.8.0_101"
Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)

Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

Xamarin Inspector
Version: 1.2.2
Hash: b71b035
Branch: d15-1
Build date: Fri, 21 Apr 2017 17:57:12 GMT

Apple Developer Tools
Xcode 8.3.2 (12175)
Build 8E2002

Xamarin.Mac
Version: 3.4.0.33 (Visual Studio Community)

Xamarin.iOS
Version: 10.10.0.33 (Visual Studio Community)
Hash: 3e5ac5ff
Branch: d15-2
Build date: 2017-05-05 18:11:38-0400

Build Information
Release ID: 700003146
Git revision: 7553fda2e327d15807298d444007896e5b975dba
Build date: 2017-05-09 12:12:36-04
Xamarin addins: c3d580752be79fc902422f1d55d1cdc2d8b98799
Build lane: monodevelop-lion-d15-2

Operating System
Mac OS X 10.12.4
Darwin 16.5.0 Darwin Kernel Version 16.5.0
    Fri Mar  3 16:52:33 PST 2017
    root:xnu-3789.51.2~3/RELEASE_X86_64 x86_64
Comment 1 Jon Douglas [MSFT] 2017-06-23 18:31:54 UTC
Thank you for taking the time to submit the bug. We are unable to reproduce this issue. Please attach a reproduction to the bug by starting with a clean Xamarin.Android project and adding just the code necessary to demonstrate the issue.

It sounds like a potential issue with a cache or the obj/bin getting into a bad state. If at possible, please upload a project that you've run into this issue with. I haven't seen this with layouts to be honest, but seeing the ".tmp" makes it seem like the reason why it's already defined is because it's already in the non ".tmp" .xml file.

Thus I am marking this issue as NEEDINFO until we can get a start of a reproduction. If I encounter this in the wild, I will upload a project myself. However I haven't seen this quite yet.
Comment 2 Jon Douglas [MSFT] 2017-08-21 20:19:56 UTC
Because we have not received a reply to our request for more information we are closing this issue. If you are still encountering this issue, please reopen the ticket with the requested information. Thanks!
Comment 3 Justin Toth 2017-08-21 22:19:48 UTC
Fair enough, there is a bug here but I can't give you what you want because it only happens once or twice a day, out of 50+ builds that I'll do in a given day. So it's reasonable to close it if no one can figure out the bug based on the code.
Comment 4 Jon Douglas [MSFT] 2017-08-21 22:28:53 UTC
(In reply to Justin Toth from comment #3)
> Fair enough, there is a bug here but I can't give you what you want because
> it only happens once or twice a day, out of 50+ builds that I'll do in a
> given day. So it's reasonable to close it if no one can figure out the bug
> based on the code.

At any point you encounter this issue again or another individual who comes across this bug report, feel free to re-open this bug if you have a reliable reproduction. Without us being able to reproduce this issue or have a reproduction case, it is a game of guessing.

We can see that the resource is "accountsignupstep1emailsent" which I believe is a user defined resource (It is defined in your Android project). I would suspect an issue with resource merging or resource generation within the _UpdateAndroidResgen target in which bad cache scenario happens.

Although there is information in the build output log you've provided (Thank you!), there's not a sufficient way to identify this problem quite yet. We have recently made some fixes to this target:

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

I would recommend trying this Alpha build to see if this problem goes away. If it does not, we can investigate it further. Feel free to reopen after trying the new alpha.