Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error Illegal use of non virtual function call #14

Closed
chemouna opened this issue Sep 12, 2014 · 4 comments
Closed

Error Illegal use of non virtual function call #14

chemouna opened this issue Sep 12, 2014 · 4 comments

Comments

@chemouna
Copy link

Hi,
Thanks a lot for this template,
I'm trying to apply the same structure to my project everything worked fine except in my unit test module
i got :
Error:(20, 0) (class: com/novoda/gradle/test/SupportedLanguages, method: super$1$stream signature: ()Ljava/util/stream/Stream;) Illegal use of nonvirtual function call

I added :
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
to my app module thinking maybe it's because of java version but that didn't work.
should i launch the install script install-custom-gradle-test-plugin.sh and use android-studio-robolectric-support.gradle with a specific java version ?

thanks.

@nenick
Copy link
Owner

nenick commented Sep 12, 2014

your default version is java 6 or 8? then yes try to force java 7 for both builds. (plugin and your project)

See also #7

@andreizilla
Copy link

Hello... I have successfully built and run your template with Java 1.7, however, I want to use it with Java 1.8. The reason is I want to write my main application in Java 1.8 ,but I would like to use your template as a starting point (because it has all the jacoco stuff set up for robolectric and espresso)

Is there any way to get it to work for 1.8? If not, is there a way I can compile my app with 1.8 but use 1.7 for the tasks that your template depends on?

Currently I get this error (described in this thread) if I try it with 1.8

@nenick
Copy link
Owner

nenick commented Oct 12, 2014

Maybe this will be just one error in a error chain .. i never read that java 8 is supported for android. There are some projects to support the lambda.

Let us do following experiment. Build a simple app (new project with android studio) based on Java 8 and use all java 8 features you like to have. Let it run on your test device.

If it work, great then we should try to make this template java 8 compatible.

@nenick
Copy link
Owner

nenick commented Oct 12, 2014

I'm thinking about to switch the base plugin which support robolectric by https://github.com/JCAndKSolutions/android-unit-test

Please try the given example for this plugin with Java 8. There can also jacoco be enabled I have already an working example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants