Windows build fail
🐛 Bug Report
Commit c04dd43 build fail
Expected behavior
build pass
Reproduction steps
build code
Please remove "ARGS install "Microsoft.Windows.CppWinRT" -Version 2.0.210503.1 -ExcludeVersion -OutputDirectory ${CMAKE_BINARY_DIR}/packages)" in Windows\CMakeLists.txt
Platform: Windows
https://github.com/dlutton/flutter_tts/pull/591
Same problem. Cannot build Windows version. Get error
CMake Error at flutter/ephemeral/.plugin_symlinks/flutter_tts/windows/CMakeLists.txt:18: Parse error. Expected "(", got identifier with text "install".
I get the same error on versions 4.0.0 and 4.2.3 (the error does not appear in 3.8.0):
Launching lib\main.dart on Windows in debug mode...
Building Windows application...
CMake Error at flutter/ephemeral/.plugin_symlinks/flutter_tts/windows/CMakeLists.txt:18:
Parse error. Expected "(", got identifier with text "install".
Error: Unable to generate build files
Thanks Christian. I'll try reverting to 3.8.0 until the problem is fixed.
change them like this:
################ NuGet install begin ################
find_program(NUGET_EXE NAMES nuget)
if(NOT NUGET_EXE)
message("NUGET.EXE not found.")
message(FATAL_ERROR "Please install this executable, and run CMake again.")
endif()
execute_process(
COMMAND ${NUGET_EXE}
install
Microsoft.Windows.CppWinRT
-Version 2.0.210503.1
-ExcludeVersion
-OutputDirectory ${CMAKE_BINARY_DIR}/packages
)
################ NuGet install end ################
@Metaildust If you do have an idea of how the fix works, how about create a pull request?
+1
v4.2.3
fix pls
fix pls
done
I have built using:
flutter_tts:
git:
url: https://github.com/Metaildust/flutter_tts.git
ref: patch-1
flutter clean
flutter build windows
But I get unresolved external symbols:
flutter_tts_plugin.obj : error LNK2019: unresolved external symbol WINRT_IMPL_RoGetActivationFactory referenced in function "struct winrt::hresult __cdecl winrt::impl::get_runtime_activation_factory_impl<1>(struct winrt::param::hstring const &,struct winrt::guid const &,void * *)" (??$get_runtime_activation_factory_impl@$00@impl@winrt@@YA?AUhresult@1@AEBUhstring@param@1@AEBUguid@1@PEAPEAX@Z) [C:\Users\xyz\my_app\build\windows\x64\plugins\flutter_tts\flutter_tts_plugin.vcxproj]
...
Has other people been able to use the Metaildust branch and get building to work?
@lea108 I solved this by adding windowsapp to the CMakeLists.txt files
in windows\runner\CMakeLists.txt
add target_link_libraries(${BINARY_NAME} PRIVATE windowsapp)
after target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app)
in windows\flutter\ephemeral\.plugin_symlinks\flutter_tts\windows\CMakeLists.txt
and target_link_libraries(${PLUGIN_NAME} PRIVATE windowsapp)
after target_link_libraries(${PLUGIN_NAME} PRIVATE flutter flutter_wrapper_plugin)
note: Folders in the .plugin_symlinks directory are symbolic links to packages located at C:\Users\<your-username>\AppData\Local\Pub\Cache\hosted\pub.dev. This means that if you change the version of flutter_tts, the linked folder may be replaced with a new version that does not include your changes
change them like this:
################ NuGet install begin ################ find_program(NUGET_EXE NAMES nuget) if(NOT NUGET_EXE) message("NUGET.EXE not found.") message(FATAL_ERROR "Please install this executable, and run CMake again.") endif() execute_process( COMMAND ${NUGET_EXE} install Microsoft.Windows.CppWinRT -Version 2.0.210503.1 -ExcludeVersion -OutputDirectory ${CMAKE_BINARY_DIR}/packages ) ################ NuGet install end ################
This does solve the problem. If someone is wondering how to use this (like I was), find CMakeLists.txt (In your project: windows/flutter/ephemeral/.plugin_symlinks/flutter_tts/windows/CMakeLists.txt), then change it like described above (or simply remove/comment:
ARGS install "Microsoft.Windows.CppWinRT" -Version 2.0.210503.1 -ExcludeVersion -OutputDirectory ${CMAKE_BINARY_DIR}/packages)
).
I had this problem when using the most recent version of flutter_tts (4.2.3 at the time of this writing).
Please fix this.
build once first then change CMakeLists.txt like i've shown above it will work > Please fix this.
Please fix this. Thanks 🙏
Please fix this. Thanks 🙏
any fix?