Home > Software engineering >  I get this error in vscode with flutter MainActivity.java is no on the classpath of project app,only
I get this error in vscode with flutter MainActivity.java is no on the classpath of project app,only

Time:04-04

I am trying to use methodchannels to write native Java code for my Flutter project but I get this error:

MainActivity.java is no on the classpath of project app,only syntax errors are reported

I have tried to restart VC code, to create a new project with Java as primary language ,
to right click in the folder and press "add folder to java source path" but I get unsupported operation. pls use build.gradle file to manage the source directories of gradle project ,

I also tried Press "Ctrl Shift P", choose "java : Clean java Language Server workspace,
I also tried all of the above combined but it didn't work

When I create the project with Kotlin language it works fine but I don't want to use Kotlin

CodePudding user response:

i found the problem . java extension for vscode dont work for android/flutter dev , i just uninstalled it and it worked fine

  • Related