I get the following errors when I try to compile any Android RenderScript sample code (SDK version 11).
[2012-02-03 16:49:33 - CarouselExample] /Library/android-sdk-macosx/platforms/android-13/renderscript/include/rs_core.rsh:35:33: error: unknown type name 'rs_matrix4x4'
[2012-02-03 16:49:33 - CarouselExample] /Library/android-sdk-macosx/platforms/android-13/renderscript/include/rs_core.rsh:40:33: error: unknown type name 'rs_matrix3x3'
[2012-02-03 16:49:33 - CarouselExample] /Library/android-sdk-macosx/platforms/android-13/renderscript/include/rs_core.rsh:45:33: error: unknown type name 'rs_matrix2x2'
[2012-02-03 16:49:33 - CarouselExample] /Library/android-sdk-macosx/platforms/android-13/renderscript/include/rs_core.rsh:55:27: warning: declaration specifier missing, defaulting to 'int'
[2012-02-03 16:49:33 - CarouselExample] /Library/android-sdk-macosx/platforms/android-13/renderscript/include/rs_core.rsh:88:71: error: unknown type name 'float2'; did you mean 'float'?
...
I've searched around to see if others are having similar issues.
This post Renderscript samples build errors for example mentions that the /renderscript directory in Android-11 to Android-13 needs to be updated with the contents of the /renderscript directory from Android-14+. I have all the SDK versions from 2.1 to 4.0.3 and there's no:
/platforms/android-14/renderscript
directory. I am able to build and run my projects that don't use RenderScript.
Has anyone found a solution for this? Or can someone tell me what I'm doing incorrectly here? I just select File>New>Android Project>Create project from existing sample. If I select any RenderScript samples I'm unable to compile the project.
I've also noticed that the /raw directory (sibling directories of layout, drawable, etc.) initially comes with a file (in my case carousel.bc), but when I compile, this file is deleted - which doesn't seem right to me.
Thanks for you help!
So after some more digging around. I decided to install the Google APIs for the Android-11 SDK and that seemed to fix things. There was still one syntax error I had to fix in the carousel.rs file.
cards[i].cardVisible = (p >= visibleFirst && p < visibleLast)
|| (p <= visibleFirst && p > visibleLast);
The last two parentheses need to be added.
Wish I would have been able to find this out from the Android developer site. Nowhere does it say the "Google API's by Google" need to be downloaded in order to compile RenderScript.