首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >签名APK文件**/*.apk无匹配文件

签名APK文件**/*.apk无匹配文件
EN

Stack Overflow用户
提问于 2021-06-18 17:12:16
回答 1查看 320关注 0票数 0

我正试图在Azure Devops中为我的Xamarin应用程序构建一个Android管道。到目前为止,这就是我所拥有的:

代码语言:javascript
复制
# Xamarin.Android
# Build a Xamarin.Android project.
# Add steps that test, sign, and distribute an app, save build artifacts, and more:
# https://learn.microsoft.com/azure/devops/pipelines/languages/xamarin

trigger:
- master

pool:
  vmImage: 'macos-latest'

# Installing NuGet
steps:
- task: NuGetToolInstaller@1

# Restoring the solutions
- task: NuGetCommand@2
  inputs:
    restoreSolution: '**/*.sln'

- task: NuGetCommand@2
  inputs:
    restoreSolution: 'Student360Mobile.Droid/Student360Mobile.Droid.csproj'

# Building the android app
- task: XamarinAndroid@1
  inputs:
    projectFile: 'Student360Mobile.Droid/Student360Mobile.Droid.csproj'
    configuration: 'Release'
    createAppPackage: true

# Signing the APK
- task: AndroidSigning@3
  inputs:
    apkFiles: '**/*.apk' 
    apksign: true
    apksignerKeystoreFile: 'debug.keystore'
    apksignerKeystorePassword: $(keystore.password)
    apksignerKeystoreAlias: $(keystore.key.alias)
    apksignerKeyPassword: $(keystore.key.password)
    apksignerArguments: --out $(build.artifactStagingDirectory)/app.release.apk
    zipalign: true

# Publishing the APK so we can distribute
- task: PublishBuildArtifacts@1
  inputs:
    pathtoPublish: '$(Build.ArtifactStagingDirectory)'

# Distributing the APK to app store
- task: AppCenterDistribute@3
  inputs:
    serverEndpoint: 'App Center'
    appSlug: 'Tyler-SIS-Mobile/Student360MobileAndroid'
    appFile: '$(Build.ArtifactStagingDirectory)/app.release.apk'
    releaseNotesOption: 'input'
    releaseNotesInput: 'Automated build from App Center'
    destinationType: 'groups'

由于某些原因,我总是收到这样的错误:“没有找到匹配的文件和搜索模式。”我试过很多东西:

将XamarinAndroid@1任务的输出目录设置为特定目录,将appFile设置为该目录,然后将输出目录设置为$(build.artifactStagingDirectory),将appFile设置为$(build.artifactStagingDirectory)/*.apk

  • Keeping输出目录清除,并使用appFile的默认目录,对appFile使用‘**/*..apk’表示appFile.

所有这些都不起作用。几乎没有任何APK被生成。我相信我已经对构建进行了适当的配置,但是我没有在日志中看到APK是在哪里生成的。当然,我也不知道是否会有一个日志。怎么回事?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-06-18 18:51:12

csproj文件被设置为创建AAB文件,而不是APK文件。我专门为Azure管道重写了这种行为,将arg,-p:AndroidPackageFormat=apk添加到Xamarin构建命令中。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/68039104

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档