Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When uploading apk with the Run wzieba/Firebase-Distribution-Github-Action@v1.3.2 I get the following error #51

Closed
wamaeb opened this issue Nov 2, 2021 · 3 comments

Comments

@wamaeb
Copy link

wamaeb commented Nov 2, 2021

I am trying to upload an apk to firebase using github action. I have commented out the code analysis and tests to make the action run faster so as to try and resolve the issue. I have also tried to upload an app bundle, I get the same response. Here is the github action configuration.
`
name: Deploy app bundle to firebase

on:
push:
branches:
- dev

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: '12.x'
- uses: subosito/flutter-action@v1 # Setup flutter environment
with:
flutter-version: '2.5.0'

  - run: flutter pub get
  - run: flutter pub run build_runner build --delete-conflicting-outputs
  - name: Create env file
    run: |
      cat << EOF > .env
      STAGING_API_BASE_URL="${{ secrets.STAGING_API_BASE_URL }}"
      PROD_API_BASE_URL="${{ secrets.PROD_API_BASE_URL }}"
      BASE_PATH="${{ secrets.BASE_PATH }}"
      EOF
  #      - run: flutter format --set-exit-if-changed #       - run: flutter format --set-exit-if-changed .
  #- run: flutter analyze # Analyze the project's Dart code. This causes job to exit
  #- name: Run flutter analyze
  #  run: |
  #    chmod +x ./flutter_analyze.sh
  #    ./flutter_analyze.sh
  #- run: flutter test # Run Flutter unit tests for the current project.
  - name: Build Gradle
    run: flutter build apk --debug
  - uses: actions/checkout@v2 #This uploads artifacts from your workflow
    with:
      name: debug-apk
      path: build/app/outputs/flutter-apk/app-debug.apk
  - run: ls build/app/outputs/flutter-apk
  - name: Upload artifact to Firebase App Distribution
    uses: wzieba/Firebase-Distribution-Github-Action@v1.3.2
    with:
      appId: ${{secrets.FIREBASE_APP_ID}}
      token: ${{secrets.FIREBASE_TOKEN}}
      groups: testers
      file: build/app/outputs/flutter-apk/app-debug.apk  

`

Screenshot from 2021-11-02 07-40-04

@mateuszkwiecinski
Copy link
Collaborator

mateuszkwiecinski commented Nov 2, 2021

That's just a guess but doesn't the

- uses: actions/checkout@v2 #This uploads artifacts from your workflow

override your output file as it tries to check out app-debug.apk file as git repository? Are you sure you want to check out the repository, not to upload artifact as the comment suggests using actions/upload-artifact action?

Can you try commenting uses: actions/checkout@v2 step and share run: ls build/app/outputs/flutter-apk output?

@wamaeb
Copy link
Author

wamaeb commented Nov 2, 2021

Thank you @mateuszkwiecinski, that was the issue, I used upload action and voila, it worked.

@wamaeb wamaeb closed this as completed Nov 2, 2021
@jmd9019
Copy link

jmd9019 commented Aug 23, 2022

Hi @mateuszkwiecinski We are also getting the same error but on the Ionic project. Can you help??

name: Build Android

on: [push, pull_request]

jobs:
  build:
    name: Build APK
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v1
      - name: set up JDK 1.8
        uses: actions/setup-java@v1
        with:
          java-version: 1.8

      - name: Setup Node.js
        uses: actions/setup-node@v1
        with:
          node-version: 14.x
      - name: Install Capacitor
        run: npm install @capacitor/core

      - name: Install Ionic
        run: npm install -g @ionic/cli

      - name: Install app dependencies
        run: npm install

      - name: Add Android platform
        run: |
          ionic capacitor add android
          ls

      - name: Build Android Dev APK
        run: ionic capacitor build android

      - name: Sync dependencies
        run: npx capacitor sync

      - name: Update plugins
        run: npx jetify

      - name: Build Android Release APK
        run: ionic capacitor build android --release --prod

      - name: Make gradlew executable
        run: chmod +x ./gradlew
      - name: Generate the Android Apk
        working-directory: ./android/
        run: |
          ./gradlew assembleRelease
          cd app/build/outputs/apk/release
          ls
      - name: upload artifact to Firebase App Distribution
        uses: wzieba/Firebase-Distribution-Github-Action@v1
        with:
          appId: ${{secrets.FIREBASE_APP_ID}}
          token: ${{secrets.FIREBASE_TOKEN}}
          groups: via-driver-app
          file: app/build/outputs/apk/release/app-release-unsigned.apk 

Screenshot (83)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants