ScriptC_ "name" is not created after creating a .rs file (in Android Studio with Gradle)

I just started renderscript in Android Studio. When I create a .rs file, both the ScriptC_DS class and the .bc file are not generated. I read that it should be automatically generated after saving the .rs file, so I'm not sure what is going wrong.

DS.rs

#pragma version(1)
#pragma rs java_package_name(com.example.DSing)

void root(){

}

build.gradle

 apply plugin: 'com.android.application'

android {
compileSdkVersion 20
buildToolsVersion "20.0.0"

defaultConfig {
    applicationId "com.example.DSing"
    minSdkVersion 16
    targetSdkVersion 20
    versionCode 1
    versionName "1.0"
    renderscriptTargetApi 18
    renderscriptSupportMode true

}
buildTypes {
    release {
        runProguard false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
}

There is currently nothing in the MainActivity class (other than automatically configured defaults), but when I try to create private ScriptC_DS inside, I get the message "Cannot resolve ScriptC_DS character". Mainactivity

package com.example.DSing

import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.support.v8.renderscript.*;


public class Main extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
}
private ScriptC_DS test;

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    // Inflate the menu; this adds items to the action bar if it is present.
    getMenuInflater().inflate(R.menu.main, menu);
    return true;
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
    // Handle action bar item clicks here. The action bar will
    // automatically handle clicks on the Home/Up button, so long
    // as you specify a parent activity in AndroidManifest.xml.
    int id = item.getItemId();
    if (id == R.id.action_settings) {
        return true;
    }
    return super.onOptionsItemSelected(item);
}
}

Question: What am I doing wrong?

+4
2

, , , Android Studio Eclipse. app/src/main/java. , RenderScript ( AIDL) , Java. app/src/main/rs, Android Studio .bc.

+16

, , ,

  • gradle renderscriptTargetApi 18 renderscriptSupportModeEnabled true

  • /src/main/rs

, ScriptC_xxx.

+2

All Articles