Repository: flutter
Issue: Updating apk in Firebase App-Distribution using Automation Tools requires re-install
Labels: platform-android,tool,a: release,P3,team-android,triaged-android

### Is there an existing issue for this?

- [x] I have searched the [existing issues](https://github.com/flutter/flutter/issues)
- [x] I have read the [guide to filing a bug](https://flutter.dev/docs/resources/bug-reports)

### Problem
I am currently working on a Flutter project. I have set up a GitHub Action pipeline where the Flutter App is built for Android. After the build, the apk is uploaded to Firebase App-Distribution. These steps work fine but when a new app version is in the App-Tester and I want to install it, I have to uninstall the current app on my device before I can install the new one.
https://stackoverflow.com/questions/77144066/firebase-app-distribution-app-cannot-be-updated-must-be-uninstalled-before-inst

### Steps to reproduce

1. Create a Flutter project
2. Create a GitHub Action pipeline with the sample code
3. Setup Firebase 
4. Run the Pipeline

### Expected results

When I install a new .apk with a new version which was uploaded to Firebase App-Distribution then I should update the existing one. 

This works when I build the app locally in my terminal. So I run `flutter build apk --release --build-name 1.0.<Number>` and when I upload the result to Firebase App-Distribution then I updates the old app.

### Actual results

When Github Action uploads a new App to Firebase App-Distribution and I want to install it I get a prompt that I need to deinstall the existing app.

### Code sample

<details><summary>Code sample</summary>

```yaml
...

- name: Install Flutter ${{ env.flutterVersion }}
  uses: subosito/flutter-action@v2
  with:
    flutter-version: "${{ env.flutterVersion }}"
    channel: "stable"

...

- name: Install dependencies
  run: flutter pub get

- name: Flutter build apk
  run: flutter build apk --release --build-name 1.0.${{ env.NEW_BUILD_VERSION }}

...

- name: Upload apk to Firebase
  uses: ./.github/actions/firebase_app_distribution
  with:
    path: build/app/outputs/flutter-apk/app-release.apk
    app: ${{ secrets.APP_ID }}
    serviceAccountJSON: ${{ secrets.GOOGLE_SERVICE_JSON }}
    group: internal-testers
```

</details>

### Flutter Doctor output

<details><summary>Doctor output</summary>

```console
[✓] Flutter (Channel stable, 3.13.1, on Ubuntu 22.04.3 LTS 6.2.0-1012-azure, locale C.UTF-8)
    • Flutter version 3.13.1 on channel stable at /opt/hostedtoolcache/flutter/stable-3.13.1-x64
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision e1e47221e8 (5 weeks ago), 2023-08-22 21:43:18 -0700
    • Engine revision b20183e040
    • Dart version 3.1.0
    • DevTools version 2.25.0

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /usr/local/lib/android/sdk
    • Platform android-34, build-tools 34.0.0
    • ANDROID_HOME = /usr/local/lib/android/sdk
    • ANDROID_SDK_ROOT = /usr/local/lib/android/sdk
    • Java binary at: /usr/lib/jvm/temurin-11-jdk-amd64/bin/java
    • Java version OpenJDK Runtime Environment Temurin-11.0.20.1+1 (build 11.0.20.1+1)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • Chrome at google-chrome

[✗] Linux toolchain - develop for Linux desktop
    • Ubuntu clang version 14.0.0-1ubuntu1.1
    • cmake version 3.27.6
    ✗ ninja is required for Linux development.
      It is likely available from your distribution (e.g.: apt install ninja-build), or can be downloaded from https://github.com/ninja-build/ninja/releases
    • pkg-config version 0.29.2
    ✗ GTK 3.0 development libraries are required for Linux development.
      They are likely available from your distribution (e.g.: apt install libgtk-3-dev)

[!] Android Studio (not installed)
    • Android Studio not found; download from https://developer.android.com/studio/index.html
      (or visit https://flutter.dev/docs/get-started/install/linux#android-setup for detailed instructions).

[✓] Connected device (2 available)
    • Linux (desktop) • linux  • linux-x64      • Ubuntu 22.04.3 LTS 6.2.0-1012-azure
    • Chrome (web)    • chrome • web-javascript • Google Chrome 117.0.5938.92

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 2 categories.
```

</details>