HarmonyOS ArkTS侧引入react-native-svg组件,真机运行报错

报错:

> hvigor ERROR: Failed :entry:default@BuildNativeWithCmake...
> hvigor ERROR: Exceptions happened while executing: CMake Warning (dev) at CMakeLists.txt:1 (project):
cmake_minimum_required() should be called prior to this top-level project()
call.  Please see the cmake-commands(7) manual for usage documentation of
both commands.
This warning is for project developers.  Use -Wno-dev to suppress it.
Not searching for unused variables given on the command line.
CMake Deprecation Warning at CMakeLists.txt:2 (cmake_minimum_required):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
CMake Deprecation Warning at /Users/xxx/Desktop/app/MyApplication/entry/oh_modules/@rnoh/react-native-openharmony/src/main/cpp/CMakeLists.txt:1 (cmake_minimum_required):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
CMake Deprecation Warning at /Users/xxx/Desktop/app/MyApplication/entry/oh_modules/@rnoh/react-native-openharmony/src/main/cpp/third-party/boost/libs/predef/CMakeLists.txt:23 (cmake_minimum_required):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
-- Boost.Context: architecture arm64, binary format elf, ABI aapcs, assembler gas, suffix .S, implementation fcontext
Experimental C-API architecture enabled
CMake Error at CMakeLists.txt:19 (add_subdirectory):
add_subdirectory given source
"/@react-native-oh-tpl/react-native-svg/src/main/cpp" which is not an
existing directory.

-- Configuring incomplete, errors occurred!
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
HarmonyOS
2025-01-10 09:06:12
浏览
收藏 0
回答 1
回答 1
按赞同
/
按时间
Excelsior_abit

检查CMakeLists.txt里,add_subdirectory后面的路径,如果直接复制的文档内容,${OH_MODULES} 要确保正确定义,检查一下它的名字和路径。

建议切换程CAPI版本:https://gitee.com/react-native-oh-library/usage-docs/blob/master/zh-cn/react-native-svg-capi.md

ArkTS版本记得将SVG_VIEW_TYPE_NAME加到ArkTSComponentNames参数里。

分享
微博
QQ
微信
回复
2025-01-10 11:44:12


相关问题
HarmonyOS react-native-svg(CAPI)使用报错
510浏览 • 1回复 待解决
HarmonyOS升级后,react-native-svg闪退
485浏览 • 1回复 待解决
HarmonyOS 机运行报错如何解决
1075浏览 • 1回复 待解决
机运行http请求没有返回
4912浏览 • 1回复 待解决
机运行,UDID不存在
6644浏览 • 1回复 待解决
华为 watch 3 怎么机运行
10998浏览 • 3回复 待解决
arktshashmap转为native
1425浏览 • 1回复 待解决
Native如何引入头文件deviceinfo.h
2566浏览 • 1回复 待解决
native如何跟ArkTS子线程通信
464浏览 • 1回复 待解决