0

I have seen the question already asked in Can't find ScriptC_saturation in BasicRenderScript Sample but as I am new in RenderScript, I can make it out they have already done much, so I cannot find the question as low level as I am asking:

  1. I am using Eclipse Juno and have imported the BasicRenderScriptSample.

  2. I am using the android.support.v8.renderscript (

(eclipse) project properties:

renderscript.target=18
renderscript.support.mode=true
sdk.buildtools=19.0.3

When I was not sure why the ScriptC_saturation is not auto generated, I was stuck till I followed the answer below, and copied the .rc file in the necessary folder, and everything compiled well.

Update: Setup the necessary gradle properties as below (using jcenter rather than mavencentral):

apply plugin: 'com.android.application'

android {
    compileSdkVersion 'android-L'
    buildToolsVersion "20.0.0"

    defaultConfig {
        applicationId "com.example.android.basicrenderscript"
        minSdkVersion 'L'
        targetSdkVersion 'L'
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            runProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile "com.android.support:appcompat-v7:18.0.+"
}

On Compilation I get this error in emulator and device all alike (from eclipse as well):

RenderScript﹕ bcc compiler terminated unexpectedly
RenderScript﹕ bcc: FAILS to prepare executable for 'saturation'

What could be the reason?

update 2: My Eclipse version of this project, somehow ran after series of cleaning, on the device (less than L) properly, but Gradle version project runs with THE error everywhere.

Community
  • 1
  • 1
Abhinav Saxena
  • 1,990
  • 2
  • 24
  • 55

1 Answers1

2

Don't put the .rs file in your res/ folders. It is a source file, not a resource. It dynamically creates .bc files which do end up automatically in your res/raw folder.

Stephen Hines
  • 2,612
  • 1
  • 13
  • 12
  • 1
    I don't agree. If this is so, then please explain this line: rs.getApplicationContext().getResources().getIdentifier( __rs_resource_name, "raw", rs.getApplicationContext().getPackageName()); Question 3: My .rc file is still there in the rs folder, why did eclipse did not create anything, if what you say is true? – Abhinav Saxena Jul 22 '14 at 08:30
  • 1
    When building with Eclipse, your RenderScript source file (.rs) goes into the directory matching the Java package it belongs in, just like Java code. When you are building with Android Studio, your rs file goes in src/main/rs/. – Larry Schiefer Jul 22 '14 at 15:12
  • 2
    Later versions of the API only take the context for this reason, and to simplify writing code. – R. Jason Sams Jul 22 '14 at 19:56
  • My bad! I just went through the sample provided in the early API level 16 RenderScript\HelloCompute project. I moved the .rs file to the package where MainActivity is, and this ScriptC_saturation file has been created. That was what I wanted to know. More information I got in http://stackoverflow.com/questions/14992795/eclipse-stops-compiling-renderscript-file. – Abhinav Saxena Jul 23 '14 at 05:34