Odd Gradle Issues

I had some odd gradle issues so I openned my project inside android studio instead of visual code studio. Once I openned it asked to upgrade graddle and I said yes. After I ran everythign I was abel to build my app and run it on emmulators fien but I get this error:

Both settings.gradle and settings.gradle.kts exist, so settings.gradle.kts is ignored. This is likely a mistake.
warning: [options] source value 8 is obsolete and will be removed in a future release
warning: [options] target value 8 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
3 warnings
warning: [options] source value 8 is obsolete and will be removed in a future release
warning: [options] target value 8 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
3 warnings
warning: [options] source value 8 is obsolete and will be removed in a future release
warning: [options] target value 8 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
3 warnings
warning: [options] source value 8 is obsolete and will be removed in a future release
warning: [options] target value 8 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
3 warnings
warning: [options] source value 8 is obsolete and will be removed in a future release
warning: [options] target value 8 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
3 warnings
warning: [options] source value 8 is obsolete and will be removed in a future release
warning: [options] target value 8 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
3 warnings
Font asset "MaterialIcons-Regular.otf" was tree-shaken, reducing it from 1645184 to 6200 bytes (99.6% reduction). Tree-shaking can be disabled by providing the --no-tree-shake-icons flag when building your app.
warning: [options] source value 8 is obsolete and will be removed in a future release
warning: [options] target value 8 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
3 warnings
warning: [options] source value 8 is obsolete and will be removed in a future release
warning: [options] target value 8 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
Note: /Users/mike_jones/.pub-cache/hosted/pub.dev/google_mobile_ads-5.3.1/android/src/main/java/io/flutter/plugins/googlemobileads/AdMessageCodec.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
3 warnings
warning: [options] source value 8 is obsolete and will be removed in a future release
warning: [options] target value 8 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
3 warnings

Any tips or suggestions here?

Bad choice.

Flutter uses the old gradle style (build.gradle). Android Studio converted your project to the new style (build.grade.kts) and did such a poor job keeping both files >.<

I would suggest a rollback and never answer yes to Android Studio again.

Hmmm. Because I am lazy and already made a bunch of new code after this that I committed to got… Could I just delete the build.gradle or is it not that easy?

Actually, new versions of Flutter use build.gradle.kts when creating new projects. So, using the Kotlin build stuff is totally fine and works.

There are two options for what you can/should do here:

  1. Create a new Flutter project and compare the gradle stuff between them
  2. Ask an LLM for help converting them “properly”

You could also try posting a bit more about what you had vs what you have now and we can try helping you.

Yes, my mistake. Didn’t even realize that.

A new project created with 3.29 indeed have build.gradle.kts.

So, I would create a new project (assuming you are using a Flutter version that does the .kts) and then try to convert it manually (since it is so important, learning how it works can prevent soooo much headache in the future).

  1. Ask an LLM for help converting them “properly”

2 Likes

How dare you

:rofl:

I have these errors even without .kts files. I have made a new project a few times and copied stuff into it. I guess I have to try again and see if it finally generates the project with .kts files

1 Like