Flutter Android无法构建-Gradle任务assembleDebug失败,退出代码为1

时间:2019-09-24 14:18:25

标签: android flutter dart

我正在尝试在android上构建我的应用,并获取错误代码。该构建在iOS上运行良好。我检查了依赖项版本,它们似乎都是最新的。有人对做什么有任何建议吗?谢谢

Gradle task assembleDebug failed with exit code 1

#0      throwToolExit (package:flutter_tools/src/base/common.dart:28:3)
#1      _buildGradleProjectV2 (package:flutter_tools/src/android/gradle.dart:751:5)
#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)

Flutter Doctor -v

[✓] Flutter (Channel stable, v1.9.1+hotfix.2, on Mac OS X 10.14.6 18G95, locale en-GB)
    • Flutter version 1.9.1+hotfix.2 at /Users/student/flutter
    • Framework revision 2d2a1ffec9 (3 weeks 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 29.0.0)
    • Android SDK at /Users/student/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-29, build-tools 29.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)
    • All Android licenses accepted.

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

[✓] Android Studio (version 3.4)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 38.2.1
    • Dart plugin version 183.6270
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)

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

[✓] Connected device (1 available)
    • SM G930F • ce061606ba344a2a05 • android-arm64 • Android 8.0.0 (API 26)

依赖项

版本:1.0.0 + 1

环境:   sdk:'> = 2.2.0 <3.0.0'

dependencies:
  flutter:
    sdk: flutter
  cupertino_icons: ^0.1.2
  provider: ^2.0.1
  get_it: ^3.0.1
  http: ^0.12.0+2
  flutter_auth_buttons: ^0.5.0
  google_maps_flutter: ^0.5.21+3
  font_awesome_flutter: ^8.5.0
  flutter_mailer: ^0.4.1+2
  circular_check_box: ^1.0.1
  flutter_datetime_picker: ^1.2.6
  intl: ^0.16.0
  validators: ^2.0.0+1
  flutter_rating_bar: ^3.0.0
  rate_my_app: ^0.4.0
  url_launcher: ^5.1.3
  carousel_pro: ^1.0.0
  geolocator: ^5.1.3
  file_picker: ^1.4.2
  share: ^0.6.2+1
  flutter_staggered_grid_view: ^0.3.0
  multi_image_picker: ^4.5.5
  dots_indicator: ^1.0.0
  flutter_picker: ^1.0.15
  equatable: ^0.5.1
  meta: ^1.1.7
  shared_preferences: ^0.5.3+4
  firebase_core: ^0.4.0+9
  firebase_analytics: ^5.0.2
  firebase_messaging: ^5.1.3
  firebase_in_app_messaging: ^0.0.1+3
  cloud_firestore: ^0.12.9+4
  auto_size_text: ^2.1.0
  overlay_support: ^1.0.1
  flutter_launcher_icons: ^0.7.3
  geocoder: ^0.2.1
  flutter_html: ^0.11.0
  pin_code_text_field: ^1.4.0
  http_parser: ^3.1.3
  flutter_plugin_pdf_viewer: ^1.0.7
  permission_handler: ^3.2.2
  flutter_facebook_login: ^3.0.0
  location: ^2.3.5
  flutter_webview_plugin: ^0.3.8
  notification_permissions: ^0.4.0

还有一个警告

[        ]          *********************************************************
[        ] WARNING: This version of cloud_firestore will break your Android build if it or its dependencies aren't compatible with AndroidX.
[        ]          See for more information on the problem and how to fix it.
[        ]          This warning prints for all Android build failures. The real root cause of the error may be unrelated.
[        ]          *********************************************************

但是我正在cloud_firestore上使用最新版本。

我的.gradle文件是5.1.1

构建gradle依赖项

dependencies {
        classpath 'com.android.tools.build:gradle:3.4.1'
        classpath 'com.google.gms:google-services:4.3.0'  // Google Services plugin
    }

渐变属性

android.useAndroidX=true
android.enableJetifier=true

0 个答案:

没有答案