react-native-oh-library / react-native-amap3d

react-native 高德地图组件,使用最新 3D SDK,支持 HarmonyOS
https://qiuxiang.github.io/react-native-amap3d/api/
MIT License
0 stars 1 forks source link

按文档操作编译报错 #42

Open qilovehua opened 3 hours ago

qilovehua commented 3 hours ago

描述 / Description

/Applications/DevEco-Studio.app/Contents/tools/node/bin/node /Applications/DevEco-Studio.app/Contents/tools/hvigor/bin/hvigorw.js --mode module -p module=entry@default -p product=default -p requiredDeviceType=phone assembleHap --analyze=normal --parallel --incremental --daemon

hvigor UP-TO-DATE :entry:default@PreBuild...
hvigor UP-TO-DATE :entry:default@GenerateMetadata...
hvigor Finished :entry:default@ConfigureCmake... after 21 ms hvigor UP-TO-DATE :entry:default@MergeProfile...
hvigor UP-TO-DATE :entry:default@CreateBuildProfile...
hvigor Finished :entry:default@PreCheckSyscap... after 1 ms hvigor Finished :entry:default@ProcessIntegratedHsp... after 1 ms hvigor Finished :entry:default@BuildNativeWithCmake... after 4 ms hvigor UP-TO-DATE :entry:default@MakePackInfo...
hvigor UP-TO-DATE :entry:default@ProcessProfile...
hvigor Finished :entry:default@SyscapTransform... after 2 ms hvigor UP-TO-DATE :entry:default@GeneratePkgContextInfo...
hvigor UP-TO-DATE :entry:default@ProcessResource...
hvigor UP-TO-DATE :entry:default@ProcessRouterMap...
hvigor UP-TO-DATE :entry:default@CompileResource...
hvigor UP-TO-DATE :entry:default@GenerateLoaderJson...
hvigor Finished :entry:default@BuildJS... after 2 ms hvigor ERROR: Failed :entry:default@BuildNativeWithNinja... hvigor ERROR: Exceptions happened while executing: ninja: Entering directory `/Users/linhuaqi/react/cunzhijiappHM/harmony/entry/.cxx/default/default/debug/arm64-v8a' [0/2] Re-checking globbed directories... [1/5] Linking CXX shared library /Users/linhuaqi/react/cunzhijiappHM/harmony/entry/build/default/intermediates/cmake/default/obj/arm64-v8a/librnoh.so [2/5] Linking CXX shared library /Users/linhuaqi/react/cunzhijiappHM/harmony/entry/build/default/intermediates/cmake/default/obj/arm64-v8a/librnoh_amap3d.so FAILED: /Users/linhuaqi/react/cunzhijiappHM/harmony/entry/build/default/intermediates/cmake/default/obj/arm64-v8a/librnoh_amap3d.so : && /Applications/DevEco-Studio.app/Contents/sdk/default/openharmony/native/llvm/bin/clang++ --target=aarch64-linux-ohos --gcc-toolchain=/Applications/DevEco-Studio.app/Contents/sdk/default/openharmony/native/llvm --sysroot=/Applications/DevEco-Studio.app/Contents/sdk/default/openharmony/native/sysroot -fPIC -fstack-protector-strong -Wl,-z,relro,-z,now,-z,noexecstack -s -fPIE -pie -DNDEBUG -O0 -g -fno-limit-debug-info --rtlib=compiler-rt -fuse-ld=lld -Wl,--build-id=sha1 -Wl,--warn-shared-textrel -Wl,--fatal-warnings -lunwind -Wl,--no-undefined -Qunused-arguments -Wl,-z,noexecstack -shared -Wl,-soname,librnoh_amap3d.so -o /Users/linhuaqi/react/cunzhijiappHM/harmony/entry/build/default/intermediates/cmake/default/obj/arm64-v8a/librnoh_amap3d.so rn_amap3d/CMakeFiles/rnoh_amap3d.dir/AMapEventEmitters.cpp.o rn_amap3d/CMakeFiles/rnoh_amap3d.dir/Props.cpp.o rn_amap3d/CMakeFiles/rnoh_amap3d.dir/ShadowNodes.cpp.o -L/Users/linhuaqi/react/cunzhijiappHM/harmony/entry/src/main/cpp/../../../oh_modules/@rnoh/react-native-openharmony/libs/arm64-v8a /Users/linhuaqi/react/cunzhijiappHM/harmony/entry/build/default/intermediates/cmake/default/obj/arm64-v8a/librnoh.so -lrnoh_semi -lace_napi.z -lace_ndk.z -lrawfile.z -lhilog_ndk.z -lnative_vsync -lnative_drawing -lc++_shared -lhitrace_ndk.z -lreact_render_scheduler -lrrc_image -lrrc_text -lrrc_textinput -lrrc_scrollview -lreact_nativemodule_core -lreact_render_animations -ljsinspector -lhermes -ljsi -llogger -lreact_config -lreact_debug -lreact_render_attributedstring -lreact_render_componentregistry -lreact_render_core -lreact_render_debug -lreact_render_graphics -lreact_render_imagemanager -lreact_render_mapbuffer -lreact_render_mounting -lreact_render_templateprocessor -lreact_render_textlayoutmanager -lreact_render_telemetry -lreact_render_uimanager -lreact_utils -lrrc_root -lrrc_view -lreact_render_leakchecker -lreact_render_runtimescheduler -lruntimeexecutor -lqos -lm && : ld.lld: error: undefined symbol: folly::f14::detail::kEmptyTagVector

referenced by F14Table.h:317 (/Users/linhuaqi/react/cunzhijiappHM/harmony/entry/src/main/cpp/../../../oh_modules/@rnoh/react-native-openharmony/src/main/include/third-party/folly/folly/container/detail/F14Table.h:317) rn_amap3d/CMakeFiles/rnoh_amap3d.dir/Props.cpp.o:(folly::f14::detail::F14Chunk::emptyInstance()) referenced by F14Table.h:317 (/Users/linhuaqi/react/cunzhijiappHM/harmony/entry/src/main/cpp/../../../oh_modules/@rnoh/react-native-openharmony/src/main/include/third-party/folly/folly/container/detail/F14Table.h:317) rn_amap3d/CMakeFiles/rnoh_amap3d.dir/Props.cpp.o:(folly::f14::detail::F14Chunk::emptyInstance())

ld.lld: error: undefined symbol: folly::f14::detail::F14LinkCheck<(folly::f14::detail::F14IntrinsicsMode)1>::check()

referenced by F14Table.h:1785 (/Users/linhuaqi/react/cunzhijiappHM/harmony/entry/src/main/cpp/../../../oh_modules/@rnoh/react-native-openharmony/src/main/include/third-party/folly/folly/container/detail/F14Table.h:1785) rn_amap3d/CMakeFiles/rnoh_amap3d.dir/Props.cpp.o:(folly::f14::detail::F14Table<folly::f14::detail::VectorContainerPolicy<std::n1::basic_string<char, std::__n1::char_traits, std::n1::allocator>, facebook::react::RawValue, void, void, void, std::n1::integral_constant<bool, true>>>::rehashImpl(unsigned long, unsigned long, unsigned long, unsigned long, unsigned long)::'lambda'()::operator()() const) referenced by F14Table.h:1785 (/Users/linhuaqi/react/cunzhijiappHM/harmony/entry/src/main/cpp/../../../oh_modules/@rnoh/react-native-openharmony/src/main/include/third-party/folly/folly/container/detail/F14Table.h:1785) rn_amap3d/CMakeFiles/rnoh_amap3d.dir/Props.cpp.o:(folly::f14::detail::F14Table<folly::f14::detail::VectorContainerPolicy<std::n1::basic_string<char, std::__n1::char_traits, std::n1::allocator>, double, void, void, void, std::n1::integral_constant<bool, true>>>::rehashImpl(unsigned long, unsigned long, unsigned long, unsigned long, unsigned long)::'lambda'()::operator()() const) clang++: error: linker command failed with exit code 1 (use -v to see invocation) [3/5] Building CXX object CMakeFiles/rnoh_app.dir/PackageProvider.cpp.o In file included from /Users/linhuaqi/react/cunzhijiappHM/harmony/entry/src/main/cpp/PackageProvider.cpp:1: In file included from /Users/linhuaqi/react/cunzhijiappHM/harmony/entry/src/main/cpp/../../../oh_modules/@rnoh/react-native-openharmony/src/main/include/RNOH/PackageProvider.h:3: In file included from /Users/linhuaqi/react/cunzhijiappHM/harmony/entry/src/main/cpp/../../../oh_modules/@rnoh/react-native-openharmony/src/main/include/RNOH/Package.h:4: In file included from /Users/linhuaqi/react/cunzhijiappHM/harmony/entry/src/main/cpp/../../../oh_modules/@rnoh/react-native-openharmony/src/main/include/RNOH/ComponentInstanceFactory.h:11: In file included from /Users/linhuaqi/react/cunzhijiappHM/harmony/entry/src/main/cpp/../../../oh_modules/@rnoh/react-native-openharmony/src/main/include/RNOH/FallbackComponentInstance.h:3: /Users/linhuaqi/react/cunzhijiappHM/harmony/entry/src/main/cpp/../../../oh_modules/@rnoh/react-native-openharmony/src/main/include/RNOH/CppComponentInstance.h:30:6: warning: braces around scalar initializer [-Wbraced-scalar-init] {{0.0}, {0.0}, {0.0}, {0.0}}, ^~~~~ /Users/linhuaqi/react/cunzhijiappHM/harmony/entry/src/main/cpp/../../../oh_modules/@rnoh/react-native-openharmony/src/main/include/RNOH/CppComponentInstance.h:30:13: warning: braces around scalar initializer [-Wbraced-scalar-init] {{0.0}, {0.0}, {0.0}, {0.0}}, ^~~~~ /Users/linhuaqi/react/cunzhijiappHM/harmony/entry/src/main/cpp/../../../oh_modules/@rnoh/react-native-openharmony/src/main/include/RNOH/CppComponentInstance.h:30:20: warning: braces around scalar initializer [-Wbraced-scalar-init] {{0.0}, {0.0}, {0.0}, {0.0}}, ^~~~~ /Users/linhuaqi/react/cunzhijiappHM/harmony/entry/src/main/cpp/../../../oh_modules/@rnoh/react-native-openharmony/src/main/include/RNOH/CppComponentInstance.h:30:27: warning: braces around scalar initializer [-Wbraced-scalar-init] {{0.0}, {0.0}, {0.0}, {0.0}}, ^~~~~ /Users/linhuaqi/react/cunzhijiappHM/harmony/entry/src/main/cpp/../../../oh_modules/@rnoh/react-native-openharmony/src/main/include/RNOH/CppComponentInstance.h:32:6: warning: braces around scalar initializer [-Wbraced-scalar-init] {{0.0}, {0.0}, {0.0}, {0.0}}, ^~~~~ /Users/linhuaqi/react/cunzhijiappHM/harmony/entry/src/main/cpp/../../../oh_modules/@rnoh/react-native-openharmony/src/main/include/RNOH/CppComponentInstance.h:32:13: warning: braces around scalar initializer [-Wbraced-scalar-init] {{0.0}, {0.0}, {0.0}, {0.0}}, ^~~~~ /Users/linhuaqi/react/cunzhijiappHM/harmony/entry/src/main/cpp/../../../oh_modules/@rnoh/react-native-openharmony/src/main/include/RNOH/CppComponentInstance.h:32:20: warning: braces around scalar initializer [-Wbraced-scalar-init] {{0.0}, {0.0}, {0.0}, {0.0}}, ^~~~~ /Users/linhuaqi/react/cunzhijiappHM/harmony/entry/src/main/cpp/../../../oh_modules/@rnoh/react-native-openharmony/src/main/include/RNOH/CppComponentInstance.h:32:27: warning: braces around scalar initializer [-Wbraced-scalar-init] {{0.0}, {0.0}, {0.0}, {0.0}}, ^~~~~ 8 warnings generated. ninja: build stopped: subcommand failed. A 'undefined symbol' error has occurred.

Process finished with exit code -1

复现步骤 / Steps to reproduce

  1. 开发环境搭建,创建RN工程,创建鸿蒙工程,运行模拟器正常
  2. 安装react-native-oh-tpl-react-native-amap3d-3.2.4-0.0.4.tgz,按文档手动link
  3. 运行,报错如上

node v18.19.1 DevEco-Studio Build Version: 5.0.3.910 文件package.json "dependencies": { "@react-native-oh-tpl/react-native-amap3d": "file:../harmony_tgz/react-native-oh-tpl-react-native-amap3d-3.2.4-0.0.4.tgz", "@react-native-oh/react-native-harmony": "^0.72.29", "@rnoh/react-native-harmony-cli": "file:../react-native-harmony-cli/rnoh-react-native-harmony-cli-0.0.26.tgz", "react": "18.2.0", "react-native": "0.72.5", "react-native-harmony": "file:../react-native-harmony/rnoh-react-native-harmony-0.72.32.tgz" } 文件entry/oh-package.json5 "dependencies": { "@rnoh/react-native-openharmony": "file:../libs/react_native_openharmony_release-5.0.0.500.har", "@react-native-oh-tpl/react-native-amap3d": "file:../../node_modules/@react-native-oh-tpl/react-native-amap3d/harmony/rn_amap3d.har" }

库版本 / Library version

5.0.0.71

React Native OpenHarmony version

0.72.29

构建类型 / Build type

Release app & dev bundle

设备 / Device

Simulator

设备版本 / Device model

No response

已悉知 / Acknowledgements

Yes

qilovehua commented 2 hours ago

真机(5.0.0.102)报错如下: /Applications/DevEco-Studio.app/Contents/tools/node/bin/node /Applications/DevEco-Studio.app/Contents/tools/hvigor/bin/hvigorw.js --mode module -p module=entry@default -p product=default -p requiredDeviceType=phone assembleHap --analyze=normal --parallel --incremental --daemon

hvigor UP-TO-DATE :entry:default@PreBuild...
hvigor UP-TO-DATE :entry:default@GenerateMetadata...
hvigor Finished :entry:default@ConfigureCmake... after 26 ms hvigor UP-TO-DATE :entry:default@MergeProfile...
hvigor UP-TO-DATE :entry:default@CreateBuildProfile...
hvigor Finished :entry:default@PreCheckSyscap... after 1 ms hvigor Finished :entry:default@ProcessIntegratedHsp... after 1 ms hvigor Finished :entry:default@BuildNativeWithCmake... after 5 ms hvigor UP-TO-DATE :entry:default@MakePackInfo...
hvigor UP-TO-DATE :entry:default@ProcessProfile...
hvigor Finished :entry:default@SyscapTransform... after 3 ms hvigor UP-TO-DATE :entry:default@GeneratePkgContextInfo...
hvigor UP-TO-DATE :entry:default@ProcessResource...
hvigor UP-TO-DATE :entry:default@ProcessRouterMap...
hvigor UP-TO-DATE :entry:default@CompileResource...
hvigor UP-TO-DATE :entry:default@GenerateLoaderJson...
hvigor Finished :entry:default@BuildJS... after 2 ms hvigor ERROR: Failed :entry:default@BuildNativeWithNinja... hvigor ERROR: Exceptions happened while executing: ninja: Entering directory `/Users/linhuaqi/react/cunzhijiappHM/harmony/entry/.cxx/default/default/debug/arm64-v8a' [0/2] Re-checking globbed directories... [1/4] Linking CXX shared library /Users/linhuaqi/react/cunzhijiappHM/harmony/entry/build/default/intermediates/cmake/default/obj/arm64-v8a/librnoh.so [2/4] Linking CXX shared library /Users/linhuaqi/react/cunzhijiappHM/harmony/entry/build/default/intermediates/cmake/default/obj/arm64-v8a/librnoh_amap3d.so FAILED: /Users/linhuaqi/react/cunzhijiappHM/harmony/entry/build/default/intermediates/cmake/default/obj/arm64-v8a/librnoh_amap3d.so : && /Applications/DevEco-Studio.app/Contents/sdk/default/openharmony/native/llvm/bin/clang++ --target=aarch64-linux-ohos --gcc-toolchain=/Applications/DevEco-Studio.app/Contents/sdk/default/openharmony/native/llvm --sysroot=/Applications/DevEco-Studio.app/Contents/sdk/default/openharmony/native/sysroot -fPIC -fstack-protector-strong -Wl,-z,relro,-z,now,-z,noexecstack -s -fPIE -pie -DNDEBUG -O0 -g -fno-limit-debug-info --rtlib=compiler-rt -fuse-ld=lld -Wl,--build-id=sha1 -Wl,--warn-shared-textrel -Wl,--fatal-warnings -lunwind -Wl,--no-undefined -Qunused-arguments -Wl,-z,noexecstack -shared -Wl,-soname,librnoh_amap3d.so -o /Users/linhuaqi/react/cunzhijiappHM/harmony/entry/build/default/intermediates/cmake/default/obj/arm64-v8a/librnoh_amap3d.so rn_amap3d/CMakeFiles/rnoh_amap3d.dir/AMapEventEmitters.cpp.o rn_amap3d/CMakeFiles/rnoh_amap3d.dir/Props.cpp.o rn_amap3d/CMakeFiles/rnoh_amap3d.dir/ShadowNodes.cpp.o -L/Users/linhuaqi/react/cunzhijiappHM/harmony/entry/src/main/cpp/../../../oh_modules/@rnoh/react-native-openharmony/libs/arm64-v8a /Users/linhuaqi/react/cunzhijiappHM/harmony/entry/build/default/intermediates/cmake/default/obj/arm64-v8a/librnoh.so -lrnoh_semi -lace_napi.z -lace_ndk.z -lrawfile.z -lhilog_ndk.z -lnative_vsync -lnative_drawing -lc++_shared -lhitrace_ndk.z -lreact_render_scheduler -lrrc_image -lrrc_text -lrrc_textinput -lrrc_scrollview -lreact_nativemodule_core -lreact_render_animations -ljsinspector -lhermes -ljsi -llogger -lreact_config -lreact_debug -lreact_render_attributedstring -lreact_render_componentregistry -lreact_render_core -lreact_render_debug -lreact_render_graphics -lreact_render_imagemanager -lreact_render_mapbuffer -lreact_render_mounting -lreact_render_templateprocessor -lreact_render_textlayoutmanager -lreact_render_telemetry -lreact_render_uimanager -lreact_utils -lrrc_root -lrrc_view -lreact_render_leakchecker -lreact_render_runtimescheduler -lruntimeexecutor -lqos -lm && : ld.lld: error: undefined symbol: folly::f14::detail::kEmptyTagVector

referenced by F14Table.h:317 (/Users/linhuaqi/react/cunzhijiappHM/harmony/entry/src/main/cpp/../../../oh_modules/@rnoh/react-native-openharmony/src/main/include/third-party/folly/folly/container/detail/F14Table.h:317) rn_amap3d/CMakeFiles/rnoh_amap3d.dir/Props.cpp.o:(folly::f14::detail::F14Chunk::emptyInstance()) referenced by F14Table.h:317 (/Users/linhuaqi/react/cunzhijiappHM/harmony/entry/src/main/cpp/../../../oh_modules/@rnoh/react-native-openharmony/src/main/include/third-party/folly/folly/container/detail/F14Table.h:317) rn_amap3d/CMakeFiles/rnoh_amap3d.dir/Props.cpp.o:(folly::f14::detail::F14Chunk::emptyInstance())

ld.lld: error: undefined symbol: folly::f14::detail::F14LinkCheck<(folly::f14::detail::F14IntrinsicsMode)1>::check()

referenced by F14Table.h:1785 (/Users/linhuaqi/react/cunzhijiappHM/harmony/entry/src/main/cpp/../../../oh_modules/@rnoh/react-native-openharmony/src/main/include/third-party/folly/folly/container/detail/F14Table.h:1785) rn_amap3d/CMakeFiles/rnoh_amap3d.dir/Props.cpp.o:(folly::f14::detail::F14Table<folly::f14::detail::VectorContainerPolicy<std::n1::basic_string<char, std::__n1::char_traits, std::n1::allocator>, facebook::react::RawValue, void, void, void, std::n1::integral_constant<bool, true>>>::rehashImpl(unsigned long, unsigned long, unsigned long, unsigned long, unsigned long)::'lambda'()::operator()() const) referenced by F14Table.h:1785 (/Users/linhuaqi/react/cunzhijiappHM/harmony/entry/src/main/cpp/../../../oh_modules/@rnoh/react-native-openharmony/src/main/include/third-party/folly/folly/container/detail/F14Table.h:1785) rn_amap3d/CMakeFiles/rnoh_amap3d.dir/Props.cpp.o:(folly::f14::detail::F14Table<folly::f14::detail::VectorContainerPolicy<std::n1::basic_string<char, std::__n1::char_traits, std::n1::allocator>, double, void, void, void, std::n1::integral_constant<bool, true>>>::rehashImpl(unsigned long, unsigned long, unsigned long, unsigned long, unsigned long)::'lambda'()::operator()() const) clang++: error: linker command failed with exit code 1 (use -v to see invocation) ninja: build stopped: subcommand failed. A 'undefined symbol' error has occurred.

Process finished with exit code -1