Ошибка «Файл AndroidManifest не существует» в конвейере azure - PullRequest
0 голосов
/ 26 марта 2020

Я пытаюсь использовать azure devops для настройки автомата c build для моего приложения xamarin android. Я использовал Xamarin по умолчанию. Android шаблон сборки

# Xamarin.Android
# Build a Xamarin.Android project.
# Add steps that test, sign, and distribute an app, save build artifacts, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/xamarin

trigger:
- master

pool:
  vmImage: 'windows-latest'
  demands:
  - MSBuild
  - Xamarin.Android
  - JDK

variables:
  buildConfiguration: 'Release'
  outputDirectory: '$(build.binariesDirectory)/$(buildConfiguration)'

steps:
- task: NuGetToolInstaller@1

- task: NuGetCommand@2
  inputs:
    restoreSolution: '**/*.sln'

- task: XamarinAndroid@1
  inputs:
    projectFile: '**/*droid*.csproj'
    outputDirectory: '$(outputDirectory)'
    configuration: '$(buildConfiguration)'

Это дает мне ошибку при сборке

2020-03-26T09:12:32.2752297Z Generating MSBuild file d:\a\1\s\XamarinFormsTry\XamarinFormsTry.Android\obj\XamarinFormsTry.Android.csproj.nuget.g.props.
2020-03-26T09:12:32.2752837Z Generating MSBuild file d:\a\1\s\XamarinFormsTry\XamarinFormsTry.Android\obj\XamarinFormsTry.Android.csproj.nuget.g.targets.
2020-03-26T09:12:32.2753312Z Writing assets file to disk. Path: d:\a\1\s\XamarinFormsTryStandard\obj\project.assets.json
2020-03-26T09:12:32.2753766Z Writing assets file to disk. Path: d:\a\1\s\XamarinFormsTry\XamarinFormsTry.Android\obj\project.assets.json
2020-03-26T09:12:32.2754231Z Writing cache file to disk. Path: d:\a\1\s\XamarinFormsTryStandard\obj\project.nuget.cache
2020-03-26T09:12:32.2754658Z Restore completed in 47.34 sec for d:\a\1\s\XamarinFormsTryStandard\XamarinFormsTry.csproj.
2020-03-26T09:12:32.2755110Z Writing cache file to disk. Path: d:\a\1\s\XamarinFormsTry\XamarinFormsTry.Android\obj\project.nuget.cache
2020-03-26T09:12:32.2755614Z Restore completed in 47.57 sec for d:\a\1\s\XamarinFormsTry\XamarinFormsTry.Android\XamarinFormsTry.Android.csproj.
2020-03-26T09:12:32.2755964Z 
2020-03-26T09:12:32.2756107Z NuGet Config files used:
2020-03-26T09:12:32.2756322Z     d:\a\1\Nuget\tempNuGet_19.config
2020-03-26T09:12:32.2756470Z 
2020-03-26T09:12:32.2756630Z Feeds used:
2020-03-26T09:12:32.2756825Z     https://api.nuget.org/v3/index.json
2020-03-26T09:12:32.2756980Z 
2020-03-26T09:12:32.2757113Z Installed:
2020-03-26T09:12:32.2757302Z     1 package(s) to packages.config projects
2020-03-26T09:12:32.2757610Z     13 package(s) to d:\a\1\s\XamarinFormsTryStandard\XamarinFormsTry.csproj
2020-03-26T09:12:32.2758035Z     169 package(s) to d:\a\1\s\XamarinFormsTry\XamarinFormsTry.Android\XamarinFormsTry.Android.csproj
2020-03-26T09:12:32.2773237Z ##[section]Finishing: NuGetCommand
2020-03-26T09:12:32.2807591Z ##[section]Starting: XamarinAndroid
2020-03-26T09:12:32.2947509Z ==============================================================================
2020-03-26T09:12:32.2947864Z Task         : Xamarin.Android
2020-03-26T09:12:32.2948151Z Description  : Build an Android app with Xamarin
2020-03-26T09:12:32.2948500Z Version      : 1.166.0
2020-03-26T09:12:32.2948736Z Author       : Microsoft Corporation
2020-03-26T09:12:32.2949074Z Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/build/xamarin-android
2020-03-26T09:12:32.2949464Z ==============================================================================
2020-03-26T09:12:34.4220559Z ##[command]"D:\a\_tasks\XamarinAndroid_27edd013-36fd-43aa-96a3-7d73e1e35285\1.166.0\ps_modules\MSBuildHelpers\vswhere.exe" -version [15.0,16.0) -latest -format json
2020-03-26T09:12:34.4661105Z ##[command]"D:\a\_tasks\XamarinAndroid_27edd013-36fd-43aa-96a3-7d73e1e35285\1.166.0\ps_modules\MSBuildHelpers\vswhere.exe" -version [15.0,16.0) -products Microsoft.VisualStudio.Product.BuildTools -latest -format json
2020-03-26T09:12:34.5348014Z ##[command]"D:\a\_tasks\XamarinAndroid_27edd013-36fd-43aa-96a3-7d73e1e35285\1.166.0\ps_modules\MSBuildHelpers\vswhere.exe" -version [16.0,17.0) -latest -format json
2020-03-26T09:12:34.7801263Z ##[warning]Unable to find MSBuild version '15.0' for architecture 'x86'. Falling back to version '16.0'.
2020-03-26T09:12:34.8662182Z ##[command]"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\msbuild.exe" "d:\a\1\s\MigrationBackup\b36c964d\XamarinFormsTry.Android\XamarinFormsTry.Android.csproj" /nologo /nr:false /dl:CentralLogger,"D:\a\_tasks\XamarinAndroid_27edd013-36fd-43aa-96a3-7d73e1e35285\1.166.0\ps_modules\MSBuildHelpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll";"RootDetailId=b1e39c46-8802-47e2-b5ab-4bec5fda9203|SolutionDir=d:\a\1\s\MigrationBackup\b36c964d\XamarinFormsTry.Android"*ForwardingLogger,"D:\a\_tasks\XamarinAndroid_27edd013-36fd-43aa-96a3-7d73e1e35285\1.166.0\ps_modules\MSBuildHelpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll"  /p:configuration="Release" /p:_MSDeployUserAgent="VSTS_efe7950b-580b-467b-8a98-19b6043eee2e_build_1_0" /t:PackageForAndroid /p:OutputPath="d:\a\1\b/Release"
2020-03-26T09:12:34.9957257Z Build started 3/26/2020 9:12:34 AM.
2020-03-26T09:12:35.2054286Z Project "d:\a\1\s\MigrationBackup\b36c964d\XamarinFormsTry.Android\XamarinFormsTry.Android.csproj" on node 1 (PackageForAndroid target(s)).
2020-03-26T09:12:35.2062946Z _CleanIntermediateIfNuGetsChange:
2020-03-26T09:12:35.2066241Z   Creating directory "obj\Release\90\stamp\".
2020-03-26T09:12:35.2070062Z   Creating "obj\Release\90\stamp\_CleanIntermediateIfNuGetsChange.stamp" because "AlwaysCreate" was specified.
2020-03-26T09:12:35.8847743Z _ResolveSdks:
2020-03-26T09:12:35.8850229Z   Found Java SDK version 1.8.0.
2020-03-26T09:12:36.3595388Z   Found Java SDK version 1.8.0.
2020-03-26T09:12:36.8133556Z ##[error]C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(752,2): Error : AndroidManifest file does not exist
2020-03-26T09:12:36.8136850Z C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(752,2): error : AndroidManifest file does not exist [d:\a\1\s\MigrationBackup\b36c964d\XamarinFormsTry.Android\XamarinFormsTry.Android.csproj]
2020-03-26T09:12:36.8167951Z Done Building Project "d:\a\1\s\MigrationBackup\b36c964d\XamarinFormsTry.Android\XamarinFormsTry.Android.csproj" (PackageForAndroid target(s)) -- FAILED.
2020-03-26T09:12:36.8205677Z 
2020-03-26T09:12:36.8208249Z Build FAILED.
2020-03-26T09:12:36.8258005Z 
2020-03-26T09:12:36.8270145Z "d:\a\1\s\MigrationBackup\b36c964d\XamarinFormsTry.Android\XamarinFormsTry.Android.csproj" (PackageForAndroid target) (1) ->
2020-03-26T09:12:36.8274063Z (_ValidateAndroidPackageProperties target) -> 
2020-03-26T09:12:36.8277799Z   C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(752,2): error : AndroidManifest file does not exist [d:\a\1\s\MigrationBackup\b36c964d\XamarinFormsTry.Android\XamarinFormsTry.Android.csproj]
2020-03-26T09:12:36.8279308Z 
2020-03-26T09:12:36.8281145Z     0 Warning(s)
2020-03-26T09:12:36.8284488Z     1 Error(s)
2020-03-26T09:12:36.8286684Z 
2020-03-26T09:12:36.8290589Z Time Elapsed 00:00:01.83
2020-03-26T09:12:36.9547149Z ##[error]Process 'msbuild.exe' exited with code '1'.
2020-03-26T09:12:37.1765717Z ##[section]Finishing: XamarinAndroid
2020-03-26T09:12:44.6607030Z ##[section]Starting: Checkout XamarinFormsTry@master to s
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(752,2): Error : AndroidManifest file does not exist 
Process 'msbuild.exe' exited with code '1'. 

Я знаю, что мой проект собирается так хорошо, как я могу создайте его на моем ma c и p c, используя Visual studio for ma c и Visual Studio 2019, и я также использую https://appcenter.ms (Microsoft AppCenter) для аналитики, что также обеспечивает Опция коммитов. Даже это прекрасно работает, используя аналогичный процесс агента сборки.

Я попытался сделать копию AndroidManifest. xml и поместить ее в root, но это тоже не работает.

вот блок конфигурации из файла .proj для Xamarin. Android проект

  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProductVersion>8.0.30703</ProductVersion>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>{C6CD5F2A-47C8-4A53-9729-91C88CEEB870}</ProjectGuid>
    <ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
    <OutputType>Library</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>XamarinFormsTry.Droid</RootNamespace>
    <AssemblyName>XamarinFormsTry.Android</AssemblyName>
    <FileAlignment>512</FileAlignment>
    <AndroidApplication>true</AndroidApplication>
    <AndroidResgenFile>Resources\Resource.Designer.cs</AndroidResgenFile>
    <GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
    <AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
    <TargetFrameworkVersion>v10.0</TargetFrameworkVersion>
    <AndroidStoreUncompressedFileExtensions />
    <MandroidI18n />
    <JavaMaximumHeapSize />
    <JavaOptions />
    <NuGetPackageImportStamp>
    </NuGetPackageImportStamp>
    <AndroidKeyStore>false</AndroidKeyStore>
    <AndroidSigningKeyStore>*******</AndroidSigningKeyStore>
    <AndroidSigningStorePass />
    <AndroidLinkMode>None</AndroidLinkMode>
    <AndroidEnableMultiDex>true</AndroidEnableMultiDex>
  </PropertyGroup>

The AndroidManifest.xml file at relative path in repo

Возможно, это что-то глупое для меня конец, но я не могу найти помощь в Google или разобраться сам.

1 Ответ

0 голосов
/ 30 марта 2020

Так что для любого, кто имеет xamarin.forms. net стандартным способом и проект с подобной ошибкой, вот что исправило это для меня.

исходная линия

# Xamarin.Android
# Build a Xamarin.Android project.
# Add steps that test, sign, and distribute an app, save build artifacts, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/xamarin

trigger:
- master

pool:
  vmImage: 'windows-latest'
  demands:
  - MSBuild
  - Xamarin.Android
  - JDK

variables:
  buildConfiguration: 'Release'
  outputDirectory: '$(build.binariesDirectory)/$(buildConfiguration)'

steps:
- task: NuGetToolInstaller@1

- task: NuGetCommand@2
  inputs:
    restoreSolution: '**/*.sln'

- task: XamarinAndroid@1
  inputs:
    projectFile: '**/*droid*.csproj'
    outputDirectory: '$(outputDirectory)'
    configuration: '$(buildConfiguration)'

фиксированный конвейер (да, ошибка была в конвейере)

# Xamarin.Android
# Build a Xamarin.Android project.
# Add steps that test, sign, and distribute an app, save build artifacts, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/xamarin

trigger:
- master

pool:
  vmImage: 'windows-latest'
  demands:
  - MSBuild
  - Xamarin.Android
  - JDK

variables:
  buildConfiguration: 'Release'
  outputDirectory: '$(build.binariesDirectory)/$(buildConfiguration)'

steps:
- task: NuGetToolInstaller@1

- task: NuGetCommand@2
  inputs:
    restoreSolution: '**/*.sln'

- task: XamarinAndroid@1
  inputs:
    projectFile: 'XamarinFormsTry/XamarinFormsTry.Android/XamarinFormsTry.Android.csproj'
    outputDirectory: '$(outputDirectory)'
    configuration: '$(buildConfiguration)'

Так что это не значит, что он не нашел файл AndroidManifest, он не нашел нужный файл proj. изменение projectFile: '**/*droid*.csproj' на projectFile: 'XamarinFormsTry/XamarinFormsTry.Android/XamarinFormsTry.Android.csproj' работает. Правильный файл proj найден и проект успешно собран. ошибка и журналы немного вводят в заблуждение в этом случае я думаю

...