package org.example;
import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;
import android.view.Window;
public class App extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
super.onCreate(savedInstanceState);
TextView textView = new TextView(this);
textView.setText(getText(R.string.hello_world));
setContentView(textView);
}
public static void main(String[] args) {
System.out.println("Hello World!");
}
public String getGreeting() {
return "Hello, World!";
}
}
AppTest.java
package org.example;
import android.content.Context;
import org.testng.annotations.*;
import static org.testng.Assert.*;
public class AppTest {
@Test public void appHasAGreeting() {
App classUnderTest = new App();
assertNotNull(classUnderTest.getGreeting(), "app should have a greeting");
}
}
I’m also getting 2 warnings in VS Code “Problems”
App.java is not on the classpath of project app, only syntax errors are reported AppTest.java is not on the classpath of project app, only syntax errors are reported
My time is too valuable to use a fancy text editor, when I instead can use an awesome IDE :-D, so I cannot tell you anything about VSC stuff or errors it displays, besides that it is anyway out of scope for a Gradle forum.
That the scan is from the same project is irrelevant, the scan must be from the exact invocation that produces what you want to show or it is useless.
You could programmatically enable build scans to also capture runs not under your direct control, but as you say that report is generated if you save in VSC and not otherwise, it looks to me like the VSC Gradle integration is doing bad things that triggers this and you should head to its maintainers instead.