Fixing "No template with an identifier of 'xamarinandroid' could be found" error in Azure DevOps
This error occurs when trying to create a new YAML pipeline in Azure DevOps, typically when the system incorrectly identifies your repository as containing Xamarin.Android code and fails to provide appropriate template options.
Problem Overview
When attempting to create a new pipeline in Azure DevOps, users encounter a blocking error:
No template with an identifier of 'xamarinandroid' could be found
This issue typically happens regardless of your actual project type, with no option to proceed through the pipeline creation wizard.
Root Cause
Azure DevOps attempts to auto-detect your project type by scanning repository files. When this detection fails or misidentifies your project, the pipeline creation UI cannot provide appropriate templates, resulting in this error.
Solutions
Solution 1: Use Classic Pipeline Editor
The simplest workaround is to use the classic pipeline editor instead of the YAML pipeline creation wizard:
- Navigate to your Azure DevOps project
- Go to Pipelines → Pipelines
- Click "Create Pipeline"
- Instead of using the "Azure Repos Git" option, choose "Use the classic editor" in the top right corner
- Follow the classic pipeline creation process
INFO
The classic editor provides a visual interface and doesn't rely on the same template detection mechanism that causes the xamarinandroid error.
Solution 2: Add a Valid Azure Pipelines YAML File
Before creating the pipeline, ensure your repository has a valid azure-pipelines.yml
file at the root:
# Basic example (customize for your needs)
trigger:
- main
pool:
vmImage: 'ubuntu-latest'
steps:
- script: echo "Hello, world!"
displayName: 'Run a one-line script'
When Azure DevOps detects this file, it will bypass the template selection step and allow you to create the pipeline directly.
Solution 3: Use Azure DevOps CLI
Create the pipeline programmatically using the Azure DevOps CLI:
- Install the Azure CLI and Azure DevOps extension:
az extension add --name azure-devops
- Create your pipeline:
az pipelines create --name 'YourPipelineName' \
--description 'Description of your pipeline' \
--repository YourRepoName \
--branch main \
--repository-type tfsgit \
--yaml-path 'azure-pipelines.yml'
Solution 4: Use REST API Directly
For advanced users, create the pipeline using Azure DevOps REST API:
# Set your variables
ORG="your-organization"
PROJECT="your-project"
PAT="your-personal-access-token"
REPO_ID="your-repository-id"
REPO_NAME="your-repository-name"
# Create pipeline via REST API
curl -X POST "https://dev.azure.com/$ORG/$PROJECT/_apis/pipelines?api-version=7.1" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $PAT" \
-d '{
"folder": null,
"name": "pipeline-name",
"configuration": {
"type": "yaml",
"path": "azure-pipelines.yml",
"repository": {
"id": "'$REPO_ID'",
"name": "'$REPO_NAME'",
"type": "azureReposGit"
}
}
}'
@token = your-personal-access-token
@organization = your-organization
@project = your-project
@repositoryName = your-repository-name
@repositoryId = your-repository-id
POST https://dev.azure.com/{{organization}}/{{project}}/_apis/pipelines/?api-version=7.1
Content-Type: application/json
Authorization: Bearer {{token}}
{
"folder": null,
"name": "pipeline-name",
"configuration": {
"type": "yaml",
"path": "azure-pipelines.yml",
"repository": {
"id": "{{repositoryId}}",
"name": "{{repositoryName}}",
"type": "azureReposGit"
}
}
}
WARNING
To find your repository ID, navigate to Project Settings → Repositories → Select your repository. The ID appears in the browser URL as a GUID.
Temporary Workarounds
If you need immediate pipeline creation but want to preserve your existing solution file structure:
- Temporarily remove solution files: Rename or move your
.sln
file before pipeline creation, then restore it - Borrow a pipeline file: Temporarily use a working
azure-pipelines.yml
from another repository
Best Practices
To avoid this issue in the future:
- Always maintain a valid
azure-pipelines.yml
in your repository root - Consider using pipeline templates for consistent CI/CD configuration across projects
- Document your pipeline setup process for team members
TIP
Microsoft is aware of this issue and is working on a fix. The solutions provided are workarounds until the UI is updated.
Next Steps
After creating your pipeline:
- Verify it runs successfully
- Configure appropriate triggers and branch policies
- Set up required environment variables and secrets
- Add necessary approval gates for production deployments
Following these steps will help you overcome the xamarinandroid template error and successfully create pipelines in Azure DevOps.