我正在尝试执行我上个月完成的五年计划。我尝试更新flutter插件并升级系统中的flutter。我还创建了一个新项目并尝试在 VS Code 和 Android Studio 上运行它。
我认为问题出在 java.Gradle 或 JDK 上。
我在我的系统上找不到jdk, 不在 C:\Program Files\Java 不在 C:\Users\Name.gradle\jdks
如果您想了解任何版本,请查看 pubspec.yaml:
name: exploreexperthotel
description: "A new Flutter project."
publish_to: "none"
version: 1.0.0+1
environment:
sdk: ">=3.3.4 <4.0.0"
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^1.0.6
firebase_core: ^3.0.0
firebase_analytics: ^11.0.0
firebase_auth: ^5.0.0
sign_in_button: ^3.2.0
image_picker: ^1.1.2
cloud_firestore: ^5.0.0
intl: ^0.19.0
firebase_storage: ^12.0.0
google_generative_ai: ^0.4.3
flutter_markdown: ^0.7.2
flutter_gemini: ^2.0.4
font_awesome_flutter: ^10.7.0
syncfusion_flutter_charts: ^26.1.38
flutter_arc_text: ^0.6.0
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^4.0.0
flutter:
uses-material-design: true
assets:
- assets/images/
在 Android Studio 中出现此错误:
Launching lib\\main.dart on sdk gphone16k x86 64 in debug mode...
Running Gradle task 'assembleDebug'...
../../../../AppData/Local/Pub/Cache/hosted/pub.dev/syncfusion_flutter_charts-26.2.8/lib/src/charts/common/core_tooltip.dart:168:22: Error: The method 'markNeedsBuild' isn't defined for the class 'RenderConstrainedLayoutBuilder\<Constraints, RenderObject\>'.
- 'RenderConstrainedLayoutBuilder' is from 'package:flutter/src/widgets/layout_builder.dart' ('/C:/src/flutter/packages/flutter/lib/src/widgets/layout_builder.dart').
- 'Constraints' is from 'package:flutter/src/rendering/object.dart' ('/C:/src/flutter/packages/flutter/lib/src/rendering/object.dart').
- 'RenderObject' is from 'package:flutter/src/rendering/object.dart' ('/C:/src/flutter/packages/flutter/lib/src/rendering/object.dart').
Try correcting the name to the name of an existing method, or defining a method named 'markNeedsBuild'.
renderObject.markNeedsBuild();
^^^^^^^^^^^^^^
../../../../AppData/Local/Pub/Cache/hosted/pub.dev/syncfusion_flutter_charts-26.2.8/lib/src/charts/common/core_legend.dart:452:22: Error: The method 'markNeedsBuild' isn't defined for the class 'RenderConstrainedLayoutBuilder\<Constraints, RenderObject\>'.
- 'RenderConstrainedLayoutBuilder' is from 'package:flutter/src/widgets/layout_builder.dart' ('/C:/src/flutter/packages/flutter/lib/src/widgets/layout_builder.dart').
- 'Constraints' is from 'package:flutter/src/rendering/object.dart' ('/C:/src/flutter/packages/flutter/lib/src/rendering/object.dart').
- 'RenderObject' is from 'package:flutter/src/rendering/object.dart' ('/C:/src/flutter/packages/flutter/lib/src/rendering/object.dart').
Try correcting the name to the name of an existing method, or defining a method named 'markNeedsBuild'.
renderObject.markNeedsBuild();
^^^^^^^^^^^^^^
../../../../AppData/Local/Pub/Cache/hosted/pub.dev/syncfusion_flutter_charts-26.2.8/lib/src/charts/common/element_widget.dart:117:5: Error: The method 'markNeedsBuild' isn't defined for the class 'RenderChartElementLayoutBuilder\<T, D\>'.
- 'RenderChartElementLayoutBuilder' is from 'package:syncfusion_flutter_charts/src/charts/common/element_widget.dart' ('../../../../AppData/Local/Pub/Cache/hosted/pub.dev/syncfusion_flutter_charts-26.2.8/lib/src/charts/common/element_widget.dart').
Try correcting the name to the name of an existing method, or defining a method named 'markNeedsBuild'.
markNeedsBuild();
^^^^^^^^^^^^^^
../../../../AppData/Local/Pub/Cache/hosted/pub.dev/syncfusion_flutter_charts-26.2.8/lib/src/charts/base.dart:3317:7: Error: The method 'markNeedsBuild' isn't defined for the class 'RenderLoadingIndicator'.
- 'RenderLoadingIndicator' is from 'package:syncfusion_flutter_charts/src/charts/base.dart' ('../../../../AppData/Local/Pub/Cache/hosted/pub.dev/syncfusion_flutter_charts-26.2.8/lib/src/charts/base.dart').
Try correcting the name to the name of an existing method, or defining a method named 'markNeedsBuild'.
markNeedsBuild();
^^^^^^^^^^^^^^
../../../../AppData/Local/Pub/Cache/hosted/pub.dev/syncfusion_flutter_charts-26.2.8/lib/src/charts/cartesian_chart.dart:1367:22: Error: The method 'markNeedsBuild' isn't defined for the class 'RenderConstrainedLayoutBuilder\<Constraints, RenderObject\>'.
- 'RenderConstrainedLayoutBuilder' is from 'package:flutter/src/widgets/layout_builder.dart' ('/C:/src/flutter/packages/flutter/lib/src/widgets/layout_builder.dart').
- 'Constraints' is from 'package:flutter/src/rendering/object.dart' ('/C:/src/flutter/packages/flutter/lib/src/rendering/object.dart').
- 'RenderObject' is from 'package:flutter/src/rendering/object.dart' ('/C:/src/flutter/packages/flutter/lib/src/rendering/object.dart').
Try correcting the name to the name of an existing method, or defining a method named 'markNeedsBuild'.
renderObject.markNeedsBuild();
^^^^^^^^^^^^^^
Target kernel_snapshot_program failed: Exception
FAILURE: Build failed with an exception.
感谢任何形式的帮助。 预先感谢。