问题描述
我拼命地建立RenderScript Android Studio中。根据本手册我已经设置了最高可用renderscriptTargetApi 22 renderscriptSupportModeEnabled如此。我用buildToolsVersion22.0.1。有了这个,我能够使用ScriptIntrinsic功能 - 但没有达到编译书面RenderScript的自我(试过20H +现在......)。当我尝试重建项目,最迟 - 我总是用R-文件(红色)同样的问题。我究竟做错了什么?非常感谢你的帮助。
- 开启Android的工作室。
- 选择文件/新建/新项目...
- preSS下一步
- 选择手机和平板电脑和最低SDK:4.4
- preSS下一步。
- 选择空白活动。
- preSS下一步。
- preSS完成。
- 在层次树的左侧(应用程序)上单击鼠标右键。
- 选择新建/文件夹/文件夹RenderScript。
- preSS完成。
- 工作renderscript文件复制到新创建的RS文件夹中。
- 在摇篮脚本/的build.gradle双击。(模块:应用程序)
-
插入
renderscriptTargetApi 18
renderscriptSupportModeEnabled真
在defaultConfig部分的末尾
I'm desperately trying to set-up RenderScript in Android Studio. According to this manual http://developer.android.com/guide/topics/renderscript/compute.html#ide-setup I have set the highest available renderscriptTargetApi 22 and renderscriptSupportModeEnabled true. I use buildToolsVersion "22.0.1". With this I am able to use the ScriptIntrinsic functions - but didn't achieve to compile an self written RenderScript (tried 20h+ now...). I always get the same problem with the R-File (red) - at the latest when I try to rebuild the Project. What am I doing wrong? Thank you very much for your help.
- Open Android Studio.
- Select "File/New/New Project..."
- Press Next
- Select "Phone and Tablet" and Minimum SDK: 4.4.
- Press Next.
- Select "Blank Activity".
- Press Next.
- Press Finish.
- Right-click at the top of hierarchy tree on the left ("app").
- Select "New/Folder/RenderScript folder".
- Press Finish.
- Copy a working renderscript file to newly created "rs" folder.
- Double-click on "Gradle Scripts/build.gradle (Module: app).
Insert
renderscriptTargetApi 18 renderscriptSupportModeEnabled true
at the end of defaultConfig section.
- Press Ctrl-F9 to build your project.
这篇关于建立RenderScript Android Studio中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!