Flutter任务“:iris_method_channel:buildCMakeDebug[arm64-v8a]”执行失败。

huangapple go评论78阅读模式
英文:

Flutter Execution failed for task ':iris_method_channel:buildCMakeDebug[arm64-v8a]'

问题

由于以下异常,无法运行Flutter应用程序。

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':iris_method_channel:buildCMakeDebug[arm64-v8a]'.
> com.android.ide.common.process.ProcessException: ninja: Entering directory `/home/muhammad/.pub-cache/hosted/pub.dev/iris_method_channel-1.1.0-rc.5/android/.cxx/Debug/2i83q535/arm64-v8a'
  [1/2] Building CXX object CMakeFiles/iris_method_channel.dir/iris_event.cc.o
  FAILED: CMakeFiles/iris_method_channel.dir/iris_event.cc.o 
  /home/muhammad/Android/Sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ --target=aarch64-none-linux-android21 --gcc-toolchain=/home/muhammad/Android/Sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/linux-x86_64 --sysroot=/home/muhammad/Android/Sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/linux-x86_64/sysroot -DDART_SHARED_LIB -Diris_method_channel_EXPORTS  -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security   -fno-limit-debug-info  -fPIC -MD -MT CMakeFiles/iris_method_channel.dir/iris_event.cc.o -MF CMakeFiles/iris_method_channel.dir/iris_event.cc.o.d -o CMakeFiles/iris_method_channel.dir/iris_event.cc.o -c /home/muhammad/.pub-cache/hosted/pub.dev/iris_method_channel-1.1.0-rc.5/src/iris_event.cc
  In file included from /home/muhammad/.pub-cache/hosted/pub.dev/iris_method_channel-1.1.0-rc.5/src/iris_event.cc:6:
  /snap/flutter/current/usr/include/c++/9/memory:121:25: error: cast from pointer to smaller type 'uintptr_t' (aka 'unsigned int') loses information
    const auto __intptr = reinterpret_cast<uintptr_t>(__ptr);
                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  /home/muhammad/.pub-cache/hosted/pub.dev/iris_method_channel-1.1.0-rc.5/src/iris_event.cc:90:17: error: use of undeclared identifier 'memcpy'; did you mean 'wmemcpy'?
                  memcpy(abuffer, obuffer, abufferLength);
                  ^~~~~~
                  wmemcpy
  /snap/flutter/current/usr/include/wchar.h:262:17: note: 'wmemcpy' declared here
  extern wchar_t *wmemcpy (wchar_t *__restrict __s1,
                  ^
  /home/muhammad/.pub-cache/hosted/pub.dev/iris_method_channel-1.1.0-rc.5/src/iris_event.cc:90:24: error: cannot initialize a parameter of type 'wchar_t *' with an lvalue of type 'uint8_t *' (aka 'unsigned char *')
                  memcpy(abuffer, obuffer, abufferLength);
                         ^~~~~~~
  /snap/flutter/current/usr/include/wchar.h:262:46: note: passing argument to parameter '__s1' here
  extern wchar_t *wmemcpy (wchar_t *__restrict __s1,
                                               ^
  3 errors generated.
  ninja: build stopped: subcommand failed.

  C++ build system [build] failed while executing:
      /home/muhammad/Android/Sdk/cmake/3.18.1/bin/ninja \
        -C \
        /home/muhammad/.pub-cache/hosted/pub.dev/iris_method_channel-1.1.0-rc.5/android/.cxx/Debug/2i83q535/arm64-v8a \
        iris_method_channel
    from /home/muhammad/.pub-cache/hosted/pub.dev/iris_method_channel-1.1.0-rc.5/android

* 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 2m 18s
Exception: Gradle task assembleDebug failed with exit code 1
  • iris_method_channel被agora_rtc_engine使用。
  • 我使用的agora_rtc_engine版本是^6.1.1
  • 我也已经更新了Flutter,尝试了许多方法但没有结果。
英文:

Unable to run flutter app due to following exception.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task &#39;:iris_method_channel:buildCMakeDebug[arm64-v8a]&#39;.
&gt; com.android.ide.common.process.ProcessException: ninja: Entering directory `/home/muhammad/.pub-cache/hosted/pub.dev/iris_method_channel-1.1.0-rc.5/android/.cxx/Debug/2i83q535/arm64-v8a&#39;
  [1/2] Building CXX object CMakeFiles/iris_method_channel.dir/iris_event.cc.o
  FAILED: CMakeFiles/iris_method_channel.dir/iris_event.cc.o 
  /home/muhammad/Android/Sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ --target=aarch64-none-linux-android21 --gcc-toolchain=/home/muhammad/Android/Sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/linux-x86_64 --sysroot=/home/muhammad/Android/Sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/linux-x86_64/sysroot -DDART_SHARED_LIB -Diris_method_channel_EXPORTS  -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security   -fno-limit-debug-info  -fPIC -MD -MT CMakeFiles/iris_method_channel.dir/iris_event.cc.o -MF CMakeFiles/iris_method_channel.dir/iris_event.cc.o.d -o CMakeFiles/iris_method_channel.dir/iris_event.cc.o -c /home/muhammad/.pub-cache/hosted/pub.dev/iris_method_channel-1.1.0-rc.5/src/iris_event.cc
  In file included from /home/muhammad/.pub-cache/hosted/pub.dev/iris_method_channel-1.1.0-rc.5/src/iris_event.cc:6:
  /snap/flutter/current/usr/include/c++/9/memory:121:25: error: cast from pointer to smaller type &#39;uintptr_t&#39; (aka &#39;unsigned int&#39;) loses information
    const auto __intptr = reinterpret_cast&lt;uintptr_t&gt;(__ptr);
                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  /home/muhammad/.pub-cache/hosted/pub.dev/iris_method_channel-1.1.0-rc.5/src/iris_event.cc:90:17: error: use of undeclared identifier &#39;memcpy&#39;; did you mean &#39;wmemcpy&#39;?
                  memcpy(abuffer, obuffer, abufferLength);
                  ^~~~~~
                  wmemcpy
  /snap/flutter/current/usr/include/wchar.h:262:17: note: &#39;wmemcpy&#39; declared here
  extern wchar_t *wmemcpy (wchar_t *__restrict __s1,
                  ^
  /home/muhammad/.pub-cache/hosted/pub.dev/iris_method_channel-1.1.0-rc.5/src/iris_event.cc:90:24: error: cannot initialize a parameter of type &#39;wchar_t *&#39; with an lvalue of type &#39;uint8_t *&#39; (aka &#39;unsigned char *&#39;)
                  memcpy(abuffer, obuffer, abufferLength);
                         ^~~~~~~
  /snap/flutter/current/usr/include/wchar.h:262:46: note: passing argument to parameter &#39;__s1&#39; here
  extern wchar_t *wmemcpy (wchar_t *__restrict __s1,
                                               ^
  3 errors generated.
  ninja: build stopped: subcommand failed.

  C++ build system [build] failed while executing:
      /home/muhammad/Android/Sdk/cmake/3.18.1/bin/ninja \
        -C \
        /home/muhammad/.pub-cache/hosted/pub.dev/iris_method_channel-1.1.0-rc.5/android/.cxx/Debug/2i83q535/arm64-v8a \
        iris_method_channel
    from /home/muhammad/.pub-cache/hosted/pub.dev/iris_method_channel-1.1.0-rc.5/android

* Try:
&gt; Run with --stacktrace option to get the stack trace.
&gt; Run with --info or --debug option to get more log output.
&gt; Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 2m 18s
Exception: Gradle task assembleDebug failed with exit code 1
  • iris_method_channel is used by agora_rtc_engine.

  • I am using

     agora_rtc_engine: ^6.1.1
    
  • I have updated my flutter as well. Tried many things but no result
    found

答案1

得分: 2

安装Flutter SDK手动(请参阅文档)解决了Ubuntu上的问题。

所有的功劳归功于这个答案

英文:

Installing the Flutter SDK manually (see docs) resolved the issue in Ubuntu.

All the credit goes to this answer.

huangapple
  • 本文由 发表于 2023年5月17日 16:59:24
  • 转载请务必保留本文链接:https://go.coder-hub.com/76270292.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定