无法在 RenderScript 中构建 Android 的 HelloWorld
我正在尝试在 android/sdk/samples 中构建 RenderScript 示例之一。 我已经尝试过 HelloWorld 和 Balls 示例,但应用程序被强制关闭
05-11 15:25:44.670: WARN/bcc(14985): Unable to open /data/data/com.android.rs.helloworld/cache/@com.android.rs.helloworld:[email protected] in read mode. (reason: No such file or directory) 05-11 15:25:44.670: ERROR/bcc(14985): Unable to readBC, bitcode=0x17d3f8, size=1068 05-11 15:25:44.670: DEBUG/StopWatch(14985): StopWatch bcc: PrepareExecutable time (us): 1551 05-11 15:25:44.670: ERROR/RenderScript(14985): bcc: FAILS to prepare executable 05-11 15:25:44.670: DEBUG/RenderScript(14985): >>>> ~ScriptC bccDisposeScript(0x17d8f0) 05-11 15:25:44.670: ERROR/RenderScript(14985): rsAssert failed: !mUserRefCount, in frameworks/base/libs/rs/rsObjectBase.cpp at 63 05-11 15:25:44.670: DEBUG/AndroidRuntime(14985): Shutting down VM 05-11 15:25:44.670: WARN/dalvikvm(14985): threadid=1: thread exiting with uncaught exception (group=0x4017e760) 05-11 15:25:44.680: ERROR/AndroidRuntime(14985): FATAL EXCEPTION: main 05-11 15:25:44.680: ERROR/AndroidRuntime(14985): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android.rs.helloworld/com.android.rs.helloworld.HelloWorld}: android.renderscript.RSRuntimeException: Loading of ScriptC script failed. 05-11 15:25:44.680: ERROR/AndroidRuntime(14985): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1736) 05-11 15:25:44.680: ERROR/AndroidRuntime(14985): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1752) 05-11 15:25:44.680: ERROR/AndroidRuntime(14985): at android.app.ActivityThread.access$1500(ActivityThread.java:123) 05-11 15:25:44.680: ERROR/AndroidRuntime(14985): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:993) 05-11 15:25:44.680: ERROR/AndroidRuntime(14985): at android.os.Handler.dispatchMessage(Handler.java:99) 05-11 15:25:44.680: ERROR/AndroidRuntime(14985): at android.os.Looper.loop(Looper.java:126) 05-11 15:25:44.680: ERROR/AndroidRuntime(14985): at android.app.ActivityThread.main(ActivityThread.java:3997) 05-11 15:25:44.680: ERROR/AndroidRuntime(14985): at java.lang.reflect.Method.invokeNative(Native Method) 05-11 15:25:44.680: ERROR/AndroidRuntime(14985): at java.lang.reflect.Method.invoke(Method.java:491) 05-11 15:25:44.680: ERROR/AndroidRuntime(14985): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841) 05-11 15:25:44.680: ERROR/AndroidRuntime(14985): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599) 05-11 15:25:44.680: ERROR/AndroidRuntime(14985): at dalvik.system.NativeStart.main(Native Method) 05-11 15:25:44.680: ERROR/AndroidRuntime(14985): Caused by: android.renderscript.RSRuntimeException: Loading of ScriptC script failed. 05-11 15:25:44.680: ERROR/AndroidRuntime(14985): at android.renderscript.ScriptC.(ScriptC.java:60) 05-11 15:25:44.680: ERROR/AndroidRuntime(14985): at com.android.rs.helloworld.ScriptC_helloworld.(ScriptC_helloworld.java:32) 05-11 15:25:44.680: ERROR/AndroidRuntime(14985): at com.android.rs.helloworld.HelloWorldRS.initRS(HelloWorldRS.java:46) 05-11 15:25:44.680: ERROR/AndroidRuntime(14985): at com.android.rs.helloworld.HelloWorldRS.init(HelloWorldRS.java:37) 05-11 15:25:44.680: ERROR/AndroidRuntime(14985): at com.android.rs.helloworld.HelloWorldView.ensureRenderScript(HelloWorldView.java:44) 05-11 15:25:44.680: ERROR/AndroidRuntime(14985): at com.android.rs.helloworld.HelloWorldView.(HelloWorldView.java:33) 05-11 15:25:44.680: ERROR/AndroidRuntime(14985): at com.android.rs.helloworld.HelloWorld.onCreate(HelloWorld.java:33) 05-11 15:25:44.680: ERROR/AndroidRuntime(14985): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1048) 05-11 15:25:44.680: ERROR/AndroidRuntime(14985): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1700) 05-11 15:25:44.680: ERROR/AndroidRuntime(14985): ... 11 more 05-11 15:25:44.680: WARN/ActivityManager(130): Force finishing activity com.android.rs.helloworld/.HelloWorld
我正在尝试在运行 3.0.1 的 Xoom 上构建。 谁能确认您是否能够安装 RenderScript 示例?
谢谢。
I am trying to build one of the RenderScript examples in the android/sdk/samples.
I've tried HelloWorld and Balls examples, but the application is force closing
05-11 15:25:44.670: WARN/bcc(14985): Unable to open /data/data/com.android.rs.helloworld/cache/@com.android.rs.helloworld:[email protected] in read mode. (reason: No such file or directory) 05-11 15:25:44.670: ERROR/bcc(14985): Unable to readBC, bitcode=0x17d3f8, size=1068 05-11 15:25:44.670: DEBUG/StopWatch(14985): StopWatch bcc: PrepareExecutable time (us): 1551 05-11 15:25:44.670: ERROR/RenderScript(14985): bcc: FAILS to prepare executable 05-11 15:25:44.670: DEBUG/RenderScript(14985): >>>> ~ScriptC bccDisposeScript(0x17d8f0) 05-11 15:25:44.670: ERROR/RenderScript(14985): rsAssert failed: !mUserRefCount, in frameworks/base/libs/rs/rsObjectBase.cpp at 63 05-11 15:25:44.670: DEBUG/AndroidRuntime(14985): Shutting down VM 05-11 15:25:44.670: WARN/dalvikvm(14985): threadid=1: thread exiting with uncaught exception (group=0x4017e760) 05-11 15:25:44.680: ERROR/AndroidRuntime(14985): FATAL EXCEPTION: main 05-11 15:25:44.680: ERROR/AndroidRuntime(14985): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android.rs.helloworld/com.android.rs.helloworld.HelloWorld}: android.renderscript.RSRuntimeException: Loading of ScriptC script failed. 05-11 15:25:44.680: ERROR/AndroidRuntime(14985): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1736) 05-11 15:25:44.680: ERROR/AndroidRuntime(14985): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1752) 05-11 15:25:44.680: ERROR/AndroidRuntime(14985): at android.app.ActivityThread.access$1500(ActivityThread.java:123) 05-11 15:25:44.680: ERROR/AndroidRuntime(14985): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:993) 05-11 15:25:44.680: ERROR/AndroidRuntime(14985): at android.os.Handler.dispatchMessage(Handler.java:99) 05-11 15:25:44.680: ERROR/AndroidRuntime(14985): at android.os.Looper.loop(Looper.java:126) 05-11 15:25:44.680: ERROR/AndroidRuntime(14985): at android.app.ActivityThread.main(ActivityThread.java:3997) 05-11 15:25:44.680: ERROR/AndroidRuntime(14985): at java.lang.reflect.Method.invokeNative(Native Method) 05-11 15:25:44.680: ERROR/AndroidRuntime(14985): at java.lang.reflect.Method.invoke(Method.java:491) 05-11 15:25:44.680: ERROR/AndroidRuntime(14985): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841) 05-11 15:25:44.680: ERROR/AndroidRuntime(14985): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599) 05-11 15:25:44.680: ERROR/AndroidRuntime(14985): at dalvik.system.NativeStart.main(Native Method) 05-11 15:25:44.680: ERROR/AndroidRuntime(14985): Caused by: android.renderscript.RSRuntimeException: Loading of ScriptC script failed. 05-11 15:25:44.680: ERROR/AndroidRuntime(14985): at android.renderscript.ScriptC.(ScriptC.java:60) 05-11 15:25:44.680: ERROR/AndroidRuntime(14985): at com.android.rs.helloworld.ScriptC_helloworld.(ScriptC_helloworld.java:32) 05-11 15:25:44.680: ERROR/AndroidRuntime(14985): at com.android.rs.helloworld.HelloWorldRS.initRS(HelloWorldRS.java:46) 05-11 15:25:44.680: ERROR/AndroidRuntime(14985): at com.android.rs.helloworld.HelloWorldRS.init(HelloWorldRS.java:37) 05-11 15:25:44.680: ERROR/AndroidRuntime(14985): at com.android.rs.helloworld.HelloWorldView.ensureRenderScript(HelloWorldView.java:44) 05-11 15:25:44.680: ERROR/AndroidRuntime(14985): at com.android.rs.helloworld.HelloWorldView.(HelloWorldView.java:33) 05-11 15:25:44.680: ERROR/AndroidRuntime(14985): at com.android.rs.helloworld.HelloWorld.onCreate(HelloWorld.java:33) 05-11 15:25:44.680: ERROR/AndroidRuntime(14985): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1048) 05-11 15:25:44.680: ERROR/AndroidRuntime(14985): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1700) 05-11 15:25:44.680: ERROR/AndroidRuntime(14985): ... 11 more 05-11 15:25:44.680: WARN/ActivityManager(130): Force finishing activity com.android.rs.helloworld/.HelloWorld
I am attempting to build on the Xoom running 3.0.1.
Can anyone please confirm if you are able to install a RenderScript example?
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
编译器存在一个公认的问题,导致任何示例无法运行。该问题已在此处解决。
Android 团队提供的解决方法是将您的 platform-tools 目录替换为使用 3.0 编译器的上一版本中的目录。
这个修复对我有用。
There was an acknowledged problem with the compiler that prevented any of the samples from running. It was addressed here.
The workaround provided by the android team is to replace your platform-tools directory with the one from a previous release which uses the compiler from 3.0.
This fix worked for me.
嗯……这个黄色的大警告刚刚弹出,告诉我这不是一个讨论论坛,我必须回答这个问题!但由于没有人(包括我自己)真正了解 Renderscript,我觉得有必要提供一些帮助。还因为 Google 明确指出 StackOverflow 作为 Android 资源。所以向管理员致歉!
不管怎样,我已经在 Eclipse 中成功运行了所有示例,但没有使用模拟器运行。模拟器(至少在我的机器上)非常慢。我买了一台 Xoom,在它上面运行所有示例非常容易。
因此,如果您使用 Eclipse 和实际的 Xoom(不是模拟器),那么我建议从头开始安装全新的 Eclipse 和全新的 Android SDK。并确保使用“New Android Project”导入示例。向导中的某处有一个选项专门用于导入示例。
Hmmmm... This big yellow warning just popped up telling me this is not a discussion forum and I MUST ANSWER THE QUESTION! But since no one (including myself) really knows anything about Renderscript, I feel compelled to offer some assistance. And also because Google specifically points to StackOverflow as an Android resource. So apologies to the administrators!
Anyway, I've successfully run all the samples in Eclipse but NOT with the emulator. The emulator (at least on my machine) is hideously slow. I bought a Xoom and it's been pretty easy to get all the samples to run on it.
So if you're using Eclipse and an actual Xoom (not the emulator) then I suggest starting from scratch with a fresh Eclipse installation and a fresh Android SDK installation. And make sure you use the "New Android Project" to import the samples. There's a selection somewhere in the wizard that specifically addresses importing a sample.