• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

AndroidStudio and Renderscript's ScriptC error

rfat99

Lurker
Jun 13, 2023
1
0
AndroidStudio (AS) fails to find the definition of ScriptC_invert when implementing a Renderscript (in another file invert.rs). It is placed in a directory src/main/rs and this is updated in the gradle (AndroidStudio folder). I am using Android SDK 33 which should still support Renderscripts.

I am sure there are no code-wise issues as I am consistent with several examples online, namely, the invert.rs contains:

// File: invert.rs

#pragma version(1)
#pragma rs java_package_name(com.example.sharp)

and the Java code:

ScriptC_invert invert = new ScriptC_invert(rs);

but I get:

error: cannot find symbol ScriptC_invert invert = new ScriptC_invert(rs);

The build.gradle contains:

renderscriptTargetApi 18
renderscriptSupportModeEnabled true

as well as:

sourceSets {
main {
renderscript {
srcDirs 'src/main/rs'
}
}
}

Anyone managed to get this running on current android/AS versions? Thanks!
 

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones