Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fastlane + Github Actions: Couldn't find gradlew at path

I'm trying to implement a CI/CD workflow for Flutter using Github Actions and Fastlane. But, when the lane is executing throws the following error:

enter image description here

I create the Fastlane folder inside the android folder. Like the image enter image description here

This is the content of my Fastfile:

update_fastlane

default_platform(:android)

platform :android do
  desc "Deploy to closed beta track"
  lane :closed_beta do
    begin
      gradle(task: "clean")
      gradle(
        task: "bundle",
        build_type: 'Release'
      )
      upload_to_play_store(
        track: 'Closed beta',
        aab: '../build/app/outputs/bundle/release/app-release.aab',
        skip_upload_metadata: true,
        skip_upload_images: true,
        skip_upload_screenshots: true,
        release_status: "draft",
        version_code: flutter_version()["version_code"],
      )
    end
  end
end

And my GitHub action workflow that allows to make the build and deployment is like below. The Run Fastlane step is the error point

name: Continuous Delivery to Play Store

on:
  push:
    branches:
      - "v*"

jobs:
  # Continuous integration
  build_android:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v2
      - name: Setup Java
        uses: actions/setup-java@v1
        with:
          java-version: 12.x
      - name: Decrypt Android keys
        run: sh ./.github/scripts/decrypt_android_keys.sh
        env:
          ANDROID_KEYS_SECRET_PASSPHRASE: ${{ secrets.ANDROID_KEYS_SECRET_PASSPHRASE }}
      - name: Setup Flutter
        uses: subosito/flutter-action@v1
        with:
          flutter-version: 1.22.5
      - name: Install Flutter dependencies
        run: flutter pub get
        # Add build runner commands here if you have any
      - name: Format files
        run: flutter format --set-exit-if-changed .
      - name: Analyze files
        run: flutter analyze .
      - name: Run the tests
        run: flutter test
      - name: Build the APK
        run: flutter build apk
      - name: Upload artifact to Github
        uses: actions/upload-artifact@v1
        with:
          name: release-apk
          path: build/app/outputs/apk/release/app-release.apk
  # Continuous delivery
  deploy_android:
    runs-on: ubuntu-latest
    needs: [build_android]
    steps:
      - name: Checkout code
        uses: actions/checkout@v2
      - name: Setup Java
        uses: actions/setup-java@v1
        with:
          java-version: 12.x
      - name: Decrypt Android keys
        run: sh ./.github/scripts/decrypt_android_keys.sh
        env:
          ANDROID_KEYS_SECRET_PASSPHRASE: ${{ secrets.ANDROID_KEYS_SECRET_PASSPHRASE }}
      - name: Setup Flutter
        uses: subosito/flutter-action@v1
        with:
          flutter-version: 1.22.5
      - name: Install Flutter dependencies
        run: flutter pub get
      - name: Build app bundle
        run: flutter build appbundle
      - uses: actions/checkout@v2
      - uses: ruby/setup-ruby@v1
        with:
          ruby-version: 2.6
          bundler-cache: true
      - name: Check file existence
        run: echo find . -name "gradlew"
      - uses: maierj/[email protected]
        with:
          lane: closed_beta
          subdirectory: android

like image 694
Enzo Lizama Avatar asked Nov 04 '25 02:11

Enzo Lizama


1 Answers

Run flutter build appbundle -v before other tasks in a lane like this

lane :beta do
  sh "flutter build appbundle -v" <- Add this
  upload_to_play_store(
    track: 'beta',
    aab: '../build/app/outputs/bundle/release/app-release.aab',
    json_key_data: ENV['PLAY_STORE_CONFIG_JSON'],
    )
end```
like image 154
Gwamaka Charles Avatar answered Nov 06 '25 16:11

Gwamaka Charles



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!