0
votes

I receive the errors below while upgrading to the newest studio (0.2.3) and newest SDK (4.3). I have a few non-root functions in my renderscript file and the compiler gives a error that these functions are not supported in SDK levels 11-15. Therefore, I set my level to 16 in the build.gradle and the manifest file. I am not sure why I have to do this twice. Maybe the manifest is not used anymore. After changing to 16 level I noticed that the error below still shows "-target-api 11". How do I get around this problem? I had these non-root functions in my renderscript file before this upgrade.

Thanks,

Gradle: C:\Users\tec\workspace\Hunting\Hunting360\src\bw.rs:66:6: error: Non-root compute kernel convert_to_bw() is not supported in SDK levels 11-15 C:\Users\tec\workspace\Hunting\Hunting360\src\bw.rs:86:6: error: Non-root compute kernel init_history() is not supported in SDK levels 11-15 C:\Users\tec\workspace\Hunting\Hunting360\src\bw.rs:92:6: error: Non-root compute kernel Black_White_Process() is not supported in SDK levels 11-15

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':Hunting360:compileDebugRenderscript'.

    Failed to run command: C:\Program Files (x86)\Android\android-studio\sdk\build-tools\18.0.1\llvm-rs-cc.exe -O 3 -I C:\Program Files (x86)\Android\android-studio\sdk\build-tools\18.0.1\renderscript\include\ -I C:\Program Files (x86)\Android\android-studio\sdk\build-tools\18.0.1\renderscript\clang-include\ -p C:\Users\tec\workspace\Hunting\Hunting360\build\source\rs\debug -o C:\Users\tec\workspace\Hunting\Hunting360\build\res\rs\debug\raw -target-api 11 C:\Users\tec\workspace\Hunting\Hunting360\src\bw.rs C:\Users\tec\workspace\Hunting\Hunting360\src\color.rs Error Code: 1 Output: C:\Users\tec\workspace\Hunting\Hunting360\src\bw.rs:66:6: error: Non-root compute kernel convert_to_bw() is not supported in SDK levels 11-15 C:\Users\tec\workspace\Hunting\Hunting360\src\bw.rs:86:6: error: Non-root compute kernel init_history() is not supported in SDK levels 11-15 C:\Users\tec\workspace\Hunting\Hunting360\src\bw.rs:92:6: error: Non-root compute kernel Black_White_Process() is not supported in SDK levels 11-15

  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

2
The static in front of the void functions fixed my problems. Thanks hossuser2488826

2 Answers

1
votes
  1. You should use the SDK version and build tool of same version.
  2. In the project property file add the below statement .

    renderscript.target =18
    renderscript.support.mode = true
    sdk.buildtoos="choose depanding on the API level"
    
  3. Classes using RenderScript , add the below import statement.

    import android.support.v8.renderscript.*;
    

Please check may be this will be helpful .

0
votes

Can you post the function signatures for the 3 functions causing issues? A large number of warnings and errors were added to catch minor mistakes. If this is an internal function not called from Java code, you probably just need to mark it static.