You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an android project I'm working on. For some reason, every .java file in app/src gives me this warning:
I've searched quite a bit online and have already tried things like:
"Java: Clean Java Language Server Workspace"
Modified .vscode/settings.json to include "app/src" in "java.project.sourcePaths"
Modifying "sourceSets.main.java.srcDirs" in root build.gradle
None of this has worked for me. Everything (in my actual project -- screenshot was from test project) builds/runs in Android Studio, so I'm fairly certain the gradle build files are set up correctly.
I'm not sure if this is necessarily an issue with the extension (probably just configuration -- I'm a gradle noob after all), but I've exhausted all the troubleshooting information I could find on this topic.
Environment
Operating System: macOS 12.6.8
JDK version: 20.0.2
Visual Studio Code version: 1.82.1
Java extension version: 1.22.1
Steps To Reproduce
Create a new Android Project
Convert the MainActivity.kt file to a java file
package com.example.myapplication;
// import android.os.Bundle
import androidx.activity.ComponentActivity;
// import androidx.activity.compose.setContent
// import androidx.compose.foundation.layout.fillMaxSize
// import androidx.compose.material3.MaterialTheme
// import androidx.compose.material3.Surface
// import androidx.compose.material3.Text
// import androidx.compose.runtime.Composable
// import androidx.compose.ui.Modifier
// import androidx.compose.ui.tooling.preview.Preview
// import com.example.myapplication.ui.theme.MyApplicationTheme
class MainActivity extends ComponentActivity {
// fun onCreate(savedInstanceState: Bundle?) {
// super.onCreate(savedInstanceState)
// setContent {
// MyApplicationTheme {
// // A surface container using the 'background' color from the theme
// Surface(
// modifier = Modifier.fillMaxSize(),
// color = MaterialTheme.colorScheme.background
// ) {
// Greeting("Android")
// }
// }
// }
// }
}
I have an android project I'm working on. For some reason, every
.java
file inapp/src
gives me this warning:I've searched quite a bit online and have already tried things like:
.vscode/settings.json
to include "app/src" in "java.project.sourcePaths"build.gradle
None of this has worked for me. Everything (in my actual project -- screenshot was from test project) builds/runs in Android Studio, so I'm fairly certain the gradle build files are set up correctly.
I'm not sure if this is necessarily an issue with the extension (probably just configuration -- I'm a gradle noob after all), but I've exhausted all the troubleshooting information I could find on this topic.
Environment
Steps To Reproduce
MainActivity.kt
file to a java fileTest Project.zip
Current Result
The warning displays despite gradle being able to build it
Expected Result
Packages resolve correctly in
app/src
and this warning is not displayedThe text was updated successfully, but these errors were encountered: