Skip to content

Commit f7ea4a3

Browse files
jonathanpeppersjonpryor
authored andcommitted
[Xamarin.Android.Build.Tasks] add feature flag for Google Manifest Merger (#4022)
Context: https://github.com/xamarin/QualityAssurance/commit/a01b7d9d6a724523878236e49dbb8f69c6dfedc8 In commit 2c6f5cd, we added support for using the official Google/Android [Manifest Merger][0]. After further QA testing, it seems that a reasonable number of existing apps require code changes to *appease* the new manifest merger: error AMM0000: …/QualityAssurance/Samples/android/XAQA.Bug28816/obj/Release/AndroidManifest.xml:4:3-42 Error: error AMM0000: uses-sdk:minSdkVersion 10 cannot be smaller than version 14 declared in library …/QualityAssurance/Samples/android/XAQA.Bug28816/obj/Release/lp/6/jl/AndroidManifest.xml as the library might be using APIs not available in 10 error AMM0000: Suggestion: use a compatible library with a minSdk of at most 10, error AMM0000: or increase this project's minSdk version to at least 14, error AMM0000: or use tools:overrideLibrary="android.support.v4" to force usage (may lead to runtime failures) This is a similar situation we were in compared to `aapt2`, where the suggested changes are good (and usually fix problems). I think we should add a feature flag, so we can gradually turn this on. We could add the feature off by default for one release, and then turn it on by default for the next. Add a new `$(AndroidManifestMerger)` MSBuild property to control which `AndroidManifest.xml` merger is used. The values are: * `legacy`: Merge `AndroidManifest.xml` files in the same way we did before commit 2c6f5cd. * `manifestmerger.jar`: Use Android's Manifest Merger. The default value for `$(AndroidManifestMerger)` is `legacy`. This will change in a future release. [0]: https://developer.android.com/studio/build/manifest-merge
1 parent acd31f0 commit f7ea4a3

File tree

8 files changed

+96
-11
lines changed

8 files changed

+96
-11
lines changed

Documentation/guides/BuildProcess.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -642,6 +642,20 @@ when packaging Release applications.
642642
produce the actual `AndroidManifest.xml`.
643643
The `$(AndroidManifest)` must contain the package name in the `/manifest/@package` attribute.
644644
645+
- **AndroidManifestMerger** – Specifies the implementation for
646+
merging `AndroidManifest.xml` files. This is an enum-style property
647+
where `legacy` is the original C# implementation in Xamarin.Android,
648+
and `manifestmerger.jar` uses Google's Java implementation for Android.
649+
650+
Going forward, we will be migrating to Google's implementation to
651+
match behavior with applications built with Android Studio. Google's
652+
merger enables support for `xmlns:tools="http://schemas.android.com/tools"`
653+
as described in the [Android documentation][manifest-merger].
654+
655+
Introduced in Xamarin.Android 10.2
656+
657+
[manifest-merger]: https://developer.android.com/studio/build/manifest-merge
658+
645659
- **AndroidMultiDexClassListExtraArgs** – A string property
646660
which allows developers to pass additional arguments to the
647661
`com.android.multidex.MainDexListBuilder` when generating the

src/Xamarin.Android.Build.Tasks/MSBuild/Xamarin/Android/Xamarin.Android.Designer.targets

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,17 +66,27 @@ Copyright (C) 2016 Xamarin. All rights reserved.
6666
DependsOnTargets="_AddStaticResources;_ResolveAssemblies;_CopyAssembliesForDesigner;_PrepareAssembliesForDesigner;$(BeforeGenerateAndroidManifest)"
6767
Inputs="$(_ResolvedUserAssembliesHashFile);@(ResolvedAssemblies);@(ResolvedUserAssemblies);$(_AndroidManifestAbs);"
6868
Outputs="$(_AndroidIntermediateJavaSourceDirectory)mono\MonoPackageManager_Resources.java;$(_AcwMapFile)">
69+
70+
<PropertyGroup>
71+
<_ManifestOutput Condition=" '$(AndroidManifestMerger)' == 'legacy' ">$(IntermediateOutputPath)android\AndroidManifest.xml</_ManifestOutput>
72+
<_ManifestOutput Condition=" '$(AndroidManifestMerger)' != 'legacy' ">$(IntermediateOutputPath)AndroidManifest.xml</_ManifestOutput>
73+
</PropertyGroup>
74+
<ItemGroup>
75+
<_MergedManifestDocuments Condition=" '$(AndroidManifestMerger)' == 'legacy' " Include="@(ExtractedManifestDocuments)" />
76+
</ItemGroup>
77+
6978
<GenerateJavaStubs
7079
ResolvedAssemblies="@(_ResolvedAssemblies)"
7180
ResolvedUserAssemblies="@(_ResolvedUserMonoAndroidAssembliesForDesigner)"
7281
ManifestTemplate="$(_AndroidManifestAbs)"
82+
MergedManifestDocuments="@(_MergedManifestDocuments)"
7383
Debug="$(AndroidIncludeDebugSymbols)"
7484
NeedsInternet="$(AndroidNeedsInternetPermission)"
7585
AndroidSdkPlatform="$(_AndroidApiLevel)"
7686
AndroidSdkDir="$(_AndroidSdkDirectory)"
7787
PackageName="$(_AndroidPackage)"
7888
OutputDirectory="$(IntermediateOutputPath)android"
79-
MergedAndroidManifestOutput="$(IntermediateOutputPath)android\AndroidManifest.xml"
89+
MergedAndroidManifestOutput="$(_ManifestOutput)"
8090
UseSharedRuntime="$(AndroidUseSharedRuntime)"
8191
EmbedAssemblies="$(EmbedAssembliesIntoApk)"
8292
BundledWearApplicationName="$(BundledWearApplicationPackageName)"
@@ -87,6 +97,7 @@ Copyright (C) 2016 Xamarin. All rights reserved.
8797
SupportedAbis="$(_BuildTargetAbis)">
8898
</GenerateJavaStubs>
8999
<ManifestMerger
100+
Condition=" '$(AndroidManifestMerger)' == 'manifestmerger.jar' "
90101
ToolPath="$(JavaToolPath)"
91102
JavaOptions="$(JavaOptions)"
92103
ManifestMergerJarPath="$(AndroidManifestMergerJarPath)"

src/Xamarin.Android.Build.Tasks/Tasks/GenerateJavaStubs.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ public class GenerateJavaStubs : AndroidTask
4343
public string [] SupportedAbis { get; set; }
4444

4545
public string ManifestTemplate { get; set; }
46+
public string[] MergedManifestDocuments { get; set; }
4647

4748
public bool Debug { get; set; }
4849
public bool MultiDex { get; set; }
@@ -249,7 +250,7 @@ void Run (DirectoryAssemblyResolver res)
249250
manifest.NeedsInternet = NeedsInternet;
250251
manifest.InstantRunEnabled = InstantRunEnabled;
251252

252-
var additionalProviders = manifest.Merge (all_java_types, ApplicationJavaClass, EmbedAssemblies, BundledWearApplicationName);
253+
var additionalProviders = manifest.Merge (all_java_types, ApplicationJavaClass, EmbedAssemblies, BundledWearApplicationName, MergedManifestDocuments);
253254

254255
using (var stream = new MemoryStream ()) {
255256
manifest.Save (stream);

src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/ManifestTest.cs

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -657,11 +657,15 @@ public class TestActivity2 : FragmentActivity {
657657
}
658658

659659
[Test]
660-
public void AllActivityAttributeProperties ()
660+
public void AllActivityAttributeProperties ([Values ("legacy", "manifestmerger.jar")] string manifestMerger)
661661
{
662-
const string expectedOutput = "android:name=\"com.contoso.TestActivity\" android:allowEmbedded=\"true\" android:allowTaskReparenting=\"true\" android:alwaysRetainTaskState=\"true\" android:autoRemoveFromRecents=\"true\" android:banner=\"@drawable/icon\" android:clearTaskOnLaunch=\"true\" android:colorMode=\"hdr\" android:configChanges=\"mcc\" android:description=\"@string/app_name\" android:directBootAware=\"true\" android:documentLaunchMode=\"never\" android:enableVrMode=\"foo\" android:enabled=\"true\" android:excludeFromRecents=\"true\" android:exported=\"true\" android:finishOnCloseSystemDialogs=\"true\" android:finishOnTaskLaunch=\"true\" android:hardwareAccelerated=\"true\" android:icon=\"@drawable/icon\" android:immersive=\"true\" android:label=\"TestActivity\" android:launchMode=\"singleTop\" android:lockTaskMode=\"normal\" android:logo=\"@drawable/icon\" android:maxAspectRatio=\"1.2\" android:maxRecents=\"1\" android:multiprocess=\"true\" android:noHistory=\"true\" android:parentActivityName=\"unnamedproject.unnamedproject.MainActivity\" android:permission=\"com.contoso.permission.TEST_ACTIVITY\" android:persistableMode=\"persistNever\" android:process=\"com.contoso.process.testactivity_process\" android:recreateOnConfigChanges=\"mcc\" android:relinquishTaskIdentity=\"true\" android:resizeableActivity=\"true\" android:resumeWhilePausing=\"true\" android:rotationAnimation=\"crossfade\" android:roundIcon=\"@drawable/icon\" android:screenOrientation=\"portrait\" android:showForAllUsers=\"true\" android:showOnLockScreen=\"true\" android:showWhenLocked=\"true\" android:singleUser=\"true\" android:stateNotNeeded=\"true\" android:supportsPictureInPicture=\"true\" android:taskAffinity=\"com.contoso\" android:theme=\"@android:style/Theme.Light\" android:turnScreenOn=\"true\" android:uiOptions=\"splitActionBarWhenNarrow\" android:visibleToInstantApps=\"true\" android:windowSoftInputMode=\"stateUnchanged|adjustUnspecified\"";
662+
string expectedOutput = manifestMerger == "legacy" ?
663+
"android:allowEmbedded=\"true\" android:allowTaskReparenting=\"true\" android:alwaysRetainTaskState=\"true\" android:autoRemoveFromRecents=\"true\" android:banner=\"@drawable/icon\" android:clearTaskOnLaunch=\"true\" android:colorMode=\"hdr\" android:configChanges=\"mcc\" android:description=\"@string/app_name\" android:directBootAware=\"true\" android:documentLaunchMode=\"never\" android:enabled=\"true\" android:enableVrMode=\"foo\" android:excludeFromRecents=\"true\" android:exported=\"true\" android:finishOnCloseSystemDialogs=\"true\" android:finishOnTaskLaunch=\"true\" android:hardwareAccelerated=\"true\" android:icon=\"@drawable/icon\" android:immersive=\"true\" android:label=\"TestActivity\" android:launchMode=\"singleTop\" android:lockTaskMode=\"normal\" android:logo=\"@drawable/icon\" android:maxAspectRatio=\"1.2\" android:maxRecents=\"1\" android:multiprocess=\"true\" android:name=\"com.contoso.TestActivity\" android:noHistory=\"true\" android:parentActivityName=\"unnamedproject.unnamedproject.MainActivity\" android:permission=\"com.contoso.permission.TEST_ACTIVITY\" android:persistableMode=\"persistNever\" android:process=\"com.contoso.process.testactivity_process\" android:recreateOnConfigChanges=\"mcc\" android:relinquishTaskIdentity=\"true\" android:resizeableActivity=\"true\" android:resumeWhilePausing=\"true\" android:rotationAnimation=\"crossfade\" android:roundIcon=\"@drawable/icon\" android:screenOrientation=\"portrait\" android:showForAllUsers=\"true\" android:showOnLockScreen=\"true\" android:showWhenLocked=\"true\" android:singleUser=\"true\" android:stateNotNeeded=\"true\" android:supportsPictureInPicture=\"true\" android:taskAffinity=\"com.contoso\" android:theme=\"@android:style/Theme.Light\" android:turnScreenOn=\"true\" android:uiOptions=\"splitActionBarWhenNarrow\" android:visibleToInstantApps=\"true\" android:windowSoftInputMode=\"stateUnchanged|adjustUnspecified\"" :
664+
"android:name=\"com.contoso.TestActivity\" android:allowEmbedded=\"true\" android:allowTaskReparenting=\"true\" android:alwaysRetainTaskState=\"true\" android:autoRemoveFromRecents=\"true\" android:banner=\"@drawable/icon\" android:clearTaskOnLaunch=\"true\" android:colorMode=\"hdr\" android:configChanges=\"mcc\" android:description=\"@string/app_name\" android:directBootAware=\"true\" android:documentLaunchMode=\"never\" android:enableVrMode=\"foo\" android:enabled=\"true\" android:excludeFromRecents=\"true\" android:exported=\"true\" android:finishOnCloseSystemDialogs=\"true\" android:finishOnTaskLaunch=\"true\" android:hardwareAccelerated=\"true\" android:icon=\"@drawable/icon\" android:immersive=\"true\" android:label=\"TestActivity\" android:launchMode=\"singleTop\" android:lockTaskMode=\"normal\" android:logo=\"@drawable/icon\" android:maxAspectRatio=\"1.2\" android:maxRecents=\"1\" android:multiprocess=\"true\" android:noHistory=\"true\" android:parentActivityName=\"unnamedproject.unnamedproject.MainActivity\" android:permission=\"com.contoso.permission.TEST_ACTIVITY\" android:persistableMode=\"persistNever\" android:process=\"com.contoso.process.testactivity_process\" android:recreateOnConfigChanges=\"mcc\" android:relinquishTaskIdentity=\"true\" android:resizeableActivity=\"true\" android:resumeWhilePausing=\"true\" android:rotationAnimation=\"crossfade\" android:roundIcon=\"@drawable/icon\" android:screenOrientation=\"portrait\" android:showForAllUsers=\"true\" android:showOnLockScreen=\"true\" android:showWhenLocked=\"true\" android:singleUser=\"true\" android:stateNotNeeded=\"true\" android:supportsPictureInPicture=\"true\" android:taskAffinity=\"com.contoso\" android:theme=\"@android:style/Theme.Light\" android:turnScreenOn=\"true\" android:uiOptions=\"splitActionBarWhenNarrow\" android:visibleToInstantApps=\"true\" android:windowSoftInputMode=\"stateUnchanged|adjustUnspecified\"";
663665

664-
var proj = new XamarinAndroidApplicationProject ();
666+
var proj = new XamarinAndroidApplicationProject {
667+
ManifestMerger = manifestMerger,
668+
};
665669

666670
proj.Sources.Add (new BuildItem.Source ("TestActivity.cs") {
667671
TextContent = () => @"using Android.App;
@@ -737,11 +741,15 @@ class TestActivity : Activity { }"
737741
}
738742

739743
[Test]
740-
public void AllServiceAttributeProperties ()
744+
public void AllServiceAttributeProperties ([Values ("legacy", "manifestmerger.jar")] string manifestMerger)
741745
{
742-
const string expectedOutput = "android:name=\"com.contoso.TestActivity\" android:directBootAware=\"true\" android:enabled=\"true\" android:exported=\"true\" android:foregroundServiceType=\"connectedDevice\" android:icon=\"@drawable/icon\" android:isolatedProcess=\"true\" android:label=\"TestActivity\" android:permission=\"com.contoso.permission.TEST_ACTIVITY\" android:process=\"com.contoso.process.testactivity_process\" android:roundIcon=\"@drawable/icon\"";
746+
string expectedOutput = manifestMerger == "legacy" ?
747+
"android:directBootAware=\"true\" android:enabled=\"true\" android:exported=\"true\" android:foregroundServiceType=\"connectedDevice\" android:icon=\"@drawable/icon\" android:isolatedProcess=\"true\" android:label=\"TestActivity\" android:name=\"com.contoso.TestActivity\" android:permission=\"com.contoso.permission.TEST_ACTIVITY\" android:process=\"com.contoso.process.testactivity_process\" android:roundIcon=\"@drawable/icon\"" :
748+
"android:name=\"com.contoso.TestActivity\" android:directBootAware=\"true\" android:enabled=\"true\" android:exported=\"true\" android:foregroundServiceType=\"connectedDevice\" android:icon=\"@drawable/icon\" android:isolatedProcess=\"true\" android:label=\"TestActivity\" android:permission=\"com.contoso.permission.TEST_ACTIVITY\" android:process=\"com.contoso.process.testactivity_process\" android:roundIcon=\"@drawable/icon\"";
743749

744-
var proj = new XamarinAndroidApplicationProject ();
750+
var proj = new XamarinAndroidApplicationProject {
751+
ManifestMerger = manifestMerger
752+
};
745753

746754
proj.Sources.Add (new BuildItem.Source ("TestActivity.cs") {
747755
TextContent = () => @"using Android.App;

src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Android/KnownProperties.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ public static class KnownProperties
2020
public const string EnableProguard = "EnableProguard";
2121
public const string AndroidEnableDesugar = "AndroidEnableDesugar";
2222
public const string AndroidDexTool = "AndroidDexTool";
23+
public const string AndroidManifestMerger = "AndroidManifestMerger";
2324
public const string AndroidLinkTool = "AndroidLinkTool";
2425
public const string UseJackAndJill = "UseJackAndJill";
2526
public const string AotAssemblies = "AotAssemblies";

src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Android/XamarinAndroidApplicationProject.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,11 @@ public string DexTool {
111111
set { SetProperty (KnownProperties.AndroidDexTool, value); }
112112
}
113113

114+
public string ManifestMerger {
115+
get { return GetProperty (KnownProperties.AndroidManifestMerger); }
116+
set { SetProperty (KnownProperties.AndroidManifestMerger, value); }
117+
}
118+
114119
public string LinkTool {
115120
get { return GetProperty (KnownProperties.AndroidLinkTool); }
116121
set { SetProperty (KnownProperties.AndroidLinkTool, value); }

src/Xamarin.Android.Build.Tasks/Utilities/ManifestDocument.cs

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ void ReorderActivityAliases (XElement app)
224224
}
225225
}
226226

227-
public IList<string> Merge (List<TypeDefinition> subclasses, string applicationClass, bool embed, string bundledWearApplicationName)
227+
public IList<string> Merge (List<TypeDefinition> subclasses, string applicationClass, bool embed, string bundledWearApplicationName, IEnumerable<string> mergedManifestDocuments)
228228
{
229229
string applicationName = ApplicationName;
230230

@@ -409,6 +409,16 @@ public IList<string> Merge (List<TypeDefinition> subclasses, string applicationC
409409
ReorderActivityAliases (app);
410410
ReorderElements (app);
411411

412+
if (mergedManifestDocuments != null) {
413+
foreach (var mergedManifest in mergedManifestDocuments) {
414+
try {
415+
MergeLibraryManifest (mergedManifest);
416+
} catch (Exception ex) {
417+
log.LogCodedWarning ("XA4302", "Unhandled exception merging `AndroidManifest.xml`: {0}", ex);
418+
}
419+
}
420+
}
421+
412422
return providerNames;
413423

414424
SequencePoint FindSource (IEnumerable<MethodDefinition> methods)
@@ -433,6 +443,29 @@ SequencePoint FindSource (IEnumerable<MethodDefinition> methods)
433443
}
434444
}
435445

446+
// FIXME: our manifest merger is hacky.
447+
// To support complete manifest merger, we will have to implement fairly complicated one, described at
448+
// http://tools.android.com/tech-docs/new-build-system/user-guide/manifest-merger
449+
void MergeLibraryManifest (string mergedManifest)
450+
{
451+
var nsResolver = new XmlNamespaceManager (new NameTable ());
452+
nsResolver.AddNamespace ("android", androidNs.NamespaceName);
453+
var xdoc = XDocument.Load (mergedManifest);
454+
var package = xdoc.Root.Attribute ("package")?.Value ?? string.Empty;
455+
foreach (var top in xdoc.XPathSelectElements ("/manifest/*")) {
456+
var name = top.Attribute (AndroidXmlNamespace.GetName ("name"));
457+
var existing = (name != null) ?
458+
doc.XPathSelectElement (string.Format ("/manifest/{0}[@android:name='{1}']", top.Name.LocalName, name.Value), nsResolver) :
459+
doc.XPathSelectElement (string.Format ("/manifest/{0}", top.Name.LocalName));
460+
if (existing != null)
461+
// if there is existing node with the same android:name, then append contents to existing node.
462+
existing.Add (FixupNameElements (package, top.Nodes ()));
463+
else
464+
// otherwise, just add to the doc.
465+
doc.Root.Add (FixupNameElements (package, new XNode [] { top }));
466+
}
467+
}
468+
436469
public IEnumerable<XElement> ResolveDuplicates (IEnumerable<XElement> elements)
437470
{
438471
foreach (var e in elements)

src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,7 @@ Copyright (C) 2011-2012 Xamarin. All rights reserved.
315315
<AndroidCreatePackagePerAbi Condition=" '$(AndroidCreatePackagePerAbi)' == 'aab' ">False</AndroidCreatePackagePerAbi>
316316
<AndroidApkSigningAlgorithm Condition=" '$(AndroidApkSigningAlgorithm)' == '' ">SHA256withRSA</AndroidApkSigningAlgorithm>
317317
<AndroidApkDigestAlgorithm Condition=" '$(AndroidApkDigestAlgorithm)' == '' ">SHA-256</AndroidApkDigestAlgorithm>
318+
<AndroidManifestMerger Condition=" '$(AndroidManifestMerger)' == '' ">legacy</AndroidManifestMerger>
318319

319320
<!-- Default Java heap size to 1GB (-Xmx1G) if not specified-->
320321
<JavaMaximumHeapSize Condition=" '$(JavaMaximumHeapSize)' == '' ">1G</JavaMaximumHeapSize>
@@ -2052,11 +2053,21 @@ because xbuild doesn't support framework reference assemblies.
20522053
DependsOnTargets="$(_GenerateJavaStubsDependsOnTargets);$(BeforeGenerateAndroidManifest)"
20532054
Inputs="$(MSBuildAllProjects);@(_ResolvedUserMonoAndroidAssemblies);$(_AndroidManifestAbs);$(_AndroidBuildPropertiesCache)"
20542055
Outputs="$(_AndroidStampDirectory)_GenerateJavaStubs.stamp">
2056+
2057+
<PropertyGroup>
2058+
<_ManifestOutput Condition=" '$(AndroidManifestMerger)' == 'legacy' ">$(IntermediateOutputPath)android\AndroidManifest.xml</_ManifestOutput>
2059+
<_ManifestOutput Condition=" '$(AndroidManifestMerger)' != 'legacy' ">$(IntermediateOutputPath)AndroidManifest.xml</_ManifestOutput>
2060+
</PropertyGroup>
2061+
<ItemGroup>
2062+
<_MergedManifestDocuments Condition=" '$(AndroidManifestMerger)' == 'legacy' " Include="@(ExtractedManifestDocuments)" />
2063+
</ItemGroup>
2064+
20552065
<GenerateJavaStubs
20562066
ResolvedAssemblies="@(_ResolvedAssemblies)"
20572067
ResolvedUserAssemblies="@(_ResolvedUserMonoAndroidAssemblies)"
20582068
ErrorOnCustomJavaObject="$(AndroidErrorOnCustomJavaObject)"
20592069
ManifestTemplate="$(_AndroidManifestAbs)"
2070+
MergedManifestDocuments="@(_MergedManifestDocuments)"
20602071
Debug="$(AndroidIncludeDebugSymbols)"
20612072
MultiDex="$(AndroidEnableMultiDex)"
20622073
NeedsInternet="$(AndroidNeedsInternetPermission)"
@@ -2066,7 +2077,7 @@ because xbuild doesn't support framework reference assemblies.
20662077
PackageName="$(_AndroidPackage)"
20672078
ManifestPlaceholders="$(AndroidManifestPlaceholders)"
20682079
OutputDirectory="$(IntermediateOutputPath)android"
2069-
MergedAndroidManifestOutput="$(IntermediateOutputPath)AndroidManifest.xml"
2080+
MergedAndroidManifestOutput="$(_ManifestOutput)"
20702081
UseSharedRuntime="$(AndroidUseSharedRuntime)"
20712082
EmbedAssemblies="$(EmbedAssembliesIntoApk)"
20722083
BundledWearApplicationName="$(BundledWearApplicationPackageName)"
@@ -2079,13 +2090,14 @@ because xbuild doesn't support framework reference assemblies.
20792090

20802091
<ItemGroup>
20812092
<FileWrites Include="@(_TypeMapAssemblySource)" />
2082-
<FileWrites Include="$(IntermediateOutputPath)AndroidManifest.xml" />
2093+
<FileWrites Include="$(_ManifestOutput)" />
20832094
</ItemGroup>
20842095

20852096
<Touch Files="$(_AndroidStampDirectory)_GenerateJavaStubs.stamp" AlwaysCreate="True" />
20862097
</Target>
20872098

20882099
<Target Name="_ManifestMerger"
2100+
Condition=" '$(AndroidManifestMerger)' == 'manifestmerger.jar' "
20892101
Inputs="$(IntermediateOutputPath)AndroidManifest.xml;@(ExtractedManifestDocuments);$(_AndroidBuildPropertiesCache);$(MSBuildAllProjects)"
20902102
Outputs="$(IntermediateOutputPath)android\AndroidManifest.xml"
20912103
>

0 commit comments

Comments
 (0)