2

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,

4

2 回答 2

6

经过大约三天的努力,我发现问题出在项目文件夹结构上,使用 gradle 编译时。这个项目显示了正确的结构:

https://android.googlesource.com/platform/tools/build/+/11086782041b302109e8349e13b8f9d5e305341d/tests/renderscript/

简而言之,.rs 文件不应与 java 文件放在一起,而应与 java 和 res 放在一个名为 'rs' 的单独文件夹中,具有相同的内部结构,例如“...\HelloRSProject\HelloRS\src\main \rs\com\example\hellors\mono.rs”。此外,请务必将 renderscriptTargetApi 添加到 build.gradle 文件中,如下所示:

android {
    compileSdkVersion 17
    buildToolsVersion "18.0.1"

    defaultConfig {
        minSdkVersion 16
        targetSdkVersion 16
        renderscriptTargetApi = 16
    }
}
于 2013-08-05T14:41:08.823 回答
4

ADT 22 中有一个错误。我已经在这里报告了它(你也可以在那里找到临时解决方法)。

于 2013-07-03T06:58:56.903 回答