1

I am running flutter build apk --obfuscate --split-debug-info=./build/info to build android apk

How can I fix the following error?

Running "flutter pub get" in myapp...
1.0s You are building a fat APK that includes binaries for android-arm, android-arm64, android-x64. If you are deploying the app to the Play Store, it's recommended to use app bundles or split the APK to reduce the APK size. To generate an app bundle, run: flutter build appbundle --target-platform android-arm,android-arm64,android-x64 Learn more on: https://developer.android.com/guide/app-bundle To split the APKs per ABI, run: flutter build apk --target-platform android-arm,android-arm64,android-x64 --split-per-abi Learn more on: https://developer.android.com/studio/build/configure-apk-splits#configure-abi-split Plugin project :location_web not found. Please update settings.gradle.

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':app:lintVitalRelease'.

Could not resolve all artifacts for configuration ':app:debugRuntimeClasspath'. Failed to transform libs.jar to match attributes {artifactType=processed-jar, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}. > Execution failed for JetifyTransform: C:\Projects\myapp\myapp\build\app\intermediates\flutter\debug\libs.jar. > Transform's input file does not exist: C:\Projects\myapp\myapp\build\app\intermediates\flutter\debug\libs.jar. (See https://issuetracker.google.com/issues/158753935)

  • 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 19s Running Gradle task 'assembleRelease'... Running Gradle task 'assembleRelease'... Done
79.8s Gradle task assembleRelease failed with exit code 1

WebMaster
  • 3,050
  • 4
  • 25
  • 77

1 Answers1

1

Try this modification in your build.gradle(app level)

lintOptions {
     // Code...
     checkReleaseBuilds false
     // Added the above line so that 'flutter build apk' could work
}

See this issue on Github

https://github.com/flutter/flutter/issues/58247

My solution is based on this comment (This one worked for me) https://github.com/flutter/flutter/issues/58247#issuecomment-636253593

This comment provides some depth on the issue https://github.com/flutter/flutter/issues/58247#issuecomment-636500680

Maik Lowrey
  • 15,957
  • 6
  • 40
  • 79
ASAD HAMEED
  • 2,296
  • 1
  • 20
  • 36
  • @asad-hamed after adding `checkReleaseBuilds false`, I can build apk file, but when I install it, we have just a white screen – WebMaster Jan 09 '21 at 14:23
  • 1
    Run the app on emulator and check the `logcat` to see what's wrong. Share the error in the log, I might be able to help you :) – ASAD HAMEED Jan 09 '21 at 15:43