Skip to content

Conversation

@dellis1972
Copy link
Contributor

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

In this case the problem was being caused by the fact that the
AndroidManifest.xml was constantly being modified. The item

<meta-data android:name="android.support.VERSION" android:value="25.4.0" />

was constantly being duplicated in manifest. As a result it
was always newer and was triggering a change of build targets.

So we need to double check we are NOT adding 100% duplicate
values to the manifest.

{
var name = AndroidXmlNamespace.GetName ("name");
foreach (var node in nodes.Select (x => x as XElement)) {
var existing = element.XPathSelectElements ($"./{node.Name.LocalName}").Any (x => AttributesMatch (x, node));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see why this needs to use XPathSelectElements() when it's for a single element. Shouldn't element.Elements (node.Name) work?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Be careful of any possible namespace prefixes in the argument name. The value should be really Name.LocalName (considering that meta-data element is in the default namespace).

It had better be indeed Elements() though; no need to kick XPath parser just for this.

@dellis1972 dellis1972 force-pushed the Bug58865 branch 2 times, most recently from 33e2576 to 989ae8a Compare August 23, 2017 11:31
…difying .cs file in a referenced library project

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

In this case the problem was being caused by the fact that the
AndroidManifest.xml was constantly being modified. The item

	<meta-data android:name="android.support.VERSION" android:value="25.4.0" />

was constantly being duplicated in manifest. As a result it
was always newer and was triggering a change of build targets.

So we need to double check we are NOT adding 100% duplicate
values to the manifest.
@jonpryor jonpryor merged commit 89a6d68 into dotnet:master Aug 24, 2017
jonpryor pushed a commit to jonpryor/xamarin-android that referenced this pull request Sep 11, 2017
…otnet#764)

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

Consider a project with an `App.csproj` and a referenced
`Lib.csproj`. Not all changes to C# sources within `Lib.csproj`
should require rebuilding and redeploying the `.apk` when
Fast Deployment is enabled; only those that result in changes
to Java Callable Wrappers should require rebuilding and
redeploying the `.apk`.

Unfortunately, that wasn't the case: *any* change to `Lib.csproj`
would result rebuilding and redeploying the `.apk`, because
`AndroidManifest.xml` was constantly being modified, which would
cause the `_CompileToDalvikWithDx` target to be invoked, resulting
in a `.apk` rebuild + redeploy.

The item

	<meta-data android:name="android.support.VERSION" android:value="25.4.0" />

was constantly being duplicated in the manifest. As a result it
was always newer and was triggering a change of build targets.

So we need to double check we are NOT adding 100% duplicate
values to the manifest.
@github-actions github-actions bot locked and limited conversation to collaborators Feb 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants