Skip to content

Running bin/tasks/module_test.dart locally #137950

@dcharkes

Description

@dcharkes

I am trying to figure out what the requirements are to get bin/tasks/module_test.dart running locally.

Flutter doctor is happy, but the test is failing.

cc @reidbaker Am I holding this test wrong?

$ cd /Users/dacoharkes/flt/engine/flutter/dev/devicelab && dart bin/test_runner.dart test -t module_test

[...]

[2023-11-06 18:02:14.948225] [STDOUT] stderr: * What went wrong:
[2023-11-06 18:02:14.948232] [STDOUT] stderr: Execution failed for task ':app:processDebugMainManifest'.
[2023-11-06 18:02:14.948240] [STDOUT] stderr: > Unable to make field private final java.lang.String java.io.File.path accessible: module java.base does not "opens java.io" to unnamed module @3c6376ff
[2023-11-06 18:02:14.948248] [STDOUT] stderr: 
[2023-11-06 18:02:14.948255] [STDOUT] stderr: * Try:
[2023-11-06 18:02:14.948261] [STDOUT] stderr: > Run with --stacktrace option to get the stack trace.
[2023-11-06 18:02:14.948287] [STDOUT] stderr: > Run with --info or --debug option to get more log output.
[2023-11-06 18:02:14.948296] [STDOUT] stderr: > Run with --scan to get full insights.
[2023-11-06 18:02:14.948302] [STDOUT] stderr: 
[2023-11-06 18:02:14.948309] [STDOUT] stderr: * Get more help at https://help.gradle.org
[2023-11-06 18:02:14.948316] [STDOUT] stdout: 
[2023-11-06 18:02:14.948322] [STDOUT] stdout: Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
[2023-11-06 18:02:14.948329] [STDOUT] stdout: 
[2023-11-06 18:02:14.948336] [STDOUT] stdout: You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
[2023-11-06 18:02:14.948343] [STDOUT] stdout: 
[2023-11-06 18:02:14.948352] [STDOUT] stdout: See https://docs.gradle.org/7.6.1/userguide/command_line_interface.html#sec:command_line_warnings
[2023-11-06 18:02:14.948369] [STDOUT] stderr: 
[2023-11-06 18:02:14.948376] [STDOUT] stderr: BUILD FAILED in 5s
[2023-11-06 18:02:14.948393] [STDOUT] stdout: 27 actionable tasks: 27 executed
[2023-11-06 18:02:15.742930] [STDOUT] Checking for reboot
[module_test] Process terminated with exit code 0.
Task result:
{
  "success": false,
  "reason": "Executable \"./gradlew\" failed with exit code 1."
}


════════════════════╡ ••• Finished task "module_test" ••• ╞═════════════════════



═══════════════════╡ ••• Flaky status for "module_test" ••• ╞═══════════════════

Consistently failed across all 3 executions.
flaky: false

full log in gist

I updated my Android Studio and the Android SDK today to be able to test properly with Android SDK 34.

$ flutter doctor -v
[!] Flutter (Channel [user-branch], 3.17.0-1.0.pre.66, on macOS 14.1 23B74 darwin-arm64, locale en)
    ! Flutter version 3.17.0-1.0.pre.66 on channel [user-branch] at /Users/dacoharkes/flt/engine/flutter
      Currently on an unknown channel. Run `flutter channel` to switch to an official channel.
      If that doesn't fix the issue, reinstall Flutter by following instructions at
      https://flutter.dev/docs/get-started/install.
    • Upstream repository [email protected]:flutter/flutter
    • Framework revision b66f533fae (6 hours ago), 2023-11-06 12:40:35 +0100
    • Engine revision 555ffa17b5
    • Dart version 3.3.0 (build 3.3.0-97.0.dev)
    • DevTools version 2.29.0
    • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly
      to perform update checks and upgrades.

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/dacoharkes/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • ANDROID_HOME = /Users/dacoharkes/Library/Android/sdk
    • ANDROID_SDK_ROOT = /Users/dacoharkes/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.0.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15A507
    • CocoaPods version 1.11.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)

[✓] VS Code (version 1.84.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.76.0

[✓] Connected device (4 available)
    • sdk gphone64 arm64 (mobile) • emulator-5554             • android-arm64  • Android 14 (API 34) (emulator)
    • Daco’s iPhone (mobile)      • 00008110-001410883A78401E • ios            • iOS 17.1 21B74
    • macOS (desktop)             • macos                     • darwin-arm64   • macOS 14.1 23B74 darwin-arm64
    • Chrome (web)                • chrome                    • web-javascript • Google Chrome 119.0.6045.105

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 1 category.

Not sure if this is relevant, but I had to update Android Studio to get a newer JDK. The new Android studio has OpenJDK 17 instead of 11.

$ /Applications/Android\ Studio.app/Contents/jbr/Contents/Home/bin/java --version
openjdk 17.0.6 2023-01-17
OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
OpenJDK 64-Bit Server VM (build 17.0.6+0-17.0.6b829.9-10027231, mixed mode)

The old Android studio JDK 11 had issues running the newest command-line tools:

$ flutter doctor --android-licenses
Error: LinkageError occurred while loading main class com.android.sdklib.tool.sdkmanager.SdkManagerCli
	java.lang.UnsupportedClassVersionError: com/android/sdklib/tool/sdkmanager/SdkManagerCli has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 55.0
Android sdkmanager tool was found, but failed to run
(/Users/dacoharkes/Library/Android/sdk/cmdline-tools/latest/bin/sdkmanager): "exited code 1".
Try re-installing or updating your Android SDK,
visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions.

The OpenJDK 11 can only run command-line tools 10, not 11.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions