I am trying to create an apk from azure devops pipelines, and the apk gets successfully generated. But when I try to install that apk generated in to the emulator, i am getting this error
Failed to commit install session 762751184 with command cmd package install-commit 762751184. Error: INSTALL_FAILED_INVALID_APK: Failed to extract native libraries, res=-2
When I am trying to install it in the device I am getting,
App not installed as package appears to be invalid
This is the pipeline code,
steps:
- task: android-manifest-version@1
inputs:
sourcePath: 'android/app/src/main/AndroidManifest.xml'
versionCodeOption: 'buildid'
versionCode: '$(Build.BuildId)'
versionName:
printFile: true
- task: Hey24sheep.flutter.flutter-build.FlutterBuild@0
displayName: Build ${{ parameters.appSuffix }} App Bundle
inputs:
target: 'apk'
projectDirectory: '$(Build.SourcesDirectory)'
buildFlavour: '${{ parameters.appSuffix }}'
entryPoint: ${{ parameters.flavorEntryPoint }}
- task: DownloadSecureFile@1
name: keystore
displayName: Download keystore securely
inputs:
secureFile: ${{ parameters.keyStoreFile }}
- task: AndroidSigning@3
displayName: 'Signing and aligning APK file(s) **/*.apk'
inputs:
apkFiles: '**/*.apk'
zipalign: true
apksign: true
apksignerKeystoreFile: ${{ parameters.keyStoreFile }}
apksignerKeystorePassword: ${{ parameters.keyStorePassword }}
apksignerKeystoreAlias: ${{ parameters.keyAlias }}
apksignerKeyPassword: ${{ parameters.keyPassword }}
- task: CopyFiles@2
displayName: 'Copy Files to: $(build.artifactstagingdirectory)'
inputs:
SourceFolder: '$(system.defaultworkingdirectory)'
Contents: '**/*.apk'
TargetFolder: '$(build.artifactstagingdirectory)'
FlattenFolders: true
condition: succeededOrFailed()
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: drop'
inputs:
PathtoPublish: '$(build.artifactstagingdirectory)'
But when i add
android:extractNativeLibs="true"
to my android manifest then the application gets installed without any issue(in both emulator and device). But I want to keep android:extractNativeLibs=false so it would be really preferable if I could change from the pipeline code and make an executable apk. Any suggestions to make this work will be greatly appreciated.