flutter / flutter

Flutter makes it easy and fast to build beautiful apps for mobile and beyond
https://flutter.dev
BSD 3-Clause "New" or "Revised" License
166.45k stars 27.59k forks source link

Build linux failed by INSTALL not found "native_assets/linux" #159199

Open shilkazx opened 1 day ago

shilkazx commented 1 day ago

Steps to reproduce

'flutter build linux' will trigger this bug. I've tried 'flutter clean' or create a sample project but this bug still occurred.

Expected results

build successfully just as 'flutter build apk' does.

Actual results

CMake Error at cmake_install.cmake:112 (file):
  file INSTALL cannot find "/home/....../build/native_assets/linux": No such
  file or directory.

Code sample

Code sample ```dart [Paste your code here] ```

Screenshots or Video

Screenshots / Video demonstration [Upload media here]

Logs

Logs ```console [Paste your logs here] ```

Flutter Doctor output

Doctor output ```console Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, 3.24.5, on Arch Linux 6.11.9-zen1-1-zen, locale en_US.UTF-8) [!] Android toolchain - develop for Android devices (Android SDK version 34.0.0) ! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses [✓] Chrome - develop for the web [✓] Linux toolchain - develop for Linux desktop [!] Android Studio (not installed) [✓] IntelliJ IDEA Ultimate Edition (version 2024.3) [✓] Connected device (2 available) [✓] Network resources ```
huycozy commented 1 day ago

Hi @shilkazx Does this issue also appear with flutter run command? Can you please share the entire output of running command with verbose? (flutter run -v or flutter build linux -v) [^1]

[^1]: The output may be too large to be uploaded to GitHub, you may upload it as a txt file or use online tools like https://pastebin.com/ to share it.

shilkazx commented 1 day ago

Hi @shilkazx Does this issue also appear with flutter run command? Can you please share the entire output of running command with verbose? (flutter run -v or flutter build linux -v) 1

Footnotes

1. The output may be too large to be uploaded to GitHub, you may upload it as a txt file or use online tools like https://pastebin.com/ to share it. [↩](#user-content-fnref-1-c981bb592aae5e63f6907a8701d844c0)

Sure, the flutter run failed as same as flutter build linux. And the verbose output is:

flutter build linux -v      
[  +11 ms] executing: uname -m
[   +8 ms] Exit code 0 from: uname -m
[        ] x86_64
[  +31 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.
[        ] Artifact Instance of 'LegacyCanvasKitRemover' is not required, skipping update.
[        ] Artifact Instance of 'WindowsEngineArtifacts' 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.
[        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[   +1 ms] Flutter assets will be downloaded from https://mirrors.tuna.tsinghua.edu.cn/flutter. Make sure you trust this source!
[  +27 ms] Artifact Instance of 'MaterialFonts' is not required, skipping update.
[        ] Artifact Instance of 'GradleWrapper' is not required, skipping update.
[        ] 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.
[        ] Artifact Instance of 'LegacyCanvasKitRemover' is not required, skipping update.
[        ] Artifact Instance of 'FlutterSdk' is not required, skipping update.
[        ] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[  +13 ms] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[        ] 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.
[        ] 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.
[        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ] 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.
[  +34 ms] Skipping pub get: version match.
[  +86 ms] Generating /home/user/Nutstore/project/flutter/xuan/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java
[  +61 ms] Building Linux application...
[   +3 ms] executing: [~/.cache/gradle_build/linux/x64/release/] cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DFLUTTER_TARGET_PLATFORM=linux-x64 /home/user/Nutstore/project/flutter/xuan/linux
[  +38 ms] -- Configuring done (0.0s)
[   +8 ms] -- Generating done (0.0s)
[        ] -- Build files have been written to: /home/user/Nutstore/project/flutter/xuan/~/.cache/gradle_build/linux/x64/release
[  +18 ms] executing: ninja -C ~/.cache/gradle_build/linux/x64/release install
[  +14 ms] ninja: Entering directory `~/.cache/gradle_build/linux/x64/release'
[+1134 ms] [1/5] Generating /home/user/Nutstore/project/flutter/xuan/linux/flutter/ephemeral/libflutter_linux_gtk.so, /home/user/Nutstore
Files/Nutstore/project/flutter/xuan/linux/flutter/ephemeral/flutter_linux/fl_basic_message_channel.h, /home/user/Nutstore
Files/Nutstore/project/flutter/xuan/linux/flutter/ephemeral/flutter_linux/fl_binary_codec.h, /home/user/Nutstore
Files/Nutstore/project/flutter/xuan/linux/flutter/ephemeral/flutter_linux/fl_binary_messenger.h, /home/user/Nutstore
Files/Nutstore/project/flutter/xuan/linux/flutter/ephemeral/flutter_linux/fl_dart_project.h, /home/user/Nutstore/project/flutter/xuan/linux/flutter/ephemeral/flutter_linux/fl_engine.h,
/home/user/Nutstore/project/flutter/xuan/linux/flutter/ephemeral/flutter_linux/fl_json_message_codec.h, /home/user/Nutstore
Files/Nutstore/project/flutter/xuan/linux/flutter/ephemeral/flutter_linux/fl_json_method_codec.h, /home/user/Nutstore
Files/Nutstore/project/flutter/xuan/linux/flutter/ephemeral/flutter_linux/fl_message_codec.h, /home/user/Nutstore/project/flutter/xuan/linux/flutter/ephemeral/flutter_linux/fl_method_call.h,
/home/user/Nutstore/project/flutter/xuan/linux/flutter/ephemeral/flutter_linux/fl_method_channel.h, /home/user/Nutstore
Files/Nutstore/project/flutter/xuan/linux/flutter/ephemeral/flutter_linux/fl_method_codec.h, /home/user/Nutstore/project/flutter/xuan/linux/flutter/ephemeral/flutter_linux/fl_method_response.h,
/home/user/Nutstore/project/flutter/xuan/linux/flutter/ephemeral/flutter_linux/fl_plugin_registrar.h, /home/user/Nutstore
Files/Nutstore/project/flutter/xuan/linux/flutter/ephemeral/flutter_linux/fl_plugin_registry.h, /home/user/Nutstore
Files/Nutstore/project/flutter/xuan/linux/flutter/ephemeral/flutter_linux/fl_standard_message_codec.h, /home/user/Nutstore
Files/Nutstore/project/flutter/xuan/linux/flutter/ephemeral/flutter_linux/fl_standard_method_codec.h, /home/user/Nutstore
Files/Nutstore/project/flutter/xuan/linux/flutter/ephemeral/flutter_linux/fl_string_codec.h, /home/user/Nutstore/project/flutter/xuan/linux/flutter/ephemeral/flutter_linux/fl_value.h,
/home/user/Nutstore/project/flutter/xuan/linux/flutter/ephemeral/flutter_linux/fl_view.h, /home/user/Nutstore
Files/Nutstore/project/flutter/xuan/linux/flutter/ephemeral/flutter_linux/flutter_linux.h, _phony_
[   +3 ms] [   +7 ms] executing: uname -m
[        ] [   +5 ms] Exit code 0 from: uname -m
[        ] [        ] x86_64
[        ] [  +26 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.
[        ] [        ] Artifact Instance of 'LegacyCanvasKitRemover' is not required, skipping update.
[        ] [        ] Artifact Instance of 'WindowsEngineArtifacts' 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.
[        ] [        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[        ] [        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[        ] [   +1 ms] Flutter assets will be downloaded from https://mirrors.tuna.tsinghua.edu.cn/flutter. Make sure you trust this source!
[        ] [  +48 ms] Artifact Instance of 'MaterialFonts' is not required, skipping update.
[        ] [        ] Artifact Instance of 'GradleWrapper' is not required, skipping update.
[        ] [        ] 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.
[        ] [        ] Artifact Instance of 'LegacyCanvasKitRemover' is not required, skipping update.
[        ] [        ] Artifact Instance of 'FlutterSdk' is not required, skipping update.
[        ] [        ] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[        ] [        ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[        ] [        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[        ] [        ] 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.
[        ] [        ] 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.
[        ] [        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ] [        ] 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.
[        ] [  +34 ms] Initializing file store
[        ] [   +5 ms] Done initializing file store
[        ] [  +31 ms] Skipping target: gen_localizations
[        ] [   +4 ms] Skipping target: gen_dart_plugin_registrant
[        ] [ +130 ms] Skipping target: unpack_linux
[        ] [ +177 ms] Skipping target: kernel_snapshot_program
[        ] [   +1 ms] Skipping target: native_assets
[        ] [        ] Skipping target: kernel_snapshot_native_assets
[        ] [        ] Skipping target: kernel_snapshot
[        ] [ +107 ms] Skipping target: aot_elf_release
[        ] [  +17 ms] Skipping target: linux_aot_bundle
[        ] [  +21 ms] Skipping target: release_bundle_linux-x64_assets
[        ] [        ] Persisting file store
[        ] [   +3 ms] Done persisting file store
[        ] [   +2 ms] build succeeded.
[        ] [   +3 ms] "flutter assemble" took 601ms.
[        ] [ +252 ms] ensureAnalyticsSent: 229ms
[        ] [        ] Running 1 shutdown hook
[        ] [        ] Shutdown hooks complete
[        ] [   +3 ms] exiting with code 0
[ +285 ms] [2/5] Building CXX object CMakeFiles/xuan.dir/flutter/generated_plugin_registrant.cc.o
[  +33 ms] [3/5] Building CXX object CMakeFiles/xuan.dir/my_application.cc.o
[  +76 ms] [4/5] Linking CXX executable intermediates_do_not_run/xuan
[        ] [4/5] Install the project...
[   +7 ms] -- Install configuration: "Release"
[   +1 ms] -- Installing: /home/user/Nutstore/project/flutter/xuan/~/.cache/gradle_build/linux/x64/release/bundle/xuan
[        ] -- Set non-toolchain portion of runtime path of "/home/user/Nutstore/project/flutter/xuan/~/.cache/gradle_build/linux/x64/release/bundle/xuan" to "$ORIGIN/lib"
[        ] -- Installing: /home/user/Nutstore/project/flutter/xuan/~/.cache/gradle_build/linux/x64/release/bundle/data/icudtl.dat
[        ] -- Installing: /home/user/Nutstore/project/flutter/xuan/~/.cache/gradle_build/linux/x64/release/bundle/lib/libflutter_linux_gtk.so
[   +7 ms] CMake Error at cmake_install.cmake:112 (file):
[        ]   file INSTALL cannot find "/home/user/Nutstore
[        ]   Files/Nutstore/project/flutter/xuan/build/native_assets/linux": No such
[        ]   file or directory.
[        ] FAILED: CMakeFiles/install.util 
[        ] cd "/home/user/Nutstore/project/flutter/xuan/~/.cache/gradle_build/linux/x64/release" && /usr/bin/cmake -P cmake_install.cmake
[        ] ninja: build stopped: subcommand failed.
[   +8 ms] Building Linux application... (completed in 1,640ms)
[        ] "flutter linux" took 1,885ms.
[  +24 ms] Build process failed
[        ] 
           #0      throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
           #1      _runBuild (package:flutter_tools/src/linux/build_linux.dart:210:5)
           <asynchronous suspension>
           #2      buildLinux (package:flutter_tools/src/linux/build_linux.dart:83:5)
           <asynchronous suspension>
           #3      BuildLinuxCommand.runCommand (package:flutter_tools/src/commands/build_linux.dart:87:5)
           <asynchronous suspension>
           #4      FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1408:27)
           <asynchronous suspension>
           #5      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:19)
           <asynchronous suspension>
           #6      CommandRunner.runCommand (package:args/command_runner.dart:212:13)
           <asynchronous suspension>
           #7      FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:420:9)
           <asynchronous suspension>
           #8      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:19)
           <asynchronous suspension>
           #9      FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:364:5)
           <asynchronous suspension>
           #10     run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:130:9)
           <asynchronous suspension>
           #11     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:19)
           <asynchronous suspension>
           #12     main (package:flutter_tools/executable.dart:93:3)
           <asynchronous suspension>

[ +136 ms] ensureAnalyticsSent: 134ms
[        ] Running 1 shutdown hook
[   +1 ms] Shutdown hooks complete
[   +4 ms] exiting with code 1
darshankawar commented 7 hours ago

Can you try this to see if it helps in your case or not ?