Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/Xamarin.Android.Build.Tasks/Tasks/Aapt2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,8 @@ static string GetErrorCode (string message)
Tuple.Create ("APT2262", "unexpected element <activity> found in <manifest>"),
Tuple.Create ("APT2263", "found in <manifest>"), // unexpected element <xxxxx> found in <manifest>
Tuple.Create ("APT2264", "The system cannot find the file specified. (2)"), // Windows Long Path error from aapt2
Tuple.Create ("APT2265", "The system cannot find the file specified. (2)") // Windows non-ASCII characters error from aapt2
Tuple.Create ("APT2265", "The system cannot find the file specified. (2)"), // Windows non-ASCII characters error from aapt2
Tuple.Create ("APT2266", "in <data> tag has value of") // error: attribute ‘android:path’ in <data> tag has value of ‘code/fooauth://com.foo.foo, it must start with a leading slash ‘/’.
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,32 @@ public void ApplicationVersionTests (string applicationVersion, bool seperateApk
}
}

[Test]
public void ManifestDataPathError ()
{
var proj = new XamarinAndroidApplicationProject () {
IsRelease = true,
};
var s = proj.AndroidManifest.Replace ("</application>", @"<activity android:name=""net.openid.appauth.RedirectUriReceiverActivity"" android:exported=""true"">
<intent-filter>
<action android:name=""android.intent.action.VIEW""/>
<category android:name=""android.intent.category.DEFAULT""/>
<category android:name=""android.intent.category.BROWSABLE""/>
<data android:path=""code/buildproauth://com.hyphensolutions.buildpro"" android:scheme=""msauth""/>
<data android:path=""callback"" android:scheme=""buildproauth""/>
</intent-filter>
</activity>
</application>");
proj.AndroidManifest = s;
using (var builder = CreateApkBuilder (Path.Combine ("temp", TestContext.CurrentContext.Test.Name))) {
builder.ThrowOnBuildFailure = false;
Assert.IsFalse (builder.Build (proj), "Build should have failed.");
var messages = builder.LastBuildOutput.SkipWhile (x => !x.StartsWith ("Build FAILED.", StringComparison.Ordinal));
string error = messages.FirstOrDefault (x => x.Contains ("error APT2266:"));
Assert.IsNotNull (error, "Warning should be APT2266");
}
}

[Test]
public void ManifestPlaceholders ([Values ("legacy", "manifestmerger.jar")] string manifestMerger)
{
Expand Down