3
votes

I am getting this error when I try to build the app on App Center from Microsoft.

Errors in packages.config projects https://{myDomainOnVSTS}.com/_packaging/CustomNugetPackages/nuget/v3/index.json: Unable to load the service index for source https://{myDomainOnVSTS}.pkgs.visualstudio.com/_packaging/CustomNugetPackages/nuget/v3/index.json. The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters. https://api.nuget.org/v3/index.json: Package 'CalendarWithNoDeselect.1.0.0' is not found on source

The strange part is that, the app builds fine on VSTS and on my local machine using the private feed.

Here is the Nuget.Config file

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <add key="CustomNugetPackages" value="https://{myDomainOnVSTS}.pkgs.visualstudio.com/_packaging/CustomNugetPackages/nuget/v3/index.json" />
  </packageSources>
  <activePackageSource>
    <add key="All" value="(Aggregate source)" />
  </activePackageSource>
 <packageSourceCredentials>
    <CustomNugetPackages>
      <add key="Username" value="$USER_VARIABLE" />
      <add key="Password" value="$PASSWORD_VARIABLE" />
    </CustomNugetPackages> 
  </packageSourceCredentials>
</configuration>

Can someone Kindly help me with this issue.

EDIT1: The issue is with Environment Variables since when I don't used them the package is restored as the following.

2

2 Answers

2
votes

Hey your issue with the environment variables seems to be because of syntax error in the way you've configured them in the Nuget.Config file. Try editing them to:

<add key="Username" value="%USER_VARIABLE%" />
<add key="Password" value="%PASSWORD_VARIABLE%" />

Just for reference - https://docs.microsoft.com/en-us/appcenter/build/custom/variables/

1
votes

I still had this error without using any variables. My problem was I was using a plain text password and it was expecting base 64 encoded. Maybe that's obvious to everyone else but it wasn't to me. I switched to using an API key for the user instead.

Alternatively, there's a cleartextpassword that you can use, documentation. But you know, you really shouldn't be using these kinds of things. =D