发 帖  
原厂入驻New
[问答]

鸿蒙手机侧app开发加载so文件报错

293 手机
分享
想将histreaming.app代码移植到鸿蒙侧,发现在调用liblink_core.so文件时报错,请大佬帮忙解答一下,感谢

这个是CMakeLists.txt相关内容


这个是项目.so文件存放位置

编译时报错如下

> Task :entry:preBuild
FAILED: E:/project/Smartcar/entry/build/intermediates/cmake/debug/obj/ARM64-v8a/libhello.so
cmd.exe /C "cd . && C:\Users\chenjiac\AppData\Local\Huawei\Sdk\native\2.0.1.93\llvm\bin\clang++.exe --target=aarch64-linux-ohos --gcc-toolchain=C:/Users/chenjiac/AppData/Local/Huawei/Sdk/native/2.0.1.93/llvm --sysroot=C:/Users/chenjiac/AppData/Local/Huawei/Sdk/native/2.0.1.93/sysroot -fPIC -g -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -fno-addrsig -Wa,--noexecstack -Wformat -Werror=format-security   -O0 -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,libhello.so -o E:\project\Smartcar\entry\build\intermediates\cmake\debug\obj\arm64-v8a\libhello.so CMakeFiles/hello.dir/hello.cpp.o CMakeFiles/hello.dir/jni_utils.c.o  -Wl,-rpath,E:/project/Smartcar/entry/src/main/cpp/../../../libs/arm64-v8a  E:/project/Smartcar/entry/src/main/cpp/../../../libs/arm64-v8a/liblink_core.so  -lm && cd ."
ld.lld: error: E:/project/Smartcar/entry/src/main/cpp/../../../libs/arm64-v8a/liblink_core.so is incompatible with aarch64linux
这里说liblink_core.so不兼容,不知道是不是这个so文件不支持arm64-v8a
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.
Cmake thread
org.gradle.api.GradleException: native build cmake execute failed
at com.huawei.ohos.build.utils.ProcessUtils.processWait(ProcessUtils.groovy:104)
at com.huawei.ohos.build.utils.ProcessUtils.execute(ProcessUtils.groovy:90)
at com.huawei.ohos.build.utils.ProcessUtils.execute(ProcessUtils.groovy)
at com.huawei.ohos.build.utils.ProcessUtils$execute$1.callCurrent(Unknown Source)
at com.huawei.ohos.build.utils.ProcessUtils.execute(ProcessUtils.groovy:66)
at com.huawei.ohos.build.utils.ProcessUtils$execute$0.callCurrent(Unknown Source)
at com.huawei.ohos.build.utils.ProcessUtils.execute(ProcessUtils.groovy:62)
at com.huawei.ohos.build.utils.ProcessUtils$execute.call(Unknown Source)
at com.huawei.ohos.build.dsl.CmakeThread.executeCmakeBuild(CmakeThread.groovy:106)
at com.huawei.ohos.build.dsl.CmakeThread.run(CmakeThread.groovy:58)
Exception in thread "Thread-2598" org.gradle.api.GradleException: native build cmake execute failed
at sun.reflect.GeneratedConstructorAccessor325.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:80)
at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:105)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:249)
at com.huawei.ohos.build.utils.ProcessUtils.processWait(ProcessUtils.groovy:104)
at sun.reflect.GeneratedMethodAccessor296.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.groovy.runtime.callsite.PlainObjectMetaMethodSite.doInvoke(PlainObjectMetaMethodSite.java:43)
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:190)
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:58)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:184)
at com.huawei.ohos.build.utils.ProcessUtils.execute(ProcessUtils.groovy:90)
at com.huawei.ohos.build.utils.ProcessUtils.execute(ProcessUtils.groovy)
at com.huawei.ohos.build.utils.ProcessUtils$execute$1.callCurrent(Unknown Source)
at com.huawei.ohos.build.utils.ProcessUtils.execute(ProcessUtils.groovy:66)
at com.huawei.ohos.build.utils.ProcessUtils$execute$0.callCurrent(Unknown Source)
at com.huawei.ohos.build.utils.ProcessUtils.execute(ProcessUtils.groovy:62)
at com.huawei.ohos.build.utils.ProcessUtils$execute.call(Unknown Source)
at com.huawei.ohos.build.dsl.CmakeThread.executeCmakeBuild(CmakeThread.groovy:106)
at com.huawei.ohos.build.dsl.CmakeThread.run(CmakeThread.groovy:58)
> Task :entry:compileDebugNativeWithCmake FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':entry:compileDebugNativeWithCmake'.
> native build cmake execute failed

* 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

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.3/userguide/command_line_inteRFace.html#sec:command_line_warnings

BUILD FAILED in 15s
2 actionable tasks: 2 executed


0
2021-1-25 16:54:15   评论 分享淘帖 邀请回答
2个回答
https://developer.huawei.com/consumer/cn/forum/topic/0203469681415480202?fid=26  可以看一下这个回复呢
最佳答案
2021-1-25 16:54:16 评论

举报

@xusiwei 请许思维老师来为开发者解答一下难题。
2021-1-25 18:51:03 2 评论

举报

2 条评论
  • 2021-1-27 09:43

    开发者你好,您的问题已经为您转相关人员待处理中,有回复后我们会及时同步。
    同时欢迎论坛开发小伙伴们互帮互助.............
    感谢您对开发者论坛的支持!!

  • 2021-1-27 10:07

    https://developer.huawei.com/consumer/cn/forum/topic/0203469681415480202?fid=26   可以参考这个回复

只有小组成员才能发言,加入小组>>

1189个成员聚集在这个小组

加入小组

创建小组步骤

关闭

站长推荐 上一条 /8 下一条

快速回复 返回顶部 返回列表