0

Prior to Android Studio 3.6 it was possible for me to run a pure Java Class without any configuration. After the update of Android Studio to version 3.6 I'm not able anymore to run a pure Java Class. There are multiple things which really getting on my nerves because of AS 3.6....

As a barebone example

public class Test {
   public static void main(String[] args) {
      System.out.println("Hello")
   }
}

As I said prior to AS 3.6 I could run this. But now, I get the following Exception

* What went wrong:
A problem occurred configuring project ':app'.
> Could not create task ':app:Test.main()'.
   > SourceSet with name 'main' not found.
Sceada
  • 513
  • 2
  • 11
  • you might have a look here https://stackoverflow.com/questions/51610420/deprecated-gradle-features-were-used-in-this-build-making-it-incompatible-with – sadat Mar 02 '20 at 13:30
  • I just ran this exact code and mine worked. And I am using 3.6. Try naming your class something other than Test? –  Mar 02 '20 at 13:31
  • @Brokoth I tried it with several names without any success. – Sceada Mar 02 '20 at 13:43
  • @Sceada Are you running the class specifically(right clicking anywhere in file then running that file) ? –  Mar 02 '20 at 16:52
  • @Brokoth Yes, I tried different things to run the class. I also tried to edit the run configuration. Well I guess the problem lies in my project gradle file. Actually I have no idea why, but another problem (Data-Binding) was gradle related, after the AS Update. – Sceada Mar 03 '20 at 08:00

1 Answers1

-4

Check your android manifest and make sure some activity define to launcher

lukman nudin
  • 379
  • 2
  • 6