Vscode-java: How can I get my Android App on the Classpath

Created on 21 Dec 2017  Â·  10Comments  Â·  Source: redhat-developer/vscode-java

Trouble with Gradle Based Android java project.

All the java files in app/src/main/java get this error "*.java isn't on the classpath. Only syntax errors will be reported"

My System

  • Linux (Debian based) 64bit
  • Oracle JDK 1.8.0_141
  • VSCode Version 1.19.1 - Date 2017-12-19T09:41:01.414Z
  • Language support for Java â„¢ for Visual Studio Code v 0.16.0

Steps To Reproduce

  1. Open the root folder of the project
  2. Open any *.java source file

java-language-server.log
ClasspathIssue.zip

Current Result

File is not on the classpath

Expected Result

file to be on the classpath

Additional Informations

I first had it on a larger project, I uninstalled all my extensions, updated everything and made this minimal project using Android Studio 3, problem persists.
I dont have eclipse installed (I notice that vscode-java throws an exception when it cant load some eclipse lib).
There was nothing in the console log, and I have included the java-language-server log

Thankyou

Gradle bug upstream

Most helpful comment

@fbricon Thank you for clarifying this. May I suggest that you specifically add a mention that Android is not supported at the moment to the classpath warning wiki page? It is not mentioned there and took me quite some time to figure out what was wrong.

All 10 comments

I'm exhibiting the exact same issue for an Android project (in react-native). I have freshly installed VSCode, and tested both opening it at my repo root, and on the android/ folder (which contains a build.gradle

Sorry but Android development is not supported at the moment. This is a limitation of BuildShip, the project providing Gradle support.

Fair enough, and please forgive me if I ask this here but is there an
alternative that can provide Java language support.
Or are there any good docs that might give somebody a good basis to debug
the plugin or at least figure out a work around, eg do you think getting
eclipse on my system would help?
I just don't want to fire up Android studio unless I really do need a
dreadnaught class battle Star :-)

On 9 Jan 2018 23:50, "Fred Bricon" notifications@github.com wrote:

Sorry but Android development is not supported at the moment. This is
a limitation
of BuildShip https://bugs.eclipse.org/bugs/show_bug.cgi?id=468315, the
project providing Gradle support.

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/redhat-developer/vscode-java/issues/396#issuecomment-356323767,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AEJhecKdIGcukTFURHJig0PyfwuiUtJNks5tI4qtgaJpZM4RJXfP
.

@fbricon Thank you for clarifying this. May I suggest that you specifically add a mention that Android is not supported at the moment to the classpath warning wiki page? It is not mentioned there and took me quite some time to figure out what was wrong.

Another vote for a mention on the classpath warning wiki page for Android. It takes people (like me) too long to find this particular issue.

I've updated the classpath warning wiki page. The statement about unsupported Android has been visible on the project's README.md (here and the VS Code Marketplace) for the past 2 years.

After see the upstream‘s plan, they do not want to write android support, so can we change upstream or write one ourself?

guys, enter "AIDE" in Google Play Market! you'll find android studio which can be installed on android (also supports NDK and layout constructor!). if people(s) reimplemented gradle/android-layout-constructor/android-gradle-build-plugin on android!!! , how said @gggin :

can we change upstream or write one ourself?

we can write own upstream ourself !!!!1!

I think we can just put a little more effort to:

  • Run gradle (android plugin) to generate necessary codes (R class etc)
  • Figure out all the classpath used by gradle and generate one our self?

which upstreams used in other ide's? like in android studio?
//so, currently i'm just porting my old android project (from AIDE) to gradle 5. (android studio installed!)

Was this page helpful?
0 / 5 - 0 ratings