0
我想運行一個關於如何從android NDK使用RenderScript的簡單示例。我發現這個例子:與Android NDK一起使用RenderScript
https://github.com/uelordi01/Call_RenderScript_from_NDK
但是當我運行我的應用程序(在Android工作室),它不細一些圖書館(好像)。
這裏是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.
(本的renderScript文件名是mono.rs)
我想我應該再添加一些圖書館(libRS.so,libRSSupportIO.so)但我不知道在哪裏以及如何以及爲什麼(因爲示例應該由他自己工作)
此錯誤發生在以下行上: sc-> forEach_root(inputAlloc,outputAlloc);
側問題:
我看着在互聯網上,但並沒有找到太多(沒有跟上時代的)。 Renderscript在2017年仍然是一件事,對吧?
您使用的是哪個NDK版本? –
這似乎是gradle-plugin的bug。我建議你使用ndk-build來使用RenderScript NDK,而不是使用「renderscriptNdkModeEnabled true」。例如:https://android.googlesource.com/platform/ndk/+/master/tests/device/rs-cpp-basic/jni/ –
我正在使用NDK 14.0.3770861。 @MiaoWang如果我這樣構建我的renderscript/C++,這會生成一個共享庫(或靜態庫)嗎?那麼如果我想使用它,我只需要將它添加到我的CMakeLists中? –