Fixed
Status Update
Comments
xa...@google.com <xa...@google.com> #2
The renderscript support jar is currently added manually, to the classpath rather than being added as a normal dependency.
We should fix this, however there are some issues to deal with. Because it's a file based dependency and it's coming from the build-tools, there could be some conflicts. For instance a library has a dependency on it from build-tools 25.0.0 but the app brings it in from 26.0.0. How do we solve this.
The best way of course would be too bring this in via a normal dependency (via our maven repo) but then we'll need a new way to make sure the compiler (in build tools) is in sync with it.
At this moment, the only way to fix this would be to also enable rs support mode in the app module.
We should fix this, however there are some issues to deal with. Because it's a file based dependency and it's coming from the build-tools, there could be some conflicts. For instance a library has a dependency on it from build-tools 25.0.0 but the app brings it in from 26.0.0. How do we solve this.
The best way of course would be too bring this in via a normal dependency (via our maven repo) but then we'll need a new way to make sure the compiler (in build tools) is in sync with it.
At this moment, the only way to fix this would be to also enable rs support mode in the app module.
an...@gmail.com <an...@gmail.com> #3
Thanks for your feedback! However, in the project I attached, RS is enabled in both app and library modules, and the problem persists. I guess the only workaround now would be to remove RS from library's API.
ph...@sprylab.com <ph...@sprylab.com> #4
Same problem here, in Unit Tests (using Robolectric) I also get class not found error, the project is a simple library project.
uc...@google.com <uc...@google.com>
xa...@google.com <xa...@google.com> #5
I have a fix for this.
This also needs to be cleaned up to work better. I've filed Issue 66243295 to track further improvements related to this.
This also needs to be cleaned up to work better. I've filed
Description
Android Plugin Version: 3.0.0-beta2
Module Compile Sdk Version: 26
Module Build Tools Version: 26.0.1
Android SDK Tools version: 26.0.2
Steps to reproduce:
1. Create an Android library module that uses RenderScript via the following configuration in build.gradle:
android {
...
defaultConfig {
...
renderscriptTargetApi 20
renderscriptSupportModeEnabled true
}
}
And has the following class:
public class RenderscriptStuff {
public static RenderScript getRS(Context context) {
return RenderScript.create(context);
}
}
2. Create an Android app module that contains the following class in androidTest directory:
@RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest {
@Test public void canGetRS() {
Context appContext = InstrumentationRegistry.getTargetContext();
assertNotNull(RenderscriptStuff.getRS(appContext));
}
}
3. Run the following command from the command line:
./gradlew compileDebugAndroidTestSources
Expected behavior:
- Compilation succeeds
Actual behavior:
- Compilation fails with the following error:
ExampleInstrumentedTest.java:28: error: cannot access RenderScript
assertNotNull(RenderscriptStuff.getRS(appContext));
^
class file for android.support.v8.renderscript.RenderScript not found
1 error
Please find a project that reproduces the issue in the attachments.