[英][Android][Renderscript] passing 'rs_script' (aka 'struct rs_script') to parameter of incompatible type 'rs_kernel' (aka 'void *')
When trying to run app with render script on Android N device - I get only this error 尝试在Android N设备上使用渲染脚本运行应用程序时-我仅收到此错误
error:passing 'rs_script' (aka 'struct rs_script') to parameter of incompatible type 'rs_kernel' (aka 'void *')
But the same project runs in android 6 without any error. 但同一项目在android 6中运行没有任何错误。 Also I can generate the apk file but in Android N it crashes. 我也可以生成apk文件,但在Android N中会崩溃。
Here is the issue it gives - 这是它给的问题-
rs_script gScript;
void filter() {
rsForEach(gScript, gIn, gOut);
}
...
gradle configuration gradle配置
defaultConfig {
.....
minSdkVersion 16
targetSdkVersion 25
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
renderscriptTargetApi 18
renderscriptSupportModeEnabled true
}
and proguard rules 和保障规则
-keep class public
-keep class android.support.v8.renderscript.** { *; }
I have tried to with different renderscriptTargetApi
24 or 22 but it keeps on giving the same error. 我曾尝试使用不同的renderscriptTargetApi
24或22,但它始终给出相同的错误。
In default configuration I changed targetSdkVersion 21
. 在默认配置中,我更改了targetSdkVersion 21
。 Because I was trying to run the app in 7.0.0 (android 24). 因为我试图在7.0.0(android 24)中运行该应用程序。 It worked. 有效。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.