Flutter 默认应用程序不运行 - 构建失败 - 任务 ':app:compressDebugAssets' - 任务 :app:processDebugManifest FAILED

时间:2021-03-07 14:29:25

标签: android flutter gradle

Flutter 版本:2.0 和 2.0.1

flutter run

Launching lib\main.dart on RMX2170 in debug mode...

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compressDebugAssets'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.CompressAssetsWorkAction
   > G:\Projects\testest\build\app\intermediates\merged_assets\debug\out

* 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 45s
Running Gradle task 'assembleDebug'...
Running Gradle task 'assembleDebug'... Done                       108.4s
Exception: Gradle task assembleDebug failed with exit code 1

flutter run -v

[ +118 ms] executing: [D:\flutter/] git -c log.showSignature=false log -n 1 --pretty=format:%H
[ +247 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H
[   +7 ms] c5a4b4029c0798f37c4a39b479d7cb75daa7b05c
[   +5 ms] executing: [D:\flutter/] git tag --points-at c5a4b4029c0798f37c4a39b479d7cb75daa7b05c
[ +599 ms] Exit code 0 from: git tag --points-at c5a4b4029c0798f37c4a39b479d7cb75daa7b05c
[   +3 ms] 2.0.1
[  +64 ms] executing: [D:\flutter/] git rev-parse --abbrev-ref --symbolic @{u}
[  +72 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u}
[   +2 ms] origin/stable
[   +4 ms] executing: [D:\flutter/] git ls-remote --get-url origin
[  +49 ms] Exit code 0 from: git ls-remote --get-url origin
[   +2 ms] https://github.com/flutter/flutter.git
[ +114 ms] executing: [D:\flutter/] git rev-parse --abbrev-ref HEAD
[  +52 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[   +3 ms] stable
[  +95 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[   +2 ms] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[   +4 ms] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[   +1 ms] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[   +5 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[   +1 ms] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[   +1 ms] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[   +1 ms] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[   +1 ms] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[   +1 ms] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[   +1 ms] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[ +110 ms] executing: D:\AndroidSdk\platform-tools\adb.exe devices -l
[  +77 ms] List of devices attached
           192.168.10.7:5555      device product:RMX2170 model:RMX2170 device:RMX2170L1 transport_id:9
[  +57 ms] D:\AndroidSdk\platform-tools\adb.exe -s 192.168.10.7:5555 shell getprop
[ +171 ms] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[   +3 ms] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[   +7 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[   +1 ms] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[   +1 ms] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[   +1 ms] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[   +1 ms] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[   +2 ms] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[   +1 ms] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[ +161 ms] Skipping pub get: version match.
[ +208 ms] Generating G:\Projects\testest\android\app\src\main\java\io\flutter\plugins\GeneratedPluginRegistrant.java
[  +81 ms] ro.hardware = qcom
[  +66 ms] Initializing file store
[ +214 ms] Skipping target: gen_localizations
[  +17 ms] complete
[   +8 ms] Launching lib\main.dart on RMX2170 in debug mode...
[  +11 ms] D:\flutter\bin\cache\dart-sdk\bin\dart.exe --disable-dart-dev
D:\flutter\bin\cache\artifacts\engine\windows-x64\frontend_server.dart.snapshot --sdk-root
D:\flutter\bin\cache\artifacts\engine\common\flutter_patched_sdk/ --incremental --target=flutter --debugger-module-names
--experimental-emit-debug-metadata --output-dill
C:\Users\hussain\AppData\Local\Temp\flutter_tools.f5b3ebc7\flutter_tool.f6675474\app.dill --packages
G:\Projects\testest\.dart_tool\package_config.json -Ddart.vm.profile=false -Ddart.vm.product=false --enable-asserts
--track-widget-creation --filesystem-scheme org-dartlang-root --initialize-from-dill build\cache.dill.track.dill
[  +71 ms] executing: D:\AndroidSdk\platform-tools\adb.exe -s 192.168.10.7:5555 shell -x logcat -v time -t 1
[  +48 ms] <- compile package:testest/main.dart
[ +212 ms] --------- beginning of main
                    03-07 19:17:00.551 E/SDM     (  946): HWDeviceDRM::write_node: write_node: access path:
                    /sys/kernel/oppo_display/video : 0
[  +26 ms] executing: D:\AndroidSdk\platform-tools\adb.exe version
[ +410 ms] Android Debug Bridge version 1.0.41
                    Version 30.0.5-6877874
                    Installed as D:\AndroidSdk\platform-tools\adb.exe
[  +31 ms] executing: D:\AndroidSdk\platform-tools\adb.exe start-server
[  +51 ms] Building APK
[  +39 ms] Running Gradle task 'assembleDebug'...
[  +14 ms] Using gradle from G:\Projects\testest\android\gradlew.bat.
[   +3 ms] G:\Projects\testest\android\gradlew.bat mode: 33279 rwxrwxrwx.
[  +21 ms] executing: C:\Program Files\Android\Android Studio\jre\bin\java -version
[ +998 ms] Exit code 0 from: C:\Program Files\Android\Android Studio\jre\bin\java -version
[   +3 ms] openjdk version "1.8.0_242-release"
           OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
           OpenJDK 64-Bit Server VM (build 25.242-b01, mixed mode)
[   +8 ms] executing: [G:\Projects\testest\android/] G:\Projects\testest\android\gradlew.bat -Pverbose=true
-Ptarget-platform=android-arm64 -Ptarget=G:\Projects\testest\lib\main.dart -Ptrack-widget-creation=true
-Pfilesystem-scheme=org-dartlang-root assembleDebug
[+11317 ms] > Task :app:compileFlutterBuildDebug
[   +5 ms] [ +185 ms] executing: [D:\flutter/] git -c log.showSignature=false log -n 1 --pretty=format:%H
[  +46 ms] [ +183 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H
[   +9 ms] [        ] c5a4b4029c0798f37c4a39b479d7cb75daa7b05c
[   +4 ms] [   +2 ms] executing: [D:\flutter/] git tag --points-at c5a4b4029c0798f37c4a39b479d7cb75daa7b05c
[ +157 ms] [ +121 ms] Exit code 0 from: git tag --points-at c5a4b4029c0798f37c4a39b479d7cb75daa7b05c
[   +4 ms] [        ] 2.0.1
[ +103 ms] [ +115 ms] executing: [D:\flutter/] git rev-parse --abbrev-ref --symbolic @{u}
[  +96 ms] [ +132 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u}
[   +5 ms] [        ] origin/stable
[   +4 ms] [        ] executing: [D:\flutter/] git ls-remote --get-url origin
[  +85 ms] [  +83 ms] Exit code 0 from: git ls-remote --get-url origin
[   +4 ms] [        ] https://github.com/flutter/flutter.git
[ +202 ms] [ +164 ms] executing: [D:\flutter/] git rev-parse --abbrev-ref HEAD
[  +95 ms] [  +89 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[   +4 ms] [   +1 ms] stable
[ +115 ms] [ +113 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[   +4 ms] [        ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[   +4 ms] [        ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[   +2 ms] [   +2 ms] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[   +2 ms] [  +11 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[   +2 ms] [        ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[   +2 ms] [        ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[   +2 ms] [        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[   +2 ms] [        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[   +8 ms] [        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[   +2 ms] [        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[ +146 ms] [ +216 ms] Artifact Instance of 'MaterialFonts' is not required, skipping update.
[   +4 ms] [        ] Artifact Instance of 'GradleWrapper' is not required, skipping update.
[   +4 ms] [        ] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[   +2 ms] [        ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[   +2 ms] [        ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[   +4 ms] [        ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[   +4 ms] [        ] Artifact Instance of 'FlutterSdk' is not required, skipping update.
[   +3 ms] [        ] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[   +2 ms] [        ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[   +5 ms] [        ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[   +2 ms] [        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[   +4 ms] [        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[   +2 ms] [        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[   +5 ms] [        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[   +2 ms] [        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[   +4 ms] [        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[   +3 ms] [        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[   +2 ms] [        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[   +5 ms] [        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[   +4 ms] [        ] Artifact Instance of 'FontSubsetArtifacts' is not required, skipping update.
[   +2 ms] [        ] Artifact Instance of 'PubDependencies' is not required, skipping update.
[ +236 ms] [ +246 ms] Initializing file store
[   +5 ms] [  +79 ms] Done initializing file store
[ +176 ms] [ +140 ms] Skipping target: gen_localizations
[+1499 ms] [+1501 ms] Skipping target: kernel_snapshot
[ +110 ms] [  +71 ms] debug_android_application: Starting due to {InvalidatedReason.outputMissing}
[ +404 ms] [ +454 ms] debug_android_application: Complete
[ +695 ms] [ +708 ms] Persisting file store
[  +95 ms] [  +37 ms] Done persisting file store
[   +4 ms] [  +16 ms] build succeeded.
[   +4 ms] [  +56 ms] "flutter assemble" took 3,573ms.
[  +85 ms] [  +11 ms] ensureAnalyticsSent: 1ms
[   +3 ms] [   +4 ms] Running shutdown hooks
[   +4 ms] [        ] Shutdown hooks complete
[   +2 ms] [  +12 ms] exiting with code 0
[ +103 ms] > Task :app:packLibsflutterBuildDebug UP-TO-DATE
[   +4 ms] > Task :app:preBuild UP-TO-DATE
[   +4 ms] > Task :app:preDebugBuild UP-TO-DATE
[   +3 ms] > Task :app:compileDebugAidl NO-SOURCE
[   +5 ms] > Task :app:compileDebugRenderscript NO-SOURCE
[   +5 ms] > Task :app:generateDebugBuildConfig UP-TO-DATE
[ +163 ms] > Task :app:checkDebugAarMetadata UP-TO-DATE
[   +4 ms] > Task :app:cleanMergeDebugAssets
[   +3 ms] > Task :app:mergeDebugShaders UP-TO-DATE
[   +2 ms] > Task :app:compileDebugShaders NO-SOURCE
[   +2 ms] > Task :app:generateDebugAssets UP-TO-DATE
[  +82 ms] > Task :app:mergeDebugAssets UP-TO-DATE
[ +809 ms] > Task :app:copyFlutterAssetsDebug
[   +5 ms] > Task :app:generateDebugResValues UP-TO-DATE
[   +4 ms] > Task :app:generateDebugResources UP-TO-DATE
[ +224 ms] > Task :app:mergeDebugResources UP-TO-DATE
[   +8 ms] > Task :app:createDebugCompatibleScreenManifests UP-TO-DATE
[ +191 ms] > Task :app:extractDeepLinksDebug UP-TO-DATE
[  +11 ms] > Task :app:processDebugMainManifest UP-TO-DATE
[  +13 ms] > Task :app:processDebugManifest FAILED
[   +5 ms] FAILURE: Build failed with an exception.
[  +11 ms] * What went wrong:
[   +3 ms] A problem was found with the configuration of task ':app:processDebugManifest' (type 'ProcessMultiApkApplicationManifest').
[   +3 ms] > File 'G:\Projects\testest\build\app\intermediates\merged_manifest\debug\out\AndroidManifest.xml' specified for property
'mainMergedManifest' does not exist.
[   +4 ms] * Try:
[   +4 ms] 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.
[   +5 ms] * Get more help at https://help.gradle.org
[   +9 ms] Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
[   +5 ms] Use '--warning-mode all' to show the individual deprecation warnings.
[   +2 ms] See https://docs.gradle.org/6.7/userguide/command_line_interface.html#sec:command_line_warnings
[   +2 ms] 14 actionable tasks: 4 executed, 10 up-to-date
[   +2 ms] BUILD FAILED in 17s
[ +645 ms] Running Gradle task 'assembleDebug'... (completed in 19.2s)
[+1822 ms] Exception: Gradle task assembleDebug failed with exit code 1
[  +11 ms] "flutter run" took 23,239ms.
[   +7 ms]
           #0      throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
           #1      RunCommand.runCommand (package:flutter_tools/src/commands/run.dart:644:9)
           <asynchronous suspension>
           #2      FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:1157:12)
           <asynchronous suspension>
           #3      FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1009:27)
           <asynchronous suspension>
           #4      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
           <asynchronous suspension>
           #5      AppContext.run (package:flutter_tools/src/base/context.dart:149:12)
           <asynchronous suspension>
           #6      CommandRunner.runCommand (package:args/command_runner.dart:197:13)
           <asynchronous suspension>
           #7      FlutterCommandRunner.runCommand.<anonymous closure>
(package:flutter_tools/src/runner/flutter_command_runner.dart:278:9)
           <asynchronous suspension>
           #8      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
           <asynchronous suspension>
           #9      AppContext.run (package:flutter_tools/src/base/context.dart:149:12)
           <asynchronous suspension>
           #10     FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:234:5)
           <asynchronous suspension>
           #11     run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:64:9)
           <asynchronous suspension>
           #12     run.<anonymous closure> (package:flutter_tools/runner.dart:62:12)
           <asynchronous suspension>
           #13     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
           <asynchronous suspension>
           #14     AppContext.run (package:flutter_tools/src/base/context.dart:149:12)
           <asynchronous suspension>
           #15     runInContext (package:flutter_tools/src/context_runner.dart:73:10)
           <asynchronous suspension>
           #16     main (package:flutter_tools/executable.dart:90:3)
           <asynchronous suspension>


[ +272 ms] ensureAnalyticsSent: 265ms
[   +8 ms] Running shutdown hooks
[   +3 ms] Shutdown hook priority 4
[  +14 ms] Shutdown hooks complete
[  +56 ms] exiting with code 1

flutter doctor

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 2.0.1, on Microsoft Windows [Version 10.0.19042.804], locale en-US)
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
[√] Chrome - develop for the web
[√] Android Studio (version 4.1.0)
[√] VS Code, 64-bit edition (version 1.51.1)
[√] Connected device (3 available)

• No issues found!

1 个答案:

答案 0 :(得分:1)

事实证明这是较新版本的 Gradle 的问题。花了一天时间,终于从this video那里得到了答案。