Forum Xamarin.Android
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

Where do I add AndroidManifestPlaceholders build variables?

I'm trying to create a bindings library from a proprietary SDK (as an .aar) but an integration step is to define a custom build variable in build.gradle.
Because Xamarin doesn't use gradle, how do i go about this step so that the android manifest is populated with my custom build value rather than ${foo}?
It currently throws the error:
Tag <receiver> attribute name has invalid character '{'. (APT0000)

I've looked at the AssemblyInfo properties as well as adding directly to the csproj file:
<AndroidManifestPlaceholders> <foo>FOOBAR</foo> </AndroidManifestPlaceholders>

It looks like the GenerateJavaStubs file does have a property for ManifestPlaceholders but I don't know how to access that.
I want to avoid having to change the reference in the SDK (and avoid those meetings to request permission).

Is there a way to add a custom build variable to a bindings library?



  • NockerNocker Member

    Hi slajalin,

    I know this is an old question but since no one has answered it and it doesn't seem to be documented anywhere that I could find.
    I have just spent the morning searching for this as I've been getting a build error in android.
    I came across 2 sites that refer to it.
    and a correction for it here

    You can the following it in your androif.csproj file.
    <PropertyGroup> <AndroidManifestPlaceholders>appAuthRedirectScheme=''</AndroidManifestPlaceholders> </PropertyGroup>

    The values inside are key=value pairs (not sub xml elements)

    I hope this helps someone else out there.

  • I hope this helps someone else out there.

    It did! Thank you so much for sharing!

Sign In or Register to comment.