chefish
chefish

Reputation: 595

How to build rs fie in AndroidStudio

I am using AndroidStudio. I want to develop with RenderScript, when I create a file hello.rs and build the project,then I try to use ScriptC_hello in java file,but the compiler cannot
find ScriptC_hello class,I think ScriptC_hello.class did not create,but how to create it?

Upvotes: 0

Views: 499

Answers (2)

lydia_schiff
lydia_schiff

Reputation: 2650

Android Studio expects .rs files to be in app/src/main/rs, but you can also override the renderscript source directory in build.gradle.

// build.gradle    

android {
    sourceSets {
        main {
            renderscript.srcDirs = ['src']
        }
    }
}

Upvotes: 1

Larry Schiefer
Larry Schiefer

Reputation: 15775

Make sure your .rs file is in the app/src/main/rs directory in your project. Unlike Eclipse based projects, all your .rs files need to reside here by default rather than alongside the Java files from the same package.

Upvotes: 2

Related Questions