Android Renderscript未生成librs.xx.so如果Renderscript targetAPI>;20

Android Renderscript未生成librs.xx.so如果Renderscript targetAPI>;20,android,android-ndk,android-support-library,renderscript,android-rendering,Android,Android Ndk,Android Support Library,Renderscript,Android Rendering,我正在使用renderscript进行音频dsp处理。它工作得很好,直到我决定将renderscriptTargetApi版本从19提升到24,以尝试以向后兼容的方式使用较新的renderscriptapi 编译没有问题,但在运行时,logcat会显示如下错误 05-31 19:40:23.097 8661-8734/com.example.audio.test E/RenderScript: 无法打开共享库 (/data/user/0/com.example.audio.test//lib/l

我正在使用renderscript进行音频dsp处理。它工作得很好,直到我决定将
renderscriptTargetApi
版本从19提升到24,以尝试以向后兼容的方式使用较新的renderscriptapi

编译没有问题,但在运行时,logcat会显示如下错误

05-31 19:40:23.097 8661-8734/com.example.audio.test E/RenderScript: 无法打开共享库 (/data/user/0/com.example.audio.test//lib/librs.xx.so):dlopen失败: 找不到库“librsupportio.so”

如果我有
renderscriptTargetApi
作为19或20,我的apk有
librs.xx.so
,并且没有错误。如果我将其跳到21、23或24,则不会生成librs.xx.so,因此我有此运行时错误

<>我使用NDK,即C++的渲染脚本。也使用CMake。我找不到通过NDK使用renderscript支持库的说明。所有指令都假定支持库是通过Java使用的

这是来自
build.gradle

    ndk {
        abiFilters 'armeabi-v7a', 'x86'
    }

    renderscriptTargetApi 24
    renderscriptSupportModeEnabled true
    renderscriptNdkModeEnabled true
CMakeLists.txt

add_library (dsp SHARED
  ${SRC_PATH}/dsp.cpp
  ${SRC_RS_PATH}/xx.rs ${SRC_RS_GENERATED_PATH}/ScriptC_xx.cpp)

target_compile_options(dsp PRIVATE 
  -std=c++11 -stdlib=libc++ -fno-rtti -fexceptions -Ofast)

target_link_libraries(dsp RScpp_static dl ${log-lib})
这是
xx.rs

#pragma version(1)
#pragma rs java_package_name(com.example.audio)
#pragma rs_fp_relaxed

float RS_KERNEL my_kernel(float in, uint32_t x) {
    // ...
}
这就是从C调用内核的方式++

sp<RS> rs = new RS();
rs->init(app_cache_dir);

sp<const Element> e = Element::F32(rs);
sp<const Type> t = Type::create(rs, e, 44100*10, 0, 0);

sp<Allocation> inAlloc = Allocation::createTyped(rs, t);
inAlloc->copy1DFrom(input);

sp<Allocation> outAlloc = Allocation::createTyped(rs, t);

ScriptC_xx *script = new ScriptC_xx(rs);
script->forEach_xx(inAlloc, outAlloc);

outAlloc->copy1DTo(output);
sp-rs=new-rs();
rs->init(应用程序缓存目录);
sp e=元素::F32(rs);
spt=Type::create(rs,e,44100*10,0,0);
sp

我已经提交了一份关于Android构建系统的错误报告: