我的平台信息 操作系统: Windows 7 32位 ADT版本: Build: v22.2.1-833290 SDK工具版本: 22.2.1 SDK构建工具版本: 18.1
我试图让新的Renderscript支持库v8正常工作。我创建了一个Android应用程序,将API级别18作为目标SDK和编译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
我将一个空的.rs文件添加到了"project.properties"文件中,并将其放入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.*;)。
[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文件上也没有红色十字标记)。