-
Notifications
You must be signed in to change notification settings - Fork 30.2k
Exception: Gradle build failed to produce an .apk file. It's likely that this file was generated under C:\project\flutter\sotrunx2\build, but the tool couldn't find it. #95722
Description
Steps to Reproduce
- Execute
flutter run -v--> - ...
Exception: Gradle build failed to produce an .apk file. It's likely that this file was generated under C:\project\flutter\sotrunx2\build, but the tool couldn't find it.
Expected results:
run app to android device
Actual results:
Exception: Gradle build failed to produce an .apk file. It's likely that this file was generated under C:\project\flutter\sotrunx2\build, but the tool couldn't find it.
Details
[ +54 ms] executing: [C:\sdk\flutter/] git -c log.showSignature=false log -n 1 --pretty=format:%H
[ +62 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H
[ +1 ms] d571257
[ +1 ms] executing: [C:\sdk\flutter/] git tag --points-at d571257
[ +45 ms] Exit code 0 from: git tag --points-at d571257
[ +2 ms] executing: [C:\sdk\flutter/] git describe --match ..* --long --tags
d571257
[ +64 ms] Exit code 0 from: git describe --match ..* --long --tags d571257
[ +1 ms] 2.9.0-0.0.pre-140-gd571257a99
[ +9 ms] executing: [C:\sdk\flutter/] git rev-parse --abbrev-ref --symbolic @{u}
[ +39 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u}
[ +2 ms] origin/master
[ ] executing: [C:\sdk\flutter/] git ls-remote --get-url origin
[ +35 ms] Exit code 0 from: git ls-remote --get-url origin
[ +1 ms] https://github.com/flutter/flutter.git
[ +98 ms] executing: [C:\sdk\flutter/] git rev-parse --abbrev-ref HEAD
[ +40 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[ +1 ms] master
[ +62 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[ +1 ms] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[ +1 ms] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[ +1 ms] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[ +4 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[ +1 ms] Artifact Instance of 'WindowsUwpEngineArtifacts' is not required, skipping update.
[ +1 ms] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[ ] 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.
[ ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[ +4 ms] Flutter assets will be downloaded from https://storage.flutter-io.cn. Make sure you trust this source!
[ +53 ms] executing: C:\sdk\Android\platform-tools\adb.exe devices -l
[ +58 ms] List of devices attached
fylb79faz5xoaqpv device product:chopin model:M2104K10AC device:chopin transport_id:1
[ +6 ms] C:\sdk\Android\platform-tools\adb.exe -s fylb79faz5xoaqpv shell getprop
[ +125 ms] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[ +1 ms] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[ +7 ms] Artifact Instance of 'WindowsUwpEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[ +2 ms] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[ +1 ms] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[ +81 ms] Skipping pub get: version match.
[ +72 ms] Generating
C:\project\flutter\sotrunx2.android\Flutter\src\main\java\io\flutter\plugins\GeneratedPluginRegistrant.java
[ +52 ms] ro.hardware = mt6891
[ +1 ms] ro.build.characteristics = nosdcard
[ +35 ms] Initializing file store
[ +10 ms] Skipping target: gen_localizations
[ +6 ms] gen_dart_plugin_registrant: Starting due to {InvalidatedReasonKind.inputChanged: The following inputs have
updated contents: C:\project\flutter\sotrunx2.dart_tool\package_config_subset}
[ +25 ms] gen_dart_plugin_registrant: Complete
[ +2 ms] Skipping target: _composite
[ +2 ms] complete
[ +5 ms] Launching lib\main.dart on M2104K10AC in debug mode...
[ +4 ms] C:\sdk\flutter\bin\cache\dart-sdk\bin\dart.exe --disable-dart-dev
C:\sdk\flutter\bin\cache\artifacts\engine\windows-x64\frontend_server.dart.snapshot --sdk-root
C:\sdk\flutter\bin\cache\artifacts\engine\common\flutter_patched_sdk/ --incremental --target=flutter
--debugger-module-names --experimental-emit-debug-metadata -DFLUTTER_WEB_AUTO_DETECT=true --output-dill
C:\Users\qssq5\AppData\Local\Temp\flutter_tools.b9cc9532\flutter_tool.146b6bf8\app.dill --packages
C:\project\flutter\sotrunx2.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\c075001b96339384a97db4862b8ab8db.cache.dill.track.dill --flutter-widget-cache
--enable-experiment=alternative-invalidation-strategy
[ +46 ms] executing: C:\sdk\Android\platform-tools\adb.exe -s fylb79faz5xoaqpv shell -x logcat -v time -t 1
[ +14 ms] <- compile package:sotrunx/main.dart
[ +172 ms] --------- beginning of main
12-23 17:36:46.454 W/sh (21869): type=1400 audit(0.0:1817837): avc: denied { search } for
name="mm" dev="sysfs" ino=9370 scontext=u:r:shell:s0 tcontext=u:object_r:sysfs_mm:s0 tclass=dir
permissive=0 app=com.tencent.mobileqq
[ +9 ms] executing: C:\sdk\Android\platform-tools\adb.exe version
[ +41 ms] Android Debug Bridge version 1.0.41
Version 31.0.3-7562133
Installed as C:\sdk\Android\platform-tools\adb.exe
[ +6 ms] executing: C:\sdk\Android\platform-tools\adb.exe start-server
[ +36 ms] Building APK
[ +20 ms] Running Gradle task 'assembleDebug'...
[ +5 ms] Using gradle from C:\project\flutter\sotrunx2\android\gradlew.bat.
[ +13 ms] executing: C:\Android\Android Studio\jre\bin\java -version
[ +129 ms] Exit code 0 from: C:\Android\Android Studio\jre\bin\java -version
[ +1 ms] openjdk version "11.0.10" 2021-01-19
OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
OpenJDK 64-Bit Server VM (build 11.0.10+0-b96-7249189, mixed mode)
[ +4 ms] executing: C:\soft\android-studio2021.1.1.12\jre\bin\java -version
[ +118 ms] Exit code 0 from: C:\soft\android-studio2021.1.1.12\jre\bin\java -version
[ +1 ms] openjdk version "11.0.11" 2021-04-20
OpenJDK Runtime Environment (build 11.0.11+9-b60-7590822)
OpenJDK 64-Bit Server VM (build 11.0.11+9-b60-7590822, mixed mode)
[ +2 ms] executing: C:\soft\android-studio2021.1.1.12\jre\bin\java -version
[ +123 ms] Exit code 0 from: C:\soft\android-studio2021.1.1.12\jre\bin\java -version
[ +1 ms] openjdk version "11.0.11" 2021-04-20
OpenJDK Runtime Environment (build 11.0.11+9-b60-7590822)
OpenJDK 64-Bit Server VM (build 11.0.11+9-b60-7590822, mixed mode)
[ +3 ms] executing: [C:\project\flutter\sotrunx2\android/] C:\project\flutter\sotrunx2\android\gradlew.bat
-Pverbose=true -Ptarget-platform=android-arm64 -Ptarget=C:\project\flutter\sotrunx2\lib\main.dart
-Pbase-application-name=android.app.Application -Pdart-defines=RkxVVFRFUl9XRUJfQVVUT19ERVRFQ1Q9dHJ1ZQ==
-Pdart-obfuscation=false -Ptrack-widget-creation=true -Ptree-shake-icons=false -Pfilesystem-scheme=org-dartlang-root
assembleDebug
[+4268 ms] > Task :app:compileFlutterBuildDebug
[ +1 ms] [ +64 ms] executing: [C:\sdk\flutter/] git -c log.showSignature=false log -n 1 --pretty=format:%H
[ ] [ +61 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H
[ ] [ ] d571257
[ ] [ ] executing: [C:\sdk\flutter/] git tag --points-at d571257
[ ] [ +45 ms] Exit code 0 from: git tag --points-at d571257
[ ] [ +1 ms] executing: [C:\sdk\flutter/] git describe --match ..* --long --tags d571257
[ +1 ms] [ +65 ms] Exit code 0 from: git describe --match ..* --long --tags d571257
[ ] [ ] 2.9.0-0.0.pre-140-gd571257a99
[ ] [ +6 ms] executing: [C:\sdk\flutter/] git rev-parse --abbrev-ref --symbolic @{u}
[ ] [ +42 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u}
[ ] [ ] origin/master
[ ] [ ] executing: [C:\sdk\flutter/] git ls-remote --get-url origin
[ ] [ +43 ms] Exit code 0 from: git ls-remote --get-url origin
[ ] [ ] https://github.com/flutter/flutter.git
[ ] [ +55 ms] executing: [C:\sdk\flutter/] git rev-parse --abbrev-ref HEAD
[ +5 ms] [ +49 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[ +3 ms] [ ] master
[ +1 ms] [ +62 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[ ] [ ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[ ] [ ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[ ] [ ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[ ] [ +4 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[ ] [ ] Artifact Instance of 'WindowsUwpEngineArtifacts' is not required, skipping update.
[ +1 ms] [ ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[ ] [ ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[ +4 ms] [ ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[ +2 ms] [ ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[ ] [ ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[ ] [ ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[ ] [ +6 ms] Flutter assets will be downloaded from https://storage.flutter-io.cn. Make sure you trust this source!
[ ] [ +106 ms] Artifact Instance of 'MaterialFonts' is not required, skipping update.
[ +2 ms] [ ] Artifact Instance of 'GradleWrapper' is not required, skipping update.
[ ] [ +5 ms] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[ ] [ ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[ ] [ ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[ +5 ms] [ ] Artifact Instance of 'FlutterSdk' is not required, skipping update.
[ +2 ms] [ ] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[ ] [ ] Artifact Instance of 'WindowsUwpEngineArtifacts' is not required, skipping update.
[ ] [ ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[ ] [ ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[ ] [ ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[ ] [ ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[ +1 ms] [ ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[ ] [ ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[ ] [ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[ ] [ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[ ] [ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[ +5 ms] [ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[ +1 ms] [ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[ ] [ ] Artifact Instance of 'FontSubsetArtifacts' is not required, skipping update.
[ ] [ ] Artifact Instance of 'PubDependencies' is not required, skipping update.
[ ] [ +41 ms] Initializing file store
[ ] [ +12 ms] Done initializing file store
[ ] [ +34 ms] Skipping target: gen_localizations
[ ] [ +10 ms] gen_dart_plugin_registrant: Starting due to {InvalidatedReasonKind.inputChanged: The following inputs have updated contents:
C:\project\flutter\sotrunx2.dart_tool\package_config_subset}
[ +1 ms] [ +42 ms] gen_dart_plugin_registrant: Complete
[ +1 ms] [ +393 ms] kernel_snapshot: Starting due to {InvalidatedReasonKind.inputChanged: The following inputs have updated contents:
C:\project\flutter\sotrunx2.dart_tool\package_config_subset}
[ +1 ms] [ +8 ms] C:\sdk\flutter\bin\cache\dart-sdk\bin\dart.exe --disable-dart-dev
C:\sdk\flutter\bin\cache\artifacts\engine\windows-x64\frontend_server.dart.snapshot --sdk-root C:\sdk\flutter\bin\cache\artifacts\engine\common\flutter_patched_sdk/
--target=flutter --no-print-incremental-dependencies -DFLUTTER_WEB_AUTO_DETECT=true -Ddart.vm.profile=false -Ddart.vm.product=false --enable-asserts
--track-widget-creation --no-link-platform --packages C:\project\flutter\sotrunx2.dart_tool\package_config.json --output-dill
C:\project\flutter\sotrunx2.dart_tool\flutter_build\710bdff7b7b9f665ceac01a927e711dc\app.dill --depfile
C:\project\flutter\sotrunx2.dart_tool\flutter_build\710bdff7b7b9f665ceac01a927e711dc\kernel_snapshot.d package:sotrunx/main.dart
[+7125 ms] [+7450 ms] kernel_snapshot: Complete
[ +191 ms] [ +187 ms] debug_android_application: Starting due to {InvalidatedReasonKind.inputChanged: The following inputs have updated contents:
C:\project\flutter\sotrunx2\pubspec.yaml}
[ +301 ms] [ +265 ms] debug_android_application: Complete
[ +199 ms] [ +229 ms] Persisting file store
[ ] [ +5 ms] Done persisting file store
[ ] [ +5 ms] build succeeded.
[ ] [ +8 ms] "flutter assemble" took 8,842ms.
[ +297 ms] [ +257 ms] ensureAnalyticsSent: 253ms
[ ] [ ] Running shutdown hooks
[ ] [ ] Shutdown hooks complete
[ ] [ ] exiting with code 0
[ +204 ms] > Task :app:packLibsflutterBuildDebug UP-TO-DATE
[ +1 ms] > Task :app:preBuild UP-TO-DATE
[ ] > Task :app:preDebugBuild UP-TO-DATE
[ ] > Task :app:compileDebugAidl NO-SOURCE
[ ] > Task :app:compileDebugRenderscript NO-SOURCE
[ +2 ms] > Task :app:generateDebugBuildConfig UP-TO-DATE
[ ] > Task :app:checkDebugAarMetadata UP-TO-DATE
[ +194 ms] > Task :app:cleanMergeDebugAssets
[ +5 ms] > Task :app:mergeDebugShaders UP-TO-DATE
[ +3 ms] > Task :app:compileDebugShaders NO-SOURCE
[ ] > Task :app:generateDebugAssets UP-TO-DATE
[ +1 ms] > Task :app:mergeDebugAssets
[ +382 ms] > Task :app:copyFlutterAssetsDebug
[ +2 ms] > Task :app:generateDebugResValues UP-TO-DATE
[ ] > Task :app:generateDebugResources UP-TO-DATE
[ ] > Task :app:mergeDebugResources UP-TO-DATE
[ +2 ms] > Task :app:createDebugCompatibleScreenManifests UP-TO-DATE
[ +1 ms] > Task :app:extractDeepLinksDebug UP-TO-DATE
[ +1 ms] > Task :app:processDebugMainManifest UP-TO-DATE
[ ] > Task :app:processDebugManifest UP-TO-DATE
[ ] > Task :app:processDebugManifestForPackage UP-TO-DATE
[ +97 ms] > Task :app:processDebugResources UP-TO-DATE
[ +2 ms] > Task :app:compileDebugKotlin UP-TO-DATE
[ +1 ms] > Task :app:javaPreCompileDebug UP-TO-DATE
[ ] > Task :app:compileDebugJavaWithJavac UP-TO-DATE
[ ] > Task :app:compileDebugSources UP-TO-DATE
[ +3 ms] > Task :app:mergeDebugNativeDebugMetadata NO-SOURCE
[ ] > Task :app:compressDebugAssets UP-TO-DATE
[ ] > Task :app:processDebugJavaRes NO-SOURCE
[ ] > Task :app:mergeDebugJavaResource UP-TO-DATE
[ ] > Task :app:checkDebugDuplicateClasses UP-TO-DATE
[ +83 ms] > Task :app:dexBuilderDebug UP-TO-DATE
[ +4 ms] > Task :app:desugarDebugFileDependencies UP-TO-DATE
[ +6 ms] > Task :app:mergeExtDexDebug UP-TO-DATE
[ +5 ms] > Task :app:mergeDexDebug UP-TO-DATE
[ +90 ms] > Task :app:mergeDebugJniLibFolders UP-TO-DATE
[ +4 ms] > Task :app:mergeDebugNativeLibs UP-TO-DATE
[ +2 ms] > Task :app:stripDebugDebugSymbols UP-TO-DATE
[ ] > Task :app:validateSigningDebug UP-TO-DATE
[ ] > Task :app:packageDebug UP-TO-DATE
[ +83 ms] > Task :app:assembleDebug
[ +2 ms] Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
[ +2 ms] Use '--warning-mode all' to show the individual deprecation warnings.
[ ] See https://docs.gradle.org/6.7/userguide/command_line_interface.html#sec:command_line_warnings
[ ] BUILD SUCCESSFUL in 13s
[ ] 32 actionable tasks: 5 executed, 27 up-to-date
[ +545 ms] Running Gradle task 'assembleDebug'... (completed in 14.6s)
[ +4 ms] LocalFile: 'C:\project\flutter\sotrunx2\android\build.gradle' provides AGP version: 4.1.0
[ +3 ms] Exception: Gradle build failed to produce an .apk file. It's likely that this file was generated under C:\project\flutter\sotrunx2\build, but the tool
couldn't find
it.
[ +2 ms] "flutter run" took 15,584ms.
[ +3 ms]
#0 throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
#1 RunCommand.runCommand (package:flutter_tools/src/commands/run.dart:684:9)
#2 FlutterCommand.run. (package:flutter_tools/src/runner/flutter_command.dart:1161:27)
#3 AppContext.run. (package:flutter_tools/src/base/context.dart:150:19)
#4 CommandRunner.runCommand (package:args/command_runner.dart:209:13)
#5 FlutterCommandRunner.runCommand. (package:flutter_tools/src/runner/flutter_command_runner.dart:281:9)
#6 AppContext.run. (package:flutter_tools/src/base/context.dart:150:19)
#7 FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:229:5)
#8 run.. (package:flutter_tools/runner.dart:62:9)
#9 AppContext.run. (package:flutter_tools/src/base/context.dart:150:19)
#10 main (package:flutter_tools/executable.dart:94:3)
[ +112 ms] ensureAnalyticsSent: 110ms
[ +3 ms] Running shutdown hooks
[ +2 ms] Shutdown hooks complete
[ ] exiting with code 1
PS C:\project\flutter\sotrunx2>
PS C:\project\flutter\sotrunx2> flutter doctor
Flutter assets will be downloaded from https://storage.flutter-io.cn. Make sure you trust this source!
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel master, 2.9.0-1.0.pre.140, on Microsoft Windows [Version 10.0.19042.1348], locale zh-CN)
[√] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
[√] Chrome - develop for the web
[√] Visual Studio - develop for Windows (Visual Studio Professional 2022 17.0.3)
[√] Android Studio (version 2020.3)
[√] Android Studio (version 2021.1)
[√] IntelliJ IDEA Community Edition (version 2020.3)
[☠] IntelliJ IDEA Community Edition (the doctor check crashed)
X Due to an error, the doctor check did not complete. If the error message below is not helpful, please let us know about this issue at
https://github.com/flutter/flutter/issues.
X FormatException: Unexpected extension byte (at offset 5)
[√] VS Code (version 1.63.2)
[√] Connected device (4 available)
|
