Tencent-RTC / TRTC_Flutter

High-quality Interactive Audio/Video Flutter SDK
https://trtc.io/
74 stars 34 forks source link

【windows】-【2.3.5】windows 编译失败 #58

Closed ryanaltair closed 1 year ago

ryanaltair commented 2 years ago

【当前现象】:windows编译失败, 【问题时间段】:2019-09-01 16:23~16:55 【机型】:windows11 【之前版本有无此问题】:2.3.0无此问题 【是否必现】:必现, 【复现方法】:clone 本项目,将trtc版本写死为2.3.5,flutter run -d windows 则编译报错,版本降至2.3.0,则编译正常。 【日志或者描述、截图】:

flutter doctor -v
[√] Flutter (Channel stable, 3.3.0, on Microsoft Windows [Version 10.0.22000.856], locale zh-CN)
    • Flutter version 3.3.0 on channel stable at C:\src\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision ffccd96b62 (3 days ago), 2022-08-29 17:28:57 -0700
    • Engine revision 5e9e0e0aa8
    • Dart version 2.18.0
    • DevTools version 2.15.0

[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.3.3)
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
    • Visual Studio Community 2022 version 17.3.32825.248
    • Windows 10 SDK version 10.0.19041.0

[√] VS Code (version 1.71.0)
    • VS Code at C:\Users\xx\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.48.0

[√] Proxy Configuration
    • HTTP_PROXY is set
    • NO_PROXY is 127.0.0.1;localhost;::1
    • NO_PROXY contains localhost
    • NO_PROXY contains ::1
    • NO_PROXY contains 127.0.0.1

[√] Connected device (1 available)
    • Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.22000.856]

HTTP Host availability check is taking a long time...[!] HTTP Host Availability
    X HTTP host "https://pub.dev/" is not reachable. Reason: An error occurred while checking the HTTP host: Connection terminated during handshake

! Doctor found issues in 1 category.
PS C:\Users\xx\github\xx> flutter doctor -v
[√] Flutter (Channel stable, 3.3.0, on Microsoft Windows [Version 10.0.22000.856], locale zh-CN)
    • Flutter version 3.3.0 on channel stable at C:\src\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision ffccd96b62 (3 days ago), 2022-08-29 17:28:57 -0700
    • Engine revision 5e9e0e0aa8
    • Dart version 2.18.0
    • DevTools version 2.15.0

[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.3.3)
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
    • Visual Studio Community 2022 version 17.3.32825.248
    • Windows 10 SDK version 10.0.19041.0

[√] VS Code (version 1.71.0)
    • VS Code at C:\Users\xx\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.48.0

[√] Proxy Configuration
    • HTTP_PROXY is set
    • NO_PROXY is 127.0.0.1;localhost;::1
    • NO_PROXY contains localhost
    • NO_PROXY contains ::1
    • NO_PROXY contains 127.0.0.1

[√] Connected device (1 available)
    • Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.22000.856]
[  +32 ms] Building Windows application... (completed in 12.4s)
[  +43 ms] Error waiting for a debug connection: The log reader stopped unexpectedly, or never started.
[   +2 ms] Error launching application on Windows.
[+2685 ms] "flutter run" took 15,813ms.
[   +2 ms] 
           #0      throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
           #1      RunCommand.runCommand (package:flutter_tools/src/commands/run.dart:713:9)
           <asynchronous suspension>
           #2      FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1209:27)
           <asynchronous suspension>
           #3      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
           <asynchronous suspension>
           #4      CommandRunner.runCommand (package:args/command_runner.dart:209:13)
           <asynchronous suspension>
           #5      FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:281:9)
           <asynchronous suspension>
           #6      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
           <asynchronous suspension>
           #7      FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:229:5)
           <asynchronous suspension>
           #8      run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:62:9)
           <asynchronous suspension>
           #9      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
           <asynchronous suspension>
           #10     main (package:flutter_tools/executable.dart:91:3)
           <asynchronous suspension>

[   +3 ms] Running shutdown hooks
[        ] Shutdown hooks complete
[        ] exiting with code 1
c1avie commented 2 years ago

https://github.com/LiteAVSDK/TRTC_Flutter/blob/master/TRTC-Simple-Demo/README-zh_CN.md 看下windwos调试那里

ryanaltair commented 2 years ago

请在 windows 构建代码中,自动添加相关dll文件 🙏🙏🙏

请尝试如此做 将 windows/CMakeLists.txt 中,


set(tencent_trtc_cloud_bundled_libraries
  "${CMAKE_CURRENT_SOURCE_DIR}/lib/txsoundtouch.dll"
  PARENT_SCOPE
)
set(tencent_trtc_cloud_bundled_libraries
  "${CMAKE_CURRENT_SOURCE_DIR}/lib/txffmpeg.dll"
  PARENT_SCOPE
)
set(tencent_trtc_cloud_bundled_libraries
  "${CMAKE_CURRENT_SOURCE_DIR}/lib/liteav.dll"
  PARENT_SCOPE
)

上述代码仅重复定义tencent_trtc_cloud_bundled_libraries参数

改为

set(tencent_trtc_cloud_bundled_libraries
 "${CMAKE_CURRENT_SOURCE_DIR}/lib/txsoundtouch.dll;${CMAKE_CURRENT_SOURCE_DIR}/lib/txffmpeg.dll;${CMAKE_CURRENT_SOURCE_DIR}/lib/liteav.dll"
  PARENT_SCOPE
)

参考

# List of absolute paths to libraries that should be bundled with the plugin
set(<name>_bundled_libraries
  "${CMAKE_CURRENT_SOURCE_DIR}/../native/lib/windows_x64/mylib_dylib.dll;${CMAKE_CURRENT_SOURCE_DIR}/../native/lib/windows_x64/mylib_dylib_dependency.dll"
  PARENT_SCOPE
)
c1avie commented 2 years ago

收到,我看看

c1avie commented 2 years ago

tencent_trtc_cloud: 2.3.8 已加