我使用最新的 RS buildtools (20) 在 4.3 (API 18) 上针对 x86 设备:
renderscript.support.mode=true
renderscript.target = 18
我也有同样的错误,在堆栈跟踪中出现了许多查找失败的错误,在我的特定情况下与pow和exp函数相关:
E/RenderScript(5251): ScriptC sym lookup failed for powf
E/RenderScript(5251): ScriptC sym lookup failed for expf
[...]
E/bcc(5251): Some symbols are found to be undefined during relocation!
E/bcc(5251): Error occurred when performs relocation on /data/data/*********/cache/com.android.renderscript.cache/synth.o!
[...]
E/RenderScript(5251): bcc: FAILS to prepare executable for 'synth'
[...]
E/AndroidRuntime(5251): Caused by: android.renderscript.RSRuntimeException: Loading of ScriptC script failed.
[...]
I/Process(5251): Sending signal. PID: 5251 SIG: 9
因此,为了解决这个问题,我将pow和exp的调用分别替换为native_powr(在文档中不可见但可用)和RS 源代码中的native_exp。请注意,正确清理项目也很重要,否则您最终可能会遇到不同的崩溃:
A/libc(5844): Fatal signal 11 (SIGSEGV) at 0x97698030 (code=2), thread 5844 (****)