Akhil George
Akhil George

Reputation: 427

Flutter : Unable to Build APK: Issues with Dependencies and Configuration

Im trying to implement Github Actions to generate apk and ipa files for testing

while running flutter build apk --split-per-abi its work's in my device but in workflow it gives me a error

Error

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':firebase_core'.
> Could not resolve all files for configuration ':firebase_core:classpath'.
   > Could not resolve com.android.tools.build:gradle:8.1.2.
     Required by:
         project :firebase_core
      > Could not resolve com.android.tools.build:gradle:8.1.2.
         > Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/8.1.2/gradle-8.1.2.pom'.
            > Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/8.1.2/gradle-8.1.2.pom'.
               > The server may not support the client's requested TLS protocol versions: (TLSv1.2, TLSv1.3). You may need to configure the client to allow other protocols to be used. See: https://docs.gradle.org/7.5/userguide/build_environment.html#gradle_system_properties
                  > Remote host terminated the handshake
> Failed to notify project evaluation listener.
   > Could not get unknown property 'android' for project ':firebase_core' of type org.gradle.api.Project.
   > Could not get unknown property 'android' for project ':firebase_core' of type org.gradle.api.Project.

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 1m 39s
Running Gradle task 'assembleRelease'...                          102.2s
[!] Gradle threw an error while downloading artifacts from the network.
Retrying Gradle Build: #1, wait time: 100ms
Running Gradle task 'assembleRelease'...                        
You are applying Flutter's app_plugin_loader Gradle plugin imperatively using the apply script method, which is deprecated and will be removed in a future release. Migrate to applying Gradle plugins with the declarative plugins block: https://flutter.dev/to/flutter-gradle-plugin-apply

You are applying Flutter's main Gradle plugin imperatively using the apply script method, which is deprecated and will be removed in a future release. Migrate to applying Gradle plugins with the declarative plugins block: https://flutter.dev/to/flutter-gradle-plugin-apply


FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':flutter_jailbreak_detection'.
> Could not resolve all files for configuration ':flutter_jailbreak_detection:classpath'.
   > Could not resolve com.android.tools.build:gradle:7.3.1.
     Required by:
         project :flutter_jailbreak_detection
      > Could not resolve com.android.tools.build:gradle:7.3.1.
         > Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/7.3.1/gradle-7.3.1.pom'.
            > Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/7.3.1/gradle-7.3.1.pom'.
               > The server may not support the client's requested TLS protocol versions: (TLSv1.2, TLSv1.3). You may need to configure the client to allow other protocols to be used. See: https://docs.gradle.org/7.5/userguide/build_environment.html#gradle_system_properties
                  > Remote host terminated the handshake
> Failed to notify project evaluation listener.
   > Could not get unknown property 'android' for project ':flutter_jailbreak_detection' of type org.gradle.api.Project.
   > Could not get unknown property 'android' for project ':flutter_jailbreak_detection' of type org.gradle.api.Project.

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 38s
Running Gradle task 'assembleRelease'...                           40.4s
[!] Gradle threw an error while downloading artifacts from the network.
Gradle task assembleRelease failed with exit code 1
Error: Process completed with exit code 1.

Main.yml

on:
  pull_request:
    branches:
      - develop_3.0
  push:
    branches:
      - develop_3.0
name: "Build & Release"
jobs:
  build:
    name: Build & Release
    runs-on: macos-latest
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-java@v3
        with:
          distribution: "zulu"
          java-version: "17"
      - uses: subosito/flutter-action@v2
        with:
          channel: "stable"
          architecture: x64

      - run: flutter build apk --release --split-per-abi
      - run: |
          flutter build ios --no-codesign
          cd build/ios/iphoneos
          mkdir Payload
          cd Payload
          ln -s ../Runner.app
          cd ..
          zip -r app.ipa Payload
      - name: Push to Releases
        uses: ncipollo/release-action@v1
        with:
          artifacts: "build/app/outputs/apk/release/*,build/ios/iphoneos/app.ipa"
          tag: v1.0.${{ github.run_number }}
          token: ${{ secrets.TOKEN }}

Upvotes: 0

Views: 33

Answers (0)

Related Questions