[android开发IDE]adt-bundle-windows-x86的一个bug:无法解析.rs文件--------rs_core.rsh file not found

      利用adt-bundle-windows-x86-20130522搭建的android开发环境在导入android4.2的Gallery2源码时,总是解析不了convolve3x3.rs文件,也即在gen文件夹下产生不了ScriptC_convolve3x3.java及下面的那个.d文件

 

无论你肿么配,他就是解析不了。网上关于RenderScript的资料比较少,经过这两天研究,所得到的解决方案如下:

1, 参考http://stackoverflow.com/questions/5971356/unable-to-build-androids-helloworld-in-renderscript,给出的方案是用3.0的platform-tools,解压后替换原来的platform-tools文件夹。参考https://groups.google.com/forum/#!topic/android-developers/gCX1bEJAzE4,他给出的方案也是如此。3.0的platform-tools下载链接如下:

https://dl-ssl.google.com/android/repository/platform-tools_r03-windows.zip
https://dl-ssl.google.com/android/repository/platform-tools_r03-macosx.zip
https://dl-ssl.google.com/android/repository/platform-tools_r03-linux.zip

下载替换后,再次导入Gallery2源码得到错误如下:' llvm-rs-cc: error: unknown argument: '-target-api' '

       上面的错误也是这位老兄http://stackoverflow.com/questions/16746063/llvm-rs-cc-error-unknown-argument-target-api-in-android-renderscript遇到的!

     按理说,这个思路是对的。我在实验室里装了adt-bundle和传统方式安装的sdk两个版本,后者可以正常解析,但前者就是不行。

2,参考https://code.google.com/p/android/issues/detail?id=55342,有推荐用假链接的。在adt-bundle这个安装版本出来之前,platform-tools文件夹下是有renderscript文件夹及llvm-rs-cc工具的。用adt-bundle安装后的sdk版本,这个解析rs文件的东西转移到了build-tools文件夹下。无论是你复制过来,还是建个软链接,或是弄个fake_llvm-rs-cc反正我是没实验成功。

3,还有的小伙伴们很有创造力,写了个.c文件强制找到llvm-rs-cc工具,但我楞是么看明白咋回事。

最终我的解决方案:

     尽管我在实验室里在传统方法安装的sdk环境中成功导入了gallery2和camera并正常编译出apk运行良好,但我就是不甘心最新的adt-bundle-windows-x86-20130522死活解析不了。最终摸索到如下链接:http://developer.android.com/tools/sdk/eclipse-adt.html 也即关于ADT版本的介绍,其中最新的版本是ADT22.0.5,而adt-bundle-windows-x86-20130522带的ADT版本是22.0.1.官方对ADT22.0.5的解释如下:

ADT 22.0.5 (July 2013)

Dependencies:
Java 1.6 or higher is required.
Eclipse Helios (Version 3.6.2) or higher is required.
This version of ADT is designed for use with SDK Tools r22.0.5. If you haven't already installed SDK Tools r22.0.5 into your SDK, use the Android SDK Manager to do so.
General Notes:
Fixed Renderscript compilation issue for Windows platforms.
Updated Systrace report generation in the Monitor and DDMS perspectives.

上面说解决了Renderscipt在windows平台不能正常解析的问题,而且最新的ADT22.0.5必须和SDK Tools22.0.5配套使用,再看SDK Tools的版本说明http://developer.android.com/tools/sdk/tools-notes.html

SDK Tools, Revision 22.0.5 (July 2013)

Dependencies:
Android SDK Platform-tools revision 16 or later.
If you are developing in Eclipse with the ADT Plugin, note that this version of SDK Tools is designed for use with ADT 22.0.5 and later. If you haven't already, update ADT to 22.0.5.
If you are using Android Studio, note that this version of the SDK Tools is designed to work with Android Studio 0.2.x and later.
If you are developing without an integrated development environment (IDE), you must have Apache Ant 1.8 or later.
General Notes:
Fixed Renderscript compilation issue for Windows platforms with ant.
Updated Systrace to work with the Android 4.3 platform image.
Fixed packaging of Renderscript compiler.
Build tools 18.0.0 is obsolete and 18.0.1 should be used instead.


        除了和ADT配套外,还要求Build tools版本为18.0.1。 貌似只有ADT在安装时可以离线安装,下载链接:http://developer.android.com/sdk/installing/installing-adt.html#Troubleshooting  其他两个只能通过sdk-manager在线安装的方式升级。这里有个奇怪的问题,如果你不主动(手动)升级ADT,点击eclipse的Help--check for updates会报告说没有啥可以升级的。推测这是其他工具必须和ADT配套的原因,ADT不动其他的组件也无需动。

      我是通过http://developer.android.com/sdk/installing/installing-adt.html#Troubleshooting 下载的adt的手动安装包,但遗憾的是虽然离线下下来了,但在安装开始的时候说要检测依赖关系就不动弹了。最后参考我的前篇博文[2013-9-8]:近日Android-SDK无法更新的问题解决   在C:\Windows\System32\drivers\etc\hosts文件添加一行:74.125.237.1       dl-ssl.google.com 后,使用在线安装的方法,增加网址:

http://dl-ssl.google.com/android/eclipse/

然后顺利安装成功,中间还会有NDK tools问是否安装。

        最终的SDK Manager,呈现出来的版本安装信息如下:


         在ADT升级到22.0.5之后,Android SDK Tools版本升级到22.0.5,Platform-tools升级到18.0.1,Build-tools升级到18.0.1,那个17的Build-tools是adt-bundle里自带的。这样在导入android4.2源码里的Gallery2文件夹时,gen文件夹下的那个ScriptC_convolve3x3.java就可以正常生成喽!!!!!!

 

欢迎android爱好者加群248217350     备注:yanzi

--------------------- 本文系原创,转载请注明作者:yanzi1225627

 

  • 4
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 4
    评论
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值