将RenderScript与支持库一起使用时,我在Motorola iRazr(Android 4.1.2)上出现此错误
Error loading RS jni library: java.lang.UnsatisfiedLinkError: Couldn't load RSSupport: findLibrary returned null
Run Code Online (Sandbox Code Playgroud)
三星Galaxy S3上的一切正常.
Bitmap outputBitmap = Bitmap.createBitmap(inputBitmap);
RenderScript rs = RenderScript.create(ctx);
ScriptIntrinsicBlur theIntrinsic = ScriptIntrinsicBlur.create(rs, Element.U8_4(rs));
Allocation tmpIn = Allocation.createFromBitmap(rs, inputBitmap);
Allocation tmpOut = Allocation.createFromBitmap(rs, outputBitmap);
theIntrinsic.setRadius(BLUR_RADIUS);
theIntrinsic.setInput(tmpIn);
theIntrinsic.forEach(tmpOut);
tmpOut.copyTo(outputBitmap);
Run Code Online (Sandbox Code Playgroud)
我使用的支持库jar是
build-tools/19.0.1/renderscript/lib/renderscript-v8.jar
Run Code Online (Sandbox Code Playgroud)
任何帮助深表感谢.
编辑:
我将这些文件复制到libs文件夹中,并验证了so文件是否在设备上的data/data/lib文件夹中.
librsjni.so和 libRSSupport.so存在于设备上...
编辑:
更详细的错误:
02-26 16:17:42.311: D/dalvikvm(16985): Trying to load lib /data/data/de.proximity.hero/lib/libRSSupport.so 0x42616b70
02-26 16:17:42.321: D/dalvikvm(16985): Added shared lib /data/data/de.proximity.hero/lib/libRSSupport.so 0x42616b70
02-26 16:17:42.321: D/dalvikvm(16985): No JNI_OnLoad found in /data/data/de.proximity.hero/lib/libRSSupport.so …Run Code Online (Sandbox Code Playgroud)