简体   繁体   English

将RenderScript与Android NDK一起使用

[英]Using RenderScript with Android NDK

I am trying to run a simple example on how to use RenderScript from the android NDK. 我正在尝试运行一个简单的示例,说明如何使用android NDK中的RenderScript。 I found this example : 我发现了这个例子:

https://github.com/uelordi01/Call_RenderScript_from_NDK https://github.com/uelordi01/Call_RenderScript_from_NDK

but when I run my app (from Android studio), it doesn't fine some libraries (it seems like). 但是,当我运行我的应用程序(来自Android Studio)时,它对某些库不起作用(看起来像)。

Here is the logcat output: 这是logcat的输出:

04-26 16:18:11.705 26653-26653/uelordi.android.hellocomputendk_rs 
E/RS Dispatch: Couldn't initialize dispatchTab.ScriptInvokeIDCreate
04-26 16:18:11.705 26653-26653/uelordi.android.hellocomputendk_rs V/rsC++: 
libRS.so init failed!
04-26 16:18:11.705 26653-26653/uelordi.android.hellocomputendk_rs W/linker: 
libRSSupport.so: unused DT entry: type 0x6ffffef5 arg 0x37720
04-26 16:18:12.018 26653-26859/uelordi.android.hellocomputendk_rs 
E/RenderScript: Couldn't load libRSSupportIO.so
04-26 16:18:12.034 26653-26859/uelordi.android.hellocomputendk_rs 
E/RenderScript: Unable to open shared library 
(/data/data/uelordi.android.hellocomputendk_rs//lib/librs.mono.so): dlopen 
failed: library "libRSSupportIO.so" not found
04-26 16:18:12.034 26653-26859/uelordi.android.hellocomputendk_rs     
E/RenderScript: Unable to open system shared library     
(/system/lib/librs.mono.so): (null)
04-26 16:18:12.034 26653-26653/uelordi.android.hellocomputendk_rs E/rsC++: 
Internal error: Object id 0.

(The renderscript file name is mono.rs) (渲染脚本文件名为mono.rs)

I think I am supposed to add some libraries somewhere (libRS.so, libRSSupportIO.so) but I have no idea where and how and WHY (since the exemple is supposed to work by himself) 我想应该在某个地方添加一些库(libRS.so,libRSSupportIO.so),但是我不知道在哪里以及如何以及为什么(因为示例应该由他自己工作)

this error happens on the following line: sc->forEach_root(inputAlloc, outputAlloc); 此错误发生在以下行:sc-> forEach_root(inputAlloc,outputAlloc);

side question: 附带问题:

I looked over the internet but didn't find much (nothing up-to-date). 我查看了互联网,但没有发现太多(最新信息)。 Renderscript is still a thing in 2017, right? Renderscript在2017年仍然是一件事情,对吧?

The joy of android developpement. android开发的乐趣。 I found the solution! 我找到了解决方案! I simply had to change: 我只需要更改:

minSdkVersion 19

to: 至:

minSdkVersion 21

to be honest, I have no idea how to explain this. 老实说,我不知道该如何解释。 If anyone has an explanation, that would be great! 如果有人有解释,那就太好了!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM