Gradle not finding main method after changing project structure

Viewed 27

Hey you Devs out there,

I am currently rebuilding an old app using Flutter, a good proactive to learn the framework.

When I started, I've only had a single file containing my source code: main.dart

Now I've re-steuctured my project, and the void main() is now located in app.dart

When building a signed APK using gradle, gradle will look for the main method in main.dart (where it isn't anymore)

The question is: How do I tell gradle where to look? I've looked into every file I found, build.gradle and so on. Where do I edit this?

This might seem like a dumb question, but I'm not a gradle specialist, and it is driving me crazy that my whole app won't build just because of this little mistake.

Hope you can help me!

Tried to edit all the files, build.gradle,he properties file, pubspec.yaml,... I have no idea where to set the path to app.dart

1 Answers

You have to use main.dart. Gradle doesn't look at dart files. Gradle is just for Java and Kotlin files.

Related