Project deploy OK in debug mode but failed in release mode.

Haviv Elbsz 1,886 Reputation points
2022-11-08T06:16:54.613+00:00

Hi all

My maui android project deploy OK in debug mode but failed in release mode.

Note: I deploy with adding publish xaml in the project file as follows :

<PropertyGroup Condition="$(TargetFramework.Contains('-android')) and '$(Configuration)' == 'Release'">
<AndroidKeyStore>True</AndroidKeyStore>
<AndroidSigningKeyStore>myapp.keystore</AndroidSigningKeyStore>
<AndroidSigningKeyAlias>MyAppkey</AndroidSigningKeyAlias>
<AndroidSigningKeyPass>1234567</AndroidSigningKeyPass>
<AndroidSigningStorePass>1234567</AndroidSigningStorePass>
</PropertyGroup>

in debug mode its deployed OK.

but deploy in release mode I get this error:

Installation of the app failed.

Note that the pakage files generated in the release folder are Ok
and when installed in my physical device is also OK.

Please can someone help in this.

Thank you.

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
2,866 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,239 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Yonglun Liu (Shanghai Wicresoft Co,.Ltd.) 35,291 Reputation points Microsoft Vendor
    2022-11-08T09:20:32.793+00:00

    Hello,

    If the error message is error : Invalid dex file indices, expecting file 'classes?.dex' but found 'classes2.dex', you could try to change your system language to English and rebuild this project.

    The following resolved thread and documentation should be helpful for you.

    Best Regards,

    Alec Liu.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  2. Haviv Elbsz 1,886 Reputation points
    2022-11-10T10:57:46.603+00:00

    et7.0-android\android\bin\com.companyname.razkmoshed.apks --adb "C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe" --device-id emulator-5554 --allow-downgrade --modules ALL
    The APKs have been extracted in the directory: C:\Users\haviv\AppData\Local\Temp\7905905737790308691
    Installation of the app failed.
    com.android.tools.build.bundletool.model.exceptions.CommandExecutionException: Installation of the app failed.
    at com.android.tools.build.bundletool.model.exceptions.InternalExceptionBuilder.build(InternalExceptionBuilder.java:57)
    at com.android.tools.build.bundletool.device.DdmlibDevice.installApks(DdmlibDevice.java:192)
    at com.android.tools.build.bundletool.commands.InstallApksCommand.lambda$execute$1(InstallApksCommand.java:212)
    at com.android.tools.build.bundletool.device.AdbRunner.run(AdbRunner.java:81)
    at com.android.tools.build.bundletool.device.AdbRunner.run(AdbRunner.java:61)
    at com.android.tools.build.bundletool.commands.InstallApksCommand.execute(InstallApksCommand.java:211)
    at com.android.tools.build.bundletool.BundleToolMain.main(BundleToolMain.java:91)
    at com.android.tools.build.bundletool.BundleToolMain.main(BundleToolMain.java:49)
    Caused by: com.android.ddmlib.InstallException: Failed to commit install session 1159975517 with command cmd package install-commit 1159975517. Error: INSTALL_FAILED_UPDATE_INCOMPATIBLE: Existing package com.companyname.razkmoshed signatures do not match newer version; ignoring!
    at com.android.ddmlib.SplitApkInstallerBase.installCommit(SplitApkInstallerBase.java:99)
    at com.android.ddmlib.SplitApkInstaller.install(SplitApkInstaller.java:85)
    at com.android.ddmlib.internal.DeviceImpl.installPackages(DeviceImpl.java:1166)
    at com.android.tools.build.bundletool.device.DdmlibDevice.installApks(DdmlibDevice.java:176)
    ... 6 more
    Done building project "RazKmoShed.csproj" -- FAILED.
    Build FAILED.
    2>Deployment failed to pixel_5_-_api_33.
    2>Deploy failed

    ==========
    Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

    ==========
    Elapsed 02:50.184 ==========

    ==========
    Deploy: 0 succeeded, 1 failed, 0 skipped ==========

    0 comments No comments