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

Gradle build failed to produce an Android bundle package. #40445

Closed
fauzipadlaw opened this issue Sep 13, 2019 · 12 comments
Closed

Gradle build failed to produce an Android bundle package. #40445

fauzipadlaw opened this issue Sep 13, 2019 · 12 comments

Comments

@fauzipadlaw
Copy link

Steps to Reproduce

  1. flutter build appbundle -v

Logs

Gradle build failed to produce an Android bundle package.

#0      throwToolExit (package:flutter_tools/src/base/common.dart:28:3)
#1      _buildGradleProjectV2 (package:flutter_tools/src/android/gradle.dart:780:7)
#2      _asyncThenWrapperHelper.<anonymous closure> (dart:async-patch/async_patch.dart:71:64)
#3      _rootRunUnary (dart:async/zone.dart:1132:38)
#4      _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#5      _FutureListener.handleValue (dart:async/future_impl.dart:137:18)
#6      Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:678:45)
#7      Future._propagateToListeners (dart:async/future_impl.dart:707:32)
#8      Future._completeWithValue (dart:async/future_impl.dart:522:5)
#9      _AsyncAwaitCompleter.complete (dart:async-patch/async_patch.dart:30:15)
#10     _completeOnAsyncReturn (dart:async-patch/async_patch.dart:288:13)
#11     runCommandAndStreamOutput (package:flutter_tools/src/base/process.dart)
#12     _asyncThenWrapperHelper.<anonymous closure> (dart:async-patch/async_patch.dart:71:64)
#13     _rootRunUnary (dart:async/zone.dart:1132:38)
#14     _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#15     _FutureListener.handleValue (dart:async/future_impl.dart:137:18)
#16     Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:678:45)
#17     Future._propagateToListeners (dart:async/future_impl.dart:707:32)
#18     Future._completeWithValue (dart:async/future_impl.dart:522:5)
#19     Future._asyncComplete.<anonymous closure> (dart:async/future_impl.dart:552:7)
#20     _rootRun (dart:async/zone.dart:1124:13)
#21     _CustomZone.run (dart:async/zone.dart:1021:19)
#22     _CustomZone.runGuarded (dart:async/zone.dart:923:7)
#23     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:963:23)
#24     _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#25     _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#26     _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:116:13)
#27     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:173:5)

Analyzing elxr_mobile...


   info - The value of the field '_dateCountOfMonth' isn't used - lib\components\pickers\date_time_picker.dart:47:7 - unused_field
   info - The value of the field '_customer' isn't used - lib\pages\04_profile\profile_landing_page.dart:31:12 - unused_field
   info - Unused import: 'package:flutter/material.dart' - test\widget_test.dart:8:8 - unused_import
   info - Unused import: 'package:flutter_test/flutter_test.dart' - test\widget_test.dart:9:8 - unused_import
   info - Unused import: 'package:elxr_mobile/main.dart' - test\widget_test.dart:11:8 - unused_import

5 issues found. (ran in 280.9s)

[√] Flutter (Channel stable, v1.9.1+hotfix.2, on Microsoft Windows [Version 10.0.17134.950], locale en-US)
    • Flutter version 1.9.1+hotfix.2 at C:\src\flutter
    • Framework revision 2d2a1ffec9 (7 days ago), 2019-09-06 18:39:49 -0700
    • Engine revision b863200c37
    • Dart version 2.5.0


[√] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at C:\Users\fauzi\AppData\Local\Android\sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.3
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
    • All Android licenses accepted.

[√] Android Studio (version 3.5)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin version 39.0.3
    • Dart plugin version 191.8423
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)

[√] VS Code (version 1.38.0)
    • VS Code at C:\Users\fauzi\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.4.1

[√] VS Code, 64-bit edition (version 1.37.1)
    • VS Code at C:\Program Files\Microsoft VS Code
    • Flutter extension version 3.4.1

[√] Connected device (1 available)
    • CPH1729 • EQ8SJFTGWK9PWCLV • android-arm64 • Android 7.1.1 (API 25)

• No issues found!

@BondarenkoStas
Copy link

BondarenkoStas commented Sep 13, 2019

@fauzipadlaw I'm not sure which Gradle version you use, but it's seems very similar to #38934.

The issue is that in Android Gradle plugin 3.5.0, the app bundle is named app-.aab instead of app.aab, which is what the Flutter tool expects.

It was fixed on master channel #39126.
Or please try to do as proposed in #38934 (comment).
Please report if you still will encounter the issue. If it's your case and it's solved by downgrading gradle or moving to master, please close the issue.

@BondarenkoStas BondarenkoStas added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Sep 13, 2019
@fauzipadlaw
Copy link
Author

@BondarenkoStas ya I use Gradle plugin 3.5.0, I click on 'Open for Editing in Android Studio and build the bundle, it fixes my problem for now. I will try upgrading my flutter with master channel later.
I think we can close this issue for now. Thanks!

@no-response no-response bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Sep 14, 2019
@fauzipadlaw
Copy link
Author

Upgrading to master channel solved the problem

@TRoZZNL
Copy link

TRoZZNL commented Oct 29, 2019

Upgrading to master channel solved the problem for me as well, thanks !

@vitor-gyant
Copy link

vitor-gyant commented Nov 20, 2019

@BondarenkoStas I'm facing this issue in the latest stable version. Downgraded app/android/build.gradle from 3.5.2 to 3.4.2 does not solve the problem.

flutter build apk still returns the same error.

Not able to ship a production app from the stable branch due to this. Any idea ?

flutter build appbundle works but I need the apk.

@Nico04
Copy link

Nico04 commented Nov 22, 2019

Downgrading Gradle from 3.5.1 to 3.4.2 worked for me.

@psyanite
Copy link

psyanite commented Dec 1, 2019

I also downgraded from 3.5.0 to 3.4.2, thanks @Nico04. I don't want to run master I want to run stable because I have incompatible libraries. Cheers.

@Amonc
Copy link

Amonc commented Dec 9, 2019

I solved the issue by changing the flutter channel from stable to master. Also I was getting an androidx incompatibility error for flutter_firestore. Later I had to run flutter build bundle rather than creating the apk. That worked smoothly.

@Victor116
Copy link

He solucionado el problema deje un comentario en este hilo #37565

@Xgamefactory
Copy link

we have same issue with lates stable sdk unable to build appbundle
flutter debug run works as expected but cannot build appbundle
even with downgraded gradle version

Gradle task bundleRelease failed with exit code 1

#0      throwToolExit (package:flutter_tools/src/base/common.dart:28:3)
#1      buildGradleApp (package:flutter_tools/src/android/gradle.dart:387:7)
<asynchronous suspension>
#2      _AndroidBuilderImpl.buildAab (package:flutter_tools/src/android/android_builder.dart:117:13)
#3      BuildAppBundleCommand.runCommand
(package:flutter_tools/src/commands/build_appbundle.dart:77:26)
#4      FlutterCommand.verifyThenRunCommand
(package:flutter_tools/src/runner/flutter_command.dart:615:18)
<asynchronous suspension>
#5      FlutterCommand.run.<anonymous closure>
(package:flutter_tools/src/runner/flutter_command.dart:515:33)
<asynchronous suspension>
#6      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:146:29)
#7      _rootRun (dart:async/zone.dart:1126:13)
#8      _CustomZone.run (dart:async/zone.dart:1023:19)
#9      _runZoned (dart:async/zone.dart:1518:10)
#10     runZoned (dart:async/zone.dart:1465:12)
#11     AppContext.run (package:flutter_tools/src/base/context.dart:145:18)
#12     FlutterCommand.run (package:flutter_tools/src/runner/flutter_command.dart:505:20)
#13     CommandRunner.runCommand (package:args/command_runner.dart:197:27)
#14     FlutterCommandRunner.runCommand.<anonymous closure>
(package:flutter_tools/src/runner/flutter_command_runner.dart:413:21)
<asynchronous suspension>
#15     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:146:29)
#16     _rootRun (dart:async/zone.dart:1126:13)
#17     _CustomZone.run (dart:async/zone.dart:1023:19)
#18     _runZoned (dart:async/zone.dart:1518:10)
#19     runZoned (dart:async/zone.dart:1465:12)
#20     AppContext.run (package:flutter_tools/src/base/context.dart:145:18)
#21     FlutterCommandRunner.runCommand
(package:flutter_tools/src/runner/flutter_command_runner.dart:364:19)
#22     CommandRunner.run.<anonymous closure> (package:args/command_runner.dart:112:25)
#23     new Future.sync (dart:async/future.dart:224:31)
flutter doctor -v
[✓] Flutter (Channel stable, v1.12.13+hotfix.5, on Mac OS X 10.14.6 18G103, locale en-TR)
    • Flutter version 1.12.13+hotfix.5 at /Users/fersmart/SDK_all/flutter
    • Framework revision 27321ebbad (13 days ago), 2019-12-10 18:15:01 -0800
    • Engine revision 2994f7e1e6
    • Dart version 2.7.0

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    • Android SDK at /Users/fersmart/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-29, build-tools 29.0.2
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.3, Build version 11C29
    • CocoaPods version 1.7.5

[✓] Android Studio (version 3.5)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 42.1.1
    • Dart plugin version 191.8593
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)

[✓] VS Code (version 1.41.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.7.1

@quetool
Copy link

quetool commented Jan 3, 2020

I am getting the same issue, I am solving by generating bundle/apk from android studio. Don't know why flutter produce this issue now, everything was going well till last week

@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants