When trying to run app with render script on Android N device - I get only this error

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. Also I can generate the apk file but in Android N it crashes.

Here is the issue it gives -

rs_script gScript;
void filter() {
    rsForEach(gScript, gIn, gOut);  
}
...

gradle configuration

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.

1

There are 1 best solutions below

0
On

In default configuration I changed targetSdkVersion 21. Because I was trying to run the app in 7.0.0 (android 24). It worked.