我的平台信息 操作系统:Windows 7 32位 ADT版本:Build:v22.2.1-833290 SDK工具版:22.2.1 SDK Built-tools版本:18.1
我试图让新的Renderscript支持库v8工作。我创建了一个使用API级别18作为目标SDK的Android应用程序,并编译SDK,API级别17作为最低要求的SDK。然后,我按照以下链接中的步骤配置我的项目http://android-developers.blogspot.hk/2013/09/renderscript-in-android-support-library.html,http://developer.android.com/guide/topics/renderscript/compute.html#access-rs-apis。
我添加
后renderscript.target=18
renderscript.support.mode=true
sdk.buildtools=18.1.0
进入文件“project.properties”,我将一个空的.rs文件添加到src文件夹中(在我的包下,就像平时一样)。然后我收到以下错误消息。
[2013-09-22 22:32:32 - aaaaa] <invalid>: error: missing pragma for version in source file
[2013-09-22 22:32:32 - aaaaa] <invalid>: error: missing "#pragma rs java_package_name(com.foo.bar)" in source file
[2013-09-22 22:32:32 - aaaaa] C:\Work\SDK\adt-bundle-windows-x86-20130917\sdk\build-tools\android-4.3\arm-linux-androideabi-ld.exe: fatal error: C:\Users\rensijie\workspace\aaaaa\bin\rsObj\armeabi-v7a\test.o: attempt to map 40 bytes at offset 1616 exceeds size of file; the file may be corrupt
[2013-09-22 22:32:32 - aaaaa] C:\Users\rensijie\workspace\aaaaa\bin\rsObj\mips\test.o: file not recognized: File format not recognized
[2013-09-22 22:32:32 - aaaaa] C:\Work\SDK\adt-bundle-windows-x86-20130917\sdk\build-tools\android-4.3\i686-linux-android-ld.exe: error: C:\Users\rensijie\workspace\aaaaa\bin\rsObj\x86\test.o: section name section has wrong type: 2097152
[2013-09-22 22:32:32 - aaaaa] C:\Work\SDK\adt-bundle-windows-x86-20130917\sdk\build-tools\android-4.3\i686-linux-android-ld.exe: fatal error: C:\Users\rensijie\workspace\aaaaa\bin\rsObj\x86\test.o: attempt to map 46661632 bytes at offset 0 exceeds size of file; the file may be corrupt
由于我理解了前两个错误消息的含义,我添加了
#pragma version(1)
#pragma rs java_package_name(com.example.aaaaa)
到文件。
当前两个错误消息消失时,再次出现以下错误消息,我无法通过添加/修改脚本内容来摆脱它(例如,我复制了以前工作的脚本,它将无法正常工作现在)。但是,我观察到gen文件夹中相应的.java脚本文件是正确创建的(使用import android.support.v8.renderscript。*; inside)。
[2013-09-22 22:34:29 - aaaaa] C:\Work\SDK\adt-bundle-windows-x86-20130917\sdk\build-tools\android-4.3\arm-linux-androideabi-ld.exe: fatal error: C:\Users\rensijie\workspace\aaaaa\bin\rsObj\armeabi-v7a\test.o: attempt to map 40 bytes at offset 1616 exceeds size of file; the file may be corrupt
[2013-09-22 22:34:30 - aaaaa] C:\Users\rensijie\workspace\aaaaa\bin\rsObj\mips\test.o: file not recognized: File format not recognized
[2013-09-22 22:34:30 - aaaaa] C:\Work\SDK\adt-bundle-windows-x86-20130917\sdk\build-tools\android-4.3\i686-linux-android-ld.exe: error: C:\Users\rensijie\workspace\aaaaa\bin\rsObj\x86\test.o: section name section has wrong type: 2097152
[2013-09-22 22:34:30 - aaaaa] C:\Work\SDK\adt-bundle-windows-x86-20130917\sdk\build-tools\android-4.3\i686-linux-android-ld.exe: fatal error: C:\Users\rensijie\workspace\aaaaa\bin\rsObj\x86\test.o: attempt to map 46661632 bytes at offset 0 exceeds size of file; the file may be corrupt
[2013-09-22 22:34:30 - aaaaa] C:\Work\SDK\adt-bundle-windows-x86-20130917\sdk\build-tools\android-4.3\arm-linux-androideabi-ld.exe: error: C:\Users\rensijie\workspace\aaaaa\bin\rsObj\armeabi-v7a\test2.o: section name section has wrong type: 469762048
[2013-09-22 22:34:30 - aaaaa] C:\Work\SDK\adt-bundle-windows-x86-20130917\sdk\build-tools\android-4.3\arm-linux-androideabi-ld.exe: fatal error: C:\Users\rensijie\workspace\aaaaa\bin\rsObj\armeabi-v7a\test2.o: attempt to map 3103784960 bytes at offset 0 exceeds size of file; the file may be corrupt
[2013-09-22 22:34:30 - aaaaa] C:\Users\rensijie\workspace\aaaaa\bin\rsObj\mips\test2.o: file not recognized: File format not recognized
[2013-09-22 22:34:30 - aaaaa] C:\Work\SDK\adt-bundle-windows-x86-20130917\sdk\build-tools\android-4.3\i686-linux-android-ld.exe: error: C:\Users\rensijie\workspace\aaaaa\bin\rsObj\x86\test2.o: section name section has wrong type: 7168
[2013-09-22 22:34:30 - aaaaa] C:\Work\SDK\adt-bundle-windows-x86-20130917\sdk\build-tools\android-4.3\i686-linux-android-ld.exe: fatal error: C:\Users\rensijie\workspace\aaaaa\bin\rsObj\x86\test2.o: attempt to map 39168 bytes at offset 0 exceeds size of file; the file may be corrupt
在eclipse中,项目名称上有一个红叉,表示项目中出现了问题。如果我尝试运行该应用程序,eclipse将提示“您的项目包含错误,请在运行您的应用程序之前修复它们”。但是,除了我得到的错误消息和项目名称上的红叉之外,任何java文件都没有错误(java文件没有红色交叉)
答案 0 :(得分:0)