I'd like to do some experiment with renderscript, so I started with the example shipped with the sdk, but unfortunatly I am not able to compile it. Is there any extra tool which I might required to compile and build that example, I'd tried to read the doc. but they haven't mentioned anything.
The problem with the Sample project is...
I came to know after building the project eclipse will generate new files in res/raw folder and some files in gen folder, and this files can be used in java files, but this files are not generating. can anyone guide me how to solve this errors.
Thanks,
After about three days of struggling with this, I found that the problem was with the project folder structure, when compiling with gradle. This project shows the correct structure:
https://android.googlesource.com/platform/tools/build/+/11086782041b302109e8349e13b8f9d5e305341d/tests/renderscript/
In short, the .rs files should not be together with the java files, but in a separate folder called 'rs' alongside java and res, with the same inside structure, such as "...\HelloRSProject\HelloRS\src\main\rs\com\example\hellors\mono.rs". Also, be sure to add renderscriptTargetApi to the build.gradle file, like so:
android {
compileSdkVersion 17
buildToolsVersion "18.0.1"
defaultConfig {
minSdkVersion 16
targetSdkVersion 16
renderscriptTargetApi = 16
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With