Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build issue #17

Open
gongzelong0718 opened this issue Aug 18, 2024 · 3 comments
Open

Build issue #17

gongzelong0718 opened this issue Aug 18, 2024 · 3 comments

Comments

@gongzelong0718
Copy link

今天试了一下无法编译运行了。
gradle: 6.1.1
java: 1.8.0_172

详情请看下面的日志:

➜  WanAndroid-Flutter git:(master) ✗ /Users/gongzelong/Documents/DevelopmentTool/flutter/3.7.9/bin/flutter pub get
Running "flutter pub get" in WanAndroid-Flutter...
Resolving dependencies... (1.0s)
  async 2.10.0 (2.11.0 available)
  characters 1.2.1 (1.3.0 available)
  collection 1.17.0 (1.19.0 available)
  cookie_jar 1.0.1 (4.0.8 available)
  cupertino_icons 0.1.3 (1.0.8 available)
  dio 3.0.10 (5.6.0 available)
  dio_cookie_manager 1.0.0 (3.1.1 available)
  event_bus 1.1.1 (2.0.0 available)
  ffi 1.2.1 (2.1.3 available)
  file 6.1.4 (7.0.0 available)
  flutter_spinkit 4.1.2+1 (5.2.1 available)
  flutter_webview_plugin 0.3.11 (0.4.0 available)
  fluttertoast 4.0.1 (8.2.8 available)
  http_parser 3.1.4 (4.1.0 available)
  js 0.6.5 (0.7.1 available)
  matcher 0.12.13 (0.12.16+1 available)
  material_color_utilities 0.2.0 (0.12.0 available)
  meta 1.8.0 (1.15.0 available)
  path 1.8.2 (1.9.0 available)
  path_provider 1.6.28 (2.1.4 available)
  path_provider_linux 0.0.1+2 (2.2.1 available)
  path_provider_macos 0.0.4+8 (2.0.7 available)
  path_provider_platform_interface 1.0.4 (2.1.2 available)
  path_provider_windows 0.0.5 (2.3.0 available)
  platform 3.1.3 (3.1.5 available)
  plugin_platform_interface 1.0.3 (2.1.8 available)
  process 4.2.4 (5.0.2 available)
  shared_preferences 0.5.12+4 (2.3.2 available)
  shared_preferences_linux 0.0.2+4 (2.4.1 available)
  shared_preferences_macos 0.0.1+11 (2.0.5 available)
  shared_preferences_platform_interface 1.0.4 (2.4.1 available)
  shared_preferences_web 0.1.2+7 (2.4.2 available)
  shared_preferences_windows 0.0.2+3 (2.4.1 available)
  source_span 1.9.1 (1.10.0 available)
  sprintf 4.1.0 (7.0.0 available)
  stack_trace 1.11.0 (1.11.1 available)
  stream_channel 2.1.1 (2.1.2 available)
  string_scanner 1.2.0 (1.3.0 available)
  test_api 0.4.16 (0.7.3 available)
  url_launcher 5.7.10 (6.3.0 available)
  url_launcher_linux 0.0.1+4 (3.2.0 available)
  url_launcher_macos 0.0.1+9 (3.2.0 available)
  url_launcher_platform_interface 1.0.9 (2.3.2 available)
  url_launcher_web 0.1.5+3 (2.3.3 available)
  url_launcher_windows 0.0.1+3 (3.1.2 available)
  win32 2.6.1 (5.5.4 available)
  xdg_directories 0.1.2 (1.0.4 available)
Got dependencies!
The plugins `flutter_webview_plugin, fluttertoast` use a deprecated version of the Android embedding.
To avoid unexpected runtime failures, or future build failures, try to see if these plugins support the Android V2 embedding. Otherwise, consider removing them since a future release of Flutter will remove these deprecated APIs.
If you are plugin author, take a look at the docs for migrating the plugin to the V2 embedding: https://flutter.dev/go/android-plugin-migration.
➜  WanAndroid-Flutter git:(master) ✗ /Users/gongzelong/Documents/DevelopmentTool/flutter/3.7.9/bin/flutter run
The plugins `flutter_webview_plugin, fluttertoast` use a deprecated version of the Android embedding.
To avoid unexpected runtime failures, or future build failures, try to see if these plugins support the Android V2 embedding. Otherwise, consider removing them since a future release of Flutter will remove these deprecated APIs.
If you are plugin author, take a look at the docs for migrating the plugin to the V2 embedding: https://flutter.dev/go/android-plugin-migration.
Launching lib/main.dart on Pixel 3 in debug mode...
java.lang.NoClassDefFoundError: Could not initialize class org.codehaus.groovy.vmplugin.v7.Java7
    at org.codehaus.groovy.vmplugin.VMPluginFactory.<clinit>(VMPluginFactory.java:43)
    at org.codehaus.groovy.reflection.GroovyClassValueFactory.<clinit>(GroovyClassValueFactory.java:35)
    at org.codehaus.groovy.reflection.ClassInfo.<clinit>(ClassInfo.java:107)
    at org.codehaus.groovy.reflection.ReflectionCache.getCachedClass(ReflectionCache.java:95)
    at org.codehaus.groovy.reflection.ReflectionCache.<clinit>(ReflectionCache.java:39)
    at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.registerMethods(MetaClassRegistryImpl.java:210)
    at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.<init>(MetaClassRegistryImpl.java:108)
    at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.<init>(MetaClassRegistryImpl.java:86)
    at groovy.lang.GroovySystem.<clinit>(GroovySystem.java:36)
    at org.codehaus.groovy.runtime.InvokerHelper.<clinit>(InvokerHelper.java:86)
    at groovy.lang.GroovyObjectSupport.getDefaultMetaClass(GroovyObjectSupport.java:59)
    at groovy.lang.GroovyObjectSupport.<init>(GroovyObjectSupport.java:32)
    at org.gradle.internal.extensibility.DefaultExtraPropertiesExtension.<init>(DefaultExtraPropertiesExtension.java:29)
    at org.gradle.internal.extensibility.DefaultConvention.<init>(DefaultConvention.java:49)
    at org.gradle.internal.extensibility.ExtensibleDynamicObject.<init>(ExtensibleDynamicObject.java:60)
    at org.gradle.internal.instantiation.generator.MixInExtensibleDynamicObject.<init>(MixInExtensibleDynamicObject.java:35)
    at org.gradle.initialization.DefaultSettings_Decorated.getAsDynamicObject(Unknown Source)
    at org.gradle.initialization.SettingsFactory.createSettings(SettingsFactory.java:58)
    at org.gradle.initialization.ScriptEvaluatingSettingsProcessor.process(ScriptEvaluatingSettingsProcessor.java:61)
    at org.gradle.initialization.PropertiesLoadingSettingsProcessor.process(PropertiesLoadingSettingsProcessor.java:38)
    at org.gradle.initialization.SettingsEvaluatedCallbackFiringSettingsProcessor.process(SettingsEvaluatedCallbackFiringSettingsProcessor.java:34)
    at org.gradle.initialization.RootBuildCacheControllerSettingsProcessor.process(RootBuildCacheControllerSettingsProcessor.java:36)
    at org.gradle.initialization.BuildOperationSettingsProcessor$2.call(BuildOperationSettingsProcessor.java:50)
    at org.gradle.initialization.BuildOperationSettingsProcessor$2.call(BuildOperationSettingsProcessor.java:47)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:416)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:406)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:102)
    at org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36)
    at org.gradle.initialization.BuildOperationSettingsProcessor.process(BuildOperationSettingsProcessor.java:47)
    at org.gradle.initialization.DefaultSettingsLoader.findSettingsAndLoadIfAppropriate(DefaultSettingsLoader.java:102)
    at org.gradle.initialization.DefaultSettingsLoader.findAndLoadSettings(DefaultSettingsLoader.java:45)
    at org.gradle.initialization.SettingsAttachingSettingsLoader.findAndLoadSettings(SettingsAttachingSettingsLoader.java:35)
    at org.gradle.internal.composite.CommandLineIncludedBuildSettingsLoader.findAndLoadSettings(CommandLineIncludedBuildSettingsLoader.java:34)
    at org.gradle.internal.composite.ChildBuildRegisteringSettingsLoader.findAndLoadSettings(ChildBuildRegisteringSettingsLoader.java:52)
    at org.gradle.internal.composite.CompositeBuildSettingsLoader.findAndLoadSettings(CompositeBuildSettingsLoader.java:35)
    at org.gradle.initialization.DefaultSettingsPreparer.prepareSettings(DefaultSettingsPreparer.java:36)
    at org.gradle.initialization.BuildOperatingFiringSettingsPreparer$LoadBuild.doLoadBuild(BuildOperatingFiringSettingsPreparer.java:59)
    at org.gradle.initialization.BuildOperatingFiringSettingsPreparer$LoadBuild.run(BuildOperatingFiringSettingsPreparer.java:54)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:402)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:394)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:92)
    at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
    at org.gradle.initialization.BuildOperatingFiringSettingsPreparer.prepareSettings(BuildOperatingFiringSettingsPreparer.java:42)
    at org.gradle.initialization.DefaultGradleLauncher.prepareSettings(DefaultGradleLauncher.java:197)
    at org.gradle.initialization.DefaultGradleLauncher.doClassicBuildStages(DefaultGradleLauncher.java:141)
    at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:130)
    at org.gradle.initialization.DefaultGradleLauncher.executeTasks(DefaultGradleLauncher.java:110)
    at org.gradle.internal.invocation.GradleBuildController$1.execute(GradleBuildController.java:60)
    at org.gradle.internal.invocation.GradleBuildController$1.execute(GradleBuildController.java:57)
    at org.gradle.internal.invocation.GradleBuildController$3.create(GradleBuildController.java:85)
    at org.gradle.internal.invocation.GradleBuildController$3.create(GradleBuildController.java:78)
    at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:189)
    at org.gradle.internal.work.StopShieldingWorkerLeaseService.withLocks(StopShieldingWorkerLeaseService.java:40)
    at org.gradle.internal.invocation.GradleBuildController.doBuild(GradleBuildController.java:78)
    at org.gradle.internal.invocation.GradleBuildController.run(GradleBuildController.java:57)
    at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:31)
    at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
    at org.gradle.launcher.exec.BuildOutcomeReportingBuildActionRunner.run(BuildOutcomeReportingBuildActionRunner.java:63)
    at org.gradle.tooling.internal.provider.ValidatingBuildActionRunner.run(ValidatingBuildActionRunner.java:32)
    at org.gradle.launcher.exec.BuildCompletionNotifyingBuildActionRunner.run(BuildCompletionNotifyingBuildActionRunner.java:39)
    at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$3.call(RunAsBuildOperationBuildActionRunner.java:51)
    at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$3.call(RunAsBuildOperationBuildActionRunner.java:45)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:416)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:406)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:102)
    at org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36)
    at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner.run(RunAsBuildOperationBuildActionRunner.java:45)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter$1.transform(InProcessBuildActionExecuter.java:50)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter$1.transform(InProcessBuildActionExecuter.java:47)
    at org.gradle.composite.internal.DefaultRootBuildState.run(DefaultRootBuildState.java:80)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:47)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:31)
    at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:42)
    at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:28)
    at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:78)
    at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:52)
    at org.gradle.tooling.internal.provider.SubscribableBuildActionExecuter.execute(SubscribableBuildActionExecuter.java:60)
    at org.gradle.tooling.internal.provider.SubscribableBuildActionExecuter.execute(SubscribableBuildActionExecuter.java:38)
    at org.gradle.tooling.internal.provider.SessionScopeBuildActionExecuter.execute(SessionScopeBuildActionExecuter.java:68)
    at org.gradle.tooling.internal.provider.SessionScopeBuildActionExecuter.execute(SessionScopeBuildActionExecuter.java:38)
    at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:37)
    at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:26)
    at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:43)
    at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:29)
    at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:60)
    at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:32)
    at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:55)
    at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:41)
    at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:48)
    at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:32)
    at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:68)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:37)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
    at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:39)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
    at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:27)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
    at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:35)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.create(ForwardClientInput.java:78)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.create(ForwardClientInput.java:75)
    at org.gradle.util.Swapper.swap(Swapper.java:38)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:75)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
    at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:55)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
    at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:63)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:37)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
    at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:82)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:37)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
    at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:52)
    at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:297)
    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
    at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
    at java.base/java.lang.Thread.run(Unknown Source)


FAILURE: Build failed with an exception.


* What went wrong:
Could not initialize class org.codehaus.groovy.reflection.ReflectionCache


* 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 2s
Running Gradle task 'assembleDebug'...                              6.2s
Exception: Gradle task assembleDebug failed with exit code 1
➜  WanAndroid-Flutter git:(master) ✗ java -version
java version "1.8.0_172"
Java(TM) SE Runtime Environment (build 1.8.0_172-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.172-b11, mixed mode)
➜  WanAndroid-Flutter git:(master) ✗ ./android/gradlew --version


------------------------------------------------------------
Gradle 6.1.1
------------------------------------------------------------


Build time:   2020-01-24 22:30:24 UTC
Revision:     a8c3750babb99d1894378073499d6716a1a1fa5d


Kotlin:       1.3.61
Groovy:       2.5.8
Ant:          Apache Ant(TM) version 1.10.7 compiled on September 1 2019
JVM:          1.8.0_172 (Oracle Corporation 25.172-b11)
OS:           Mac OS X 10.16 x86_64

改成gradle 7.2的时候,提示flutter的1151行报错。所以我重装了flutter SDK。
下面是报错信息:
Script '/Users/gongzelong/Documents/DevelopmentTool/flutter/3.7.9/packages/flutter_tools/gradle/flutter.gradle' line: 1151

之后我重装了flutter SDK。把gradle改回了6.1.1

-distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
➜  WanAndroid-Flutter git:(master) ✗ flutter pub get
Resolving dependencies...
The lower bound of "sdk: '>=2.1.0 <3.0.0'" must be 2.12.0'
or higher to enable null safety.

The current Dart SDK (3.3.4) only supports null safety.

For details, see https://dart.dev/null-safety
➜  WanAndroid-Flutter git:(master) ✗ flutter pub get
Building flutter tool...
Running "flutter pub get" in WanAndroid-Flutter...
Resolving dependencies...
  async 2.10.0 (2.11.0 available)
  characters 1.2.1 (1.3.0 available)
  collection 1.17.0 (1.19.0 available)
  cookie_jar 1.0.1 (4.0.8 available)
  cupertino_icons 0.1.3 (1.0.8 available)
  dio 3.0.10 (5.6.0 available)
  dio_cookie_manager 1.0.0 (3.1.1 available)
  event_bus 1.1.1 (2.0.0 available)
  ffi 1.2.1 (2.1.3 available)
  file 6.1.4 (7.0.0 available)
  flutter_spinkit 4.1.2+1 (5.2.1 available)
  flutter_webview_plugin 0.3.11 (0.4.0 available)
  fluttertoast 4.0.1 (8.2.8 available)
  http_parser 3.1.4 (4.1.0 available)
  js 0.6.5 (0.7.1 available)
  matcher 0.12.13 (0.12.16+1 available)
  material_color_utilities 0.2.0 (0.12.0 available)
  meta 1.8.0 (1.15.0 available)
  path 1.8.2 (1.9.0 available)
  path_provider 1.6.28 (2.1.4 available)
  path_provider_linux 0.0.1+2 (2.2.1 available)
  path_provider_macos 0.0.4+8 (2.0.7 available)
  path_provider_platform_interface 1.0.4 (2.1.2 available)
  path_provider_windows 0.0.5 (2.3.0 available)
  platform 3.1.3 (3.1.5 available)
  plugin_platform_interface 1.0.3 (2.1.8 available)
  process 4.2.4 (5.0.2 available)
  shared_preferences 0.5.12+4 (2.3.2 available)
  shared_preferences_linux 0.0.2+4 (2.4.1 available)
  shared_preferences_macos 0.0.1+11 (2.0.5 available)
  shared_preferences_platform_interface 1.0.4 (2.4.1 available)
  shared_preferences_web 0.1.2+7 (2.4.2 available)
  shared_preferences_windows 0.0.2+3 (2.4.1 available)
  source_span 1.9.1 (1.10.0 available)
  sprintf 4.1.0 (7.0.0 available)
  stack_trace 1.11.0 (1.11.1 available)
  stream_channel 2.1.1 (2.1.2 available)
  string_scanner 1.2.0 (1.3.0 available)
  test_api 0.4.16 (0.7.3 available)
  url_launcher 5.7.10 (6.3.0 available)
  url_launcher_linux 0.0.1+4 (3.2.0 available)
  url_launcher_macos 0.0.1+9 (3.2.0 available)
  url_launcher_platform_interface 1.0.9 (2.3.2 available)
  url_launcher_web 0.1.5+3 (2.3.3 available)
  url_launcher_windows 0.0.1+3 (3.1.2 available)
  win32 2.6.1 (5.5.4 available)
  xdg_directories 0.1.2 (1.0.4 available)
Got dependencies!
The plugins `flutter_webview_plugin, fluttertoast` use a deprecated version of the Android embedding.
To avoid unexpected runtime failures, or future build failures, try to see if these plugins support the Android V2 embedding. Otherwise, consider removing them since a future release of Flutter will remove these deprecated APIs.
If you are plugin author, take a look at the docs for migrating the plugin to the V2 embedding: https://flutter.dev/go/android-plugin-migration.
➜  WanAndroid-Flutter git:(master) ✗ flutter run
The plugins `flutter_webview_plugin, fluttertoast` use a deprecated version of the Android embedding.
To avoid unexpected runtime failures, or future build failures, try to see if these plugins support the Android V2 embedding. Otherwise, consider removing them since a future release of Flutter will remove these deprecated APIs.
If you are plugin author, take a look at the docs for migrating the plugin to the V2 embedding: https://flutter.dev/go/android-plugin-migration.
Launching lib/main.dart on Pixel 3 in debug mode...

FAILURE: Build failed with an exception.

* What went wrong:
Could not initialize class org.codehaus.groovy.runtime.InvokerHelper

* 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 539ms
Running Gradle task 'assembleDebug'...                              3.5s
Exception: Gradle task assembleDebug failed with exit code 1

请问知道怎么解决吗?

@gongzelong0718
Copy link
Author

之前根据log提示,
我把

<application
    android:name="io.flutter.app.FlutterApplication"

换成了

<application
    android:name="${applicationName}"

@yechaoa
Copy link
Owner

yechaoa commented Aug 18, 2024

看起来是版本兼容问题。
Flutter:3.7.9
Dart:2.19.6
Gradle:6.1.1
JDK:1.8

@gongzelong0718
Copy link
Author

gongzelong0718 commented Aug 18, 2024

我这边和您一样的版本:

Flutter & Dart

➜  WanAndroid-Flutter git:(build-error) flutter --version
Flutter 3.7.9 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 62bd79521d (1 year, 5 months ago) • 2023-03-30 10:59:36 -0700
Engine • revision ec975089ac
Tools • Dart 2.19.6 • DevTools 2.20.1

Gradle & JDK:

➜  WanAndroid-Flutter git:(build-error) ./android/gradlew --version  

------------------------------------------------------------
Gradle 6.1.1
------------------------------------------------------------

Build time:   2020-01-24 22:30:24 UTC
Revision:     a8c3750babb99d1894378073499d6716a1a1fa5d

Kotlin:       1.3.61
Groovy:       2.5.8
Ant:          Apache Ant(TM) version 1.10.7 compiled on September 1 2019
JVM:          1.8.0_172 (Oracle Corporation 25.172-b11)
OS:           Mac OS X 10.16 x86_64

您那边目前最新的master仍然是可以编译运行的吗?

是执行下面这两个命令吧?
flutter pub get
flutter run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants