Using the deprecated method to apply the Flutter plug-in loader and the main Gradle plug-in: You are still using the apply script method to apply Flutter's app_plugin_loader and the main Gradle plug-in, and this method is no longer recommended. It is recommended that you migrate to using declarative plug-in blocks to apply for Gradle plug-ins.
Compilation errors: There are still some compilation errors in your code, mainly related to the problem that some text styles (such as subtitle1, caption, headline6, bodyText1, etc.) are not defined. This may be caused by your code using a text style that is no longer supported or by changes in the related API. You need to update your code to ensure that the text styles used are up to date and supported in your version of the Flutter SDK.
Flutter compilation failed: The final error message displays the information that Flutter compilation failed. This may be due to the previously mentioned issue. You can try running the command with the --stacktrace option to get more detailed stack trace information to better locate the problem.
How to solve it, hope to get your reply, thank you!
~/workSpace/UUVPN/flutter (main ✗) flutter run
Launching lib/main.dart on MI 9 SE in debug mode...
You are applying Flutter's app_plugin_loader Gradle plugin imperatively using the apply script method, which is deprecated and will be removed in a future release. Migrate to applying Gradle plugins with the declarative plugins block: https://flutter.dev/go/flutter-gradle-plugin-apply
You are applying Flutter's main Gradle plugin imperatively using the apply script method, which is deprecated and will be removed in a future release. Migrate to applying Gradle plugins with the declarative plugins block: https://flutter.dev/go/flutter-gradle-plugin-apply
lib/model/themeCollection.dart:47:11: Error: No named parameter with the name 'bodyText1'.
bodyText1: const TextStyle(color: Colors.black, fontSize: 15),
^^^^^^^^^
../../../flutter/packages/flutter/lib/src/material/text_theme.dart:89:9: Context: Found this candidate, but the arguments don't match.
const TextTheme({
^^^^^^^^^
lib/model/themeCollection.dart:65:11: Error: No named parameter with the name 'bodyText1'.
bodyText1: TextStyle(color: Colors.white, fontSize: 15),
^^^^^^^^^
../../../flutter/packages/flutter/lib/src/material/text_theme.dart:89:9: Context: Found this candidate, but the arguments don't match.
const TextTheme({
^^^^^^^^^
lib/widgets/home_widget.dart:46:69: Error: The getter 'subtitle1' isn't defined for the class 'TextTheme'.
- 'TextTheme' is from 'package:flutter/src/material/text_theme.dart' ('../../../flutter/packages/flutter/lib/src/material/text_theme.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'subtitle1'.
Text(title, style: Theme.of(context).primaryTextTheme.subtitle1),
^^^^^^^^^
lib/widgets/home_widget.dart:50:61: Error: The getter 'caption' isn't defined for the class 'TextTheme'.
- 'TextTheme' is from 'package:flutter/src/material/text_theme.dart' ('../../../flutter/packages/flutter/lib/src/material/text_theme.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'caption'.
style: Theme.of(context).primaryTextTheme.caption,
^^^^^^^
lib/pages/proPage.dart:162:55: Error: The getter 'caption' isn't defined for the class 'TextTheme'.
- 'TextTheme' is from 'package:flutter/src/material/text_theme.dart' ('../../../flutter/packages/flutter/lib/src/material/text_theme.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'caption'.
style: Theme.of(context).primaryTextTheme.caption,
^^^^^^^
lib/pages/proPage.dart:189:22: Error: The getter 'headline6' isn't defined for the class 'TextTheme'.
- 'TextTheme' is from 'package:flutter/src/material/text_theme.dart' ('../../../flutter/packages/flutter/lib/src/material/text_theme.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'headline6'.
.headline6!
^^^^^^^^^
lib/pages/proPage.dart:212:24: Error: The getter 'headline6' isn't defined for the class 'TextTheme'.
- 'TextTheme' is from 'package:flutter/src/material/text_theme.dart' ('../../../flutter/packages/flutter/lib/src/material/text_theme.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'headline6'.
.headline6!
^^^^^^^^^
lib/pages/proPage.dart:219:24: Error: The getter 'bodyText1' isn't defined for the class 'TextTheme'.
- 'TextTheme' is from 'package:flutter/src/material/text_theme.dart' ('../../../flutter/packages/flutter/lib/src/material/text_theme.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'bodyText1'.
.bodyText1!
^^^^^^^^^
lib/pages/ProOnecePage.dart:81:59: Error: The getter 'headline6' isn't defined for the class 'TextTheme'.
- 'TextTheme' is from 'package:flutter/src/material/text_theme.dart' ('../../../flutter/packages/flutter/lib/src/material/text_theme.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'headline6'.
style: Theme.of(context).primaryTextTheme.headline6!.copyWith(
^^^^^^^^^
lib/pages/ProOnecePage.dart:90:55: Error: The getter 'caption' isn't defined for the class 'TextTheme'.
- 'TextTheme' is from 'package:flutter/src/material/text_theme.dart' ('../../../flutter/packages/flutter/lib/src/material/text_theme.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'caption'.
style: Theme.of(context).primaryTextTheme.caption,
^^^^^^^
lib/pages/ProOnecePage.dart:117:22: Error: The getter 'headline6' isn't defined for the class 'TextTheme'.
- 'TextTheme' is from 'package:flutter/src/material/text_theme.dart' ('../../../flutter/packages/flutter/lib/src/material/text_theme.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'headline6'.
.headline6!
^^^^^^^^^
lib/pages/ProOnecePage.dart:140:24: Error: The getter 'headline6' isn't defined for the class 'TextTheme'.
- 'TextTheme' is from 'package:flutter/src/material/text_theme.dart' ('../../../flutter/packages/flutter/lib/src/material/text_theme.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'headline6'.
.headline6!
^^^^^^^^^
lib/pages/ProOnecePage.dart:147:24: Error: The getter 'bodyText1' isn't defined for the class 'TextTheme'.
- 'TextTheme' is from 'package:flutter/src/material/text_theme.dart' ('../../../flutter/packages/flutter/lib/src/material/text_theme.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'bodyText1'.
.bodyText1!
^^^^^^^^^
lib/pages/homePage.dart:85:59: Error: The getter 'headline6' isn't defined for the class 'TextTheme'.
- 'TextTheme' is from 'package:flutter/src/material/text_theme.dart' ('../../../flutter/packages/flutter/lib/src/material/text_theme.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'headline6'.
style: Theme.of(context).primaryTextTheme.headline6,
^^^^^^^^^
lib/pages/homePage.dart:88:61: Error: The getter 'caption' isn't defined for the class 'TextTheme'.
- 'TextTheme' is from 'package:flutter/src/material/text_theme.dart' ('../../../flutter/packages/flutter/lib/src/material/text_theme.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'caption'.
style: Theme.of(context).primaryTextTheme.caption),
^^^^^^^
lib/routes/chooseLocationRoute.dart:33:57: Error: The getter 'subtitle1' isn't defined for the class 'TextTheme'.
- 'TextTheme' is from 'package:flutter/src/material/text_theme.dart' ('../../../flutter/packages/flutter/lib/src/material/text_theme.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'subtitle1'.
style: Theme.of(context).primaryTextTheme.subtitle1,
^^^^^^^^^
lib/pages/accountPage.dart:86:69: Error: The getter 'subtitle1' isn't defined for the class 'TextTheme'.
- 'TextTheme' is from 'package:flutter/src/material/text_theme.dart' ('../../../flutter/packages/flutter/lib/src/material/text_theme.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'subtitle1'.
Text(title, style: Theme.of(context).primaryTextTheme.subtitle1),
^^^^^^^^^
lib/pages/accountPage.dart:90:61: Error: The getter 'caption' isn't defined for the class 'TextTheme'.
- 'TextTheme' is from 'package:flutter/src/material/text_theme.dart' ('../../../flutter/packages/flutter/lib/src/material/text_theme.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'caption'.
style: Theme.of(context).primaryTextTheme.caption,
^^^^^^^
lib/pages/accountPage.dart:118:16: Error: The getter 'bodyText1' isn't defined for the class 'TextTheme'.
- 'TextTheme' is from 'package:flutter/src/material/text_theme.dart' ('../../../flutter/packages/flutter/lib/src/material/text_theme.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'bodyText1'.
.bodyText1!
^^^^^^^^^
lib/pages/accountPage.dart:203:63: Error: The getter 'bodyText1' isn't defined for the class 'TextTheme'.
- 'TextTheme' is from 'package:flutter/src/material/text_theme.dart' ('../../../flutter/packages/flutter/lib/src/material/text_theme.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'bodyText1'.
style: Theme.of(context).primaryTextTheme.bodyText1,
^^^^^^^^^
lib/pages/accountPage.dart:254:57: Error: The getter 'subtitle1' isn't defined for the class 'TextTheme'.
- 'TextTheme' is from 'package:flutter/src/material/text_theme.dart' ('../../../flutter/packages/flutter/lib/src/material/text_theme.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'subtitle1'.
style: Theme.of(context).primaryTextTheme.subtitle1),
^^^^^^^^^
lib/routes/settingsRoute.dart:41:69: Error: The getter 'subtitle1' isn't defined for the class 'TextTheme'.
- 'TextTheme' is from 'package:flutter/src/material/text_theme.dart' ('../../../flutter/packages/flutter/lib/src/material/text_theme.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'subtitle1'.
Text(title, style: Theme.of(context).primaryTextTheme.subtitle1),
^^^^^^^^^
lib/routes/settingsRoute.dart:45:61: Error: The getter 'caption' isn't defined for the class 'TextTheme'.
- 'TextTheme' is from 'package:flutter/src/material/text_theme.dart' ('../../../flutter/packages/flutter/lib/src/material/text_theme.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'caption'.
style: Theme.of(context).primaryTextTheme.caption,
^^^^^^^
lib/routes/settingsRoute.dart:73:16: Error: The getter 'bodyText1' isn't defined for the class 'TextTheme'.
- 'TextTheme' is from 'package:flutter/src/material/text_theme.dart' ('../../../flutter/packages/flutter/lib/src/material/text_theme.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'bodyText1'.
.bodyText1!
^^^^^^^^^
lib/routes/settingsRoute.dart:100:20: Error: The getter 'subtitle1' isn't defined for the class 'TextTheme'.
- 'TextTheme' is from 'package:flutter/src/material/text_theme.dart' ('../../../flutter/packages/flutter/lib/src/material/text_theme.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'subtitle1'.
.subtitle1!
^^^^^^^^^
lib/routes/settingsRoute.dart:112:57: Error: The getter 'subtitle1' isn't defined for the class 'TextTheme'.
- 'TextTheme' is from 'package:flutter/src/material/text_theme.dart' ('../../../flutter/packages/flutter/lib/src/material/text_theme.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'subtitle1'.
style: Theme.of(context).primaryTextTheme.subtitle1,
^^^^^^^^^
Target kernel_snapshot failed: Exception
FAILURE: Build failed with an exception.
* Where:
Script '/Users/wanghua/flutter/packages/flutter_tools/gradle/src/main/groovy/flutter.groovy' line: 1629
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command '/Users/wanghua/flutter/bin/flutter'' finished with non-zero exit value 1
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 5s
Running Gradle task 'assembleDebug'... 5.8s
Error: Gradle task assembleDebug failed with exit code 1
I have a problem running the app:
Using the deprecated method to apply the Flutter plug-in loader and the main Gradle plug-in: You are still using the apply script method to apply Flutter's app_plugin_loader and the main Gradle plug-in, and this method is no longer recommended. It is recommended that you migrate to using declarative plug-in blocks to apply for Gradle plug-ins.
Compilation errors: There are still some compilation errors in your code, mainly related to the problem that some text styles (such as subtitle1, caption, headline6, bodyText1, etc.) are not defined. This may be caused by your code using a text style that is no longer supported or by changes in the related API. You need to update your code to ensure that the text styles used are up to date and supported in your version of the Flutter SDK.
Flutter compilation failed: The final error message displays the information that Flutter compilation failed. This may be due to the previously mentioned issue. You can try running the command with the --stacktrace option to get more detailed stack trace information to better locate the problem.
How to solve it, hope to get your reply, thank you!