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

[Bug]: package_info_plus fails PackageInfo.fromPlatform() under test #1309

Closed
7 tasks done
WorikQCI opened this issue Oct 31, 2022 · 5 comments
Closed
7 tasks done

[Bug]: package_info_plus fails PackageInfo.fromPlatform() under test #1309

WorikQCI opened this issue Oct 31, 2022 · 5 comments
Labels
bug Something isn't working invalid Bad description, irrelevant information, not related to the plugin, etc. triage

Comments

@WorikQCI
Copy link

Platform

MacOS 12.6

Plugin

package_info_plus

Version

3.0.1

Flutter SDK

3.3.6 Flutter version. From flutter --version

Steps to reproduce

Make a test:

import 'package:flutter/widgets.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:package_info_plus/package_info_plus.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();

  test("GeneralAppInformationController", () async {
    PackageInfo packageInfo = await PackageInfo.fromPlatform();
    print(packageInfo.appName);
  });
}

Fails at platform_chanel.dart: 294
throw MissingPluginException("No implementation found for method getAll on channel dev.fluttercommunity.plus/package_info");

This code works fine when run inside an App.

Code Sample

Repeating myself, no harm


import 'package:flutter/widgets.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:package_info_plus/package_info_plus.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  test("GeneralAppInformationController", () async {
    PackageInfo packageInfo = await PackageInfo.fromPlatform();
    print(packageInfo.appName);
  });
}


### Logs

```shell
% flutter test --verbose test/other_tests/package_info_plus_bug_test.dart
[  +54 ms] executing: sysctl hw.optional.arm64
[  +15 ms] Exit code 0 from: sysctl hw.optional.arm64
[        ] hw.optional.arm64: 1
[   +7 ms] executing: [/Users/user/Documents/Flutter/flutter/] git -c log.showSignature=false log -n 1 --pretty=format:%H
[  +31 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H
[        ] 6928314d505d2bb4777be05e45d7808a5aa91d2a
[        ] executing: [/Users/user/Documents/Flutter/flutter/] git tag --points-at 6928314d505d2bb4777be05e45d7808a5aa91d2a
[ +142 ms] Exit code 0 from: git tag --points-at 6928314d505d2bb4777be05e45d7808a5aa91d2a
[   +2 ms] 3.3.6
[  +37 ms] executing: [/Users/user/Documents/Flutter/flutter/] git rev-parse --abbrev-ref --symbolic @{upstream}
[  +21 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{upstream}
[        ] origin/stable
[        ] executing: [/Users/user/Documents/Flutter/flutter/] git ls-remote --get-url origin
[  +18 ms] Exit code 0 from: git ls-remote --get-url origin
[        ] https://github.com/flutter/flutter.git
[  +66 ms] Unable to locate an Android SDK.
[   +2 ms] executing: [/Users/user/Documents/Flutter/flutter/] git rev-parse --abbrev-ref HEAD
[  +22 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[        ] stable
[   +9 ms] executing: sw_vers -productName
[  +19 ms] Exit code 0 from: sw_vers -productName
[        ] macOS
[        ] executing: sw_vers -productVersion
[  +26 ms] Exit code 0 from: sw_vers -productVersion
[        ] 12.6
[        ] executing: sw_vers -buildVersion
[  +20 ms] Exit code 0 from: sw_vers -buildVersion
[        ] 21G115
[        ] executing: uname -m
[  +12 ms] Exit code 0 from: uname -m
[   +1 ms] arm64
[  +38 ms] Found 1 files which will be executed as Widget Tests.
[   +5 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[   +1 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[  +25 ms] Artifact Instance of 'MaterialFonts' is not required, skipping update.
[        ] Artifact Instance of 'GradleWrapper' is not required, skipping update.
[        ] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[        ] Artifact Instance of 'FlutterSdk' is not required, skipping update.
[        ] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FontSubsetArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'PubDependencies' is not required, skipping update.
[  +33 ms] Skipping pub get: version match.
[  +32 ms] Found plugin device_info_plus at
/Users/user/Documents/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/device_info_plus-8.0.0/
[  +31 ms] Found plugin package_info_plus at
/Users/user/Documents/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/package_info_plus-3.0.1/
[   +6 ms] Found plugin path_provider_linux at
/Users/user/Documents/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-2.1.7/
[   +2 ms] Found plugin path_provider_windows at
/Users/user/Documents/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-2.1.3/
[  +10 ms] Found plugin shared_preferences at
/Users/user/Documents/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences-2.0.15/
[   +1 ms] Found plugin shared_preferences_android at
/Users/user/Documents/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_android-2.0.14/
[   +1 ms] Found plugin shared_preferences_ios at
/Users/user/Documents/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_ios-2.1.1/
[   +2 ms] Found plugin shared_preferences_linux at
/Users/user/Documents/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_linux-2.1.1/
[   +1 ms] Found plugin shared_preferences_macos at
/Users/user/Documents/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_macos-2.0.4/
[   +1 ms] Found plugin shared_preferences_web at
/Users/user/Documents/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_web-2.0.4/
[        ] Found plugin shared_preferences_windows at
/Users/user/Documents/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_windows-2.1.1/
[  +57 ms] Found plugin device_info_plus at
/Users/user/Documents/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/device_info_plus-8.0.0/
[   +8 ms] Found plugin package_info_plus at
/Users/user/Documents/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/package_info_plus-3.0.1/
[   +1 ms] Found plugin path_provider_linux at
/Users/user/Documents/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-2.1.7/
[   +3 ms] Found plugin path_provider_windows at
/Users/user/Documents/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-2.1.3/
[   +2 ms] Found plugin shared_preferences at
/Users/user/Documents/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences-2.0.15/
[        ] Found plugin shared_preferences_android at
/Users/user/Documents/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_android-2.0.14/
[        ] Found plugin shared_preferences_ios at
/Users/user/Documents/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_ios-2.1.1/
[        ] Found plugin shared_preferences_linux at
/Users/user/Documents/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_linux-2.1.1/
[        ] Found plugin shared_preferences_macos at
/Users/user/Documents/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_macos-2.0.4/
[        ] Found plugin shared_preferences_web at
/Users/user/Documents/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_web-2.0.4/
[        ] Found plugin shared_preferences_windows at
/Users/user/Documents/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_windows-2.1.1/
[  +32 ms] Found plugin device_info_plus at
/Users/user/Documents/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/device_info_plus-8.0.0/
[   +8 ms] Found plugin package_info_plus at
/Users/user/Documents/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/package_info_plus-3.0.1/
[        ] Found plugin path_provider_linux at
/Users/user/Documents/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-2.1.7/
[        ] Found plugin path_provider_windows at
/Users/user/Documents/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-2.1.3/
[   +1 ms] Found plugin shared_preferences at
/Users/user/Documents/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences-2.0.15/
[        ] Found plugin shared_preferences_android at
/Users/user/Documents/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_android-2.0.14/
[   +1 ms] Found plugin shared_preferences_ios at
/Users/user/Documents/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_ios-2.1.1/
[   +2 ms] Found plugin shared_preferences_linux at
/Users/user/Documents/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_linux-2.1.1/
[        ] Found plugin shared_preferences_macos at
/Users/user/Documents/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_macos-2.0.4/
[   +1 ms] Found plugin shared_preferences_web at
/Users/user/Documents/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_web-2.0.4/
[        ] Found plugin shared_preferences_windows at
/Users/user/Documents/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_windows-2.1.1/
[  +40 ms] Generating
/Users/user/Documents/QCIViews/fludder/flutter_views/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.
java
[  +23 ms] executing: sysctl hw.optional.arm64
[  +11 ms] Exit code 0 from: sysctl hw.optional.arm64
[        ] hw.optional.arm64: 1
[        ] executing: /usr/bin/arch -arm64e xcrun xcodebuild -version
[ +256 ms] Exit code 0 from: /usr/bin/arch -arm64e xcrun xcodebuild -version
[        ] Xcode 13.4
           Build version 13F17a
[ +144 ms] running test package with arguments: [-r, compact, --timeout, 30s, --concurrency=8, --chain-stack-traces, --,
/Users/user/Documents/QCIViews/fludder/flutter_views/test/other_tests/package_info_plus_bug_test.dart]
00:00 +0: ... /Users/user/Documents/QCIViews/fludder/flutter_views/test/other_tests/package_info_plus_bug_test.dart        [ +105 ms] test 0: starting test
/Users/user/Documents/QCIViews/fludder/flutter_views/test/other_tests/package_info_plus_bug_test.dart
[   +6 ms] Stopping scan for flutter_test_config.dart; found project root at
/Users/user/Documents/QCIViews/fludder/flutter_views
[   +2 ms] Compiler will use the following file as its incremental dill file:
/var/folders/zt/mdgvl_4d3kv9mk1_h65_kvxm0000gp/T/flutter_tools.ig5vu7/flutter_test_compiler.Yrnfjx/output.dill
[        ] Listening to compiler controller...
[   +4 ms] Compiling
file:///var/folders/zt/mdgvl_4d3kv9mk1_h65_kvxm0000gp/T/flutter_tools.ig5vu7/flutter_test_listener.g3sVKP/listener.dart
[  +14 ms] Found plugin device_info_plus at
/Users/user/Documents/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/device_info_plus-8.0.0/
[   +7 ms] Found plugin package_info_plus at
/Users/user/Documents/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/package_info_plus-3.0.1/
[   +3 ms] Found plugin path_provider_linux at
/Users/user/Documents/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-2.1.7/
[        ] Found plugin path_provider_windows at
/Users/user/Documents/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-2.1.3/
[   +2 ms] Found plugin shared_preferences at
/Users/user/Documents/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences-2.0.15/
[        ] Found plugin shared_preferences_android at
/Users/user/Documents/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_android-2.0.14/
[        ] Found plugin shared_preferences_ios at
/Users/user/Documents/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_ios-2.1.1/
[        ] Found plugin shared_preferences_linux at
/Users/user/Documents/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_linux-2.1.1/
[        ] Found plugin shared_preferences_macos at
/Users/user/Documents/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_macos-2.0.4/
[        ] Found plugin shared_preferences_web at
/Users/user/Documents/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_web-2.0.4/
[        ] Found plugin shared_preferences_windows at
/Users/user/Documents/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_windows-2.1.1/
[  +20 ms] /Users/user/Documents/Flutter/flutter/bin/cache/dart-sdk/bin/dart --disable-dart-dev
/Users/user/Documents/Flutter/flutter/bin/cache/dart-sdk/bin/snapshots/frontend_server.dart.snapshot --sdk-root
/Users/user/Documents/Flutter/flutter/bin/cache/artifacts/engine/common/flutter_patched_sdk/ --incremental
--no-print-incremental-dependencies --target=flutter --debugger-module-names --experimental-emit-debug-metadata
-DFLUTTER_WEB_AUTO_DETECT=true --output-dill
/var/folders/zt/mdgvl_4d3kv9mk1_h65_kvxm0000gp/T/flutter_tools.ig5vu7/flutter_test_compiler.Yrnfjx/output.dill --packages
/Users/user/Documents/QCIViews/fludder/flutter_views/.dart_tool/package_config.json -Ddart.vm.profile=false
-Ddart.vm.product=false --enable-asserts --track-widget-creation --initialize-from-dill
/Users/user/Documents/QCIViews/fludder/flutter_views/build/test_cache/build/c075001b96339384a97db4862b8ab8db.cache.dill.trac
k.dill --source /Users/user/Documents/QCIViews/fludder/flutter_views/.dart_tool/flutter_build/dart_plugin_registrant.dart
--source package:flutter/src/dart_plugin_registrant.dart
-Dflutter.dart_plugin_registrant=file:///Users/user/Documents/QCIViews/fludder/flutter_views/.dart_tool/flutter_build/dart_p
lugin_registrant.dart --verbosity=error
[  +35 ms] <- compile
file:///var/folders/zt/mdgvl_4d3kv9mk1_h65_kvxm0000gp/T/flutter_tools.ig5vu7/flutter_test_listener.g3sVKP/listener.dart
00:01 +0: ... /Users/user/Documents/QCIViews/fludder/flutter_views/test/other_tests/package_info_plus_bug_test.dart        [+1197 ms] <- accept
[        ] <- reset
[        ] Compiling
file:///var/folders/zt/mdgvl_4d3kv9mk1_h65_kvxm0000gp/T/flutter_tools.ig5vu7/flutter_test_listener.g3sVKP/listener.dart took
1284ms
[        ] test 0: starting test device
[   +6 ms] test 0: awaiting connection to test device
[        ] test 0: Observatory uri is not available
[   +7 ms] test 0: test harness socket server is running at port:49973
[  +10 ms] executing: sysctl hw.optional.arm64
[   +9 ms] Exit code 0 from: sysctl hw.optional.arm64
[        ] hw.optional.arm64: 1
[   +1 ms] Using this directory for fonts configuration:
/var/folders/zt/mdgvl_4d3kv9mk1_h65_kvxm0000gp/T/flutter_tools.ig5vu7/flutter_test_fonts.vxyYbk
[        ] test 0: Starting flutter_tester process with command=[/usr/bin/arch, -x86_64,
/Users/user/Documents/Flutter/flutter/bin/cache/artifacts/engine/darwin-x64/flutter_tester, --disable-observatory,
--enable-checked-mode, --verify-entry-points, --enable-software-rendering, --skia-deterministic-rendering,
--enable-dart-profiling, --non-interactive, --use-test-fonts, --disable-asset-fonts,
--packages=/Users/user/Documents/QCIViews/fludder/flutter_views/.dart_tool/package_config.json,
--flutter-assets-dir=/Users/user/Documents/QCIViews/fludder/flutter_views/build/unit_test_assets,
/var/folders/zt/mdgvl_4d3kv9mk1_h65_kvxm0000gp/T/flutter_tools.ig5vu7/flutter_test_listener.g3sVKP/listener.dart.dill],
environment={FLUTTER_TEST: true, FONTCONFIG_FILE:
/var/folders/zt/mdgvl_4d3kv9mk1_h65_kvxm0000gp/T/flutter_tools.ig5vu7/flutter_test_fonts.vxyYbk/fonts.conf, SERVER_PORT:
49973, APP_NAME: flutter_views, UNIT_TEST_ASSETS:
/Users/user/Documents/QCIViews/fludder/flutter_views/build/unit_test_assets}
[   +7 ms] test 0: Started flutter_tester process at pid 6135
00:02 +0: ... /Users/user/Documents/QCIViews/fludder/flutter_views/test/other_tests/package_info_plus_bug_test.dart        [ +834 ms] test 0: connected to test device, now awaiting test result
[        ] test 0: Waiting for test harness or tests to finish
00:02 +0 -1: GeneralAppInformationController [E]                                                                           
  MissingPluginException(No implementation found for method getAll on channel dev.fluttercommunity.plus/package_info)
  package:flutter/src/services/platform_channel.dart 294:7  MethodChannel._invokeMethod
  

To run this test again: /Users/user/Documents/Flutter/flutter/bin/cache/dart-sdk/bin/dart test /Users/user/Documents/QCIViews/fludder/flutter_views/test/other_tests/package_info_plus_bug_test.dart -p vm --plain-name 'GeneralAppInformationController'
[ +472 ms] test 0: Test harness is no longer needed by test process
[        ] test 0: finished
[        ] test 0: cleaning up...
[        ] test 0: ensuring test device is terminated.
[        ] test 0: Terminating flutter_tester process
[        ] test 0: Shutting down test harness socket server
[        ] test 0: Test process is no longer needed by test harness
[  +15 ms] test 0: flutter_tester process at pid 6135 exited with code=-9
[        ] test 0: deleting temporary directory
[   +1 ms] test 0: finished
00:02 +0 -1: Some tests failed.                                                                                            
[   +3 ms] Deleting /var/folders/zt/mdgvl_4d3kv9mk1_h65_kvxm0000gp/T/flutter_tools.ig5vu7/flutter_test_compiler.Yrnfjx...
[   +1 ms] killing pid 6124
[  +17 ms] Deleting /var/folders/zt/mdgvl_4d3kv9mk1_h65_kvxm0000gp/T/flutter_tools.ig5vu7/flutter_test_fonts.vxyYbk...
[   +1 ms] test package returned with exit code 1
[   +4 ms] "flutter test" took 3,586ms.
[   +2 ms] 
           #0      throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
           #1      TestCommand.runCommand (package:flutter_tools/src/commands/test.dart:467:7)
           <asynchronous suspension>
           #2      FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1209:27)
           <asynchronous suspension>
           #3      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
           <asynchronous suspension>
           #4      CommandRunner.runCommand (package:args/command_runner.dart:209:13)
           <asynchronous suspension>
           #5      FlutterCommandRunner.runCommand.<anonymous closure>
           (package:flutter_tools/src/runner/flutter_command_runner.dart:281:9)
           <asynchronous suspension>
           #6      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
           <asynchronous suspension>
           #7      FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:229:5)
           <asynchronous suspension>
           #8      run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:62:9)
           <asynchronous suspension>
           #9      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
           <asynchronous suspension>
           #10     main (package:flutter_tools/executable.dart:91:3)
           <asynchronous suspension>
           
           
[   +3 ms] Running shutdown hooks
[        ] Shutdown hooks complete
[        ] exiting with code 1

Flutter Doctor

% flutter doctor -v
[✓] Flutter (Channel stable, 3.3.6, on macOS 12.6 21G115 darwin-arm, locale en-AU)
    • Flutter version 3.3.6 on channel stable at /Users/user/Documents/Flutter/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 6928314d50 (5 days ago), 2022-10-25 16:34:41 -0400
    • Engine revision 3ad69d7be3
    • Dart version 2.18.2
    • DevTools version 2.15.0

[✗] Android toolchain - develop for Android devices
    ✗ Unable to locate Android SDK.
      Install Android Studio from: https://developer.android.com/studio/index.html
      On first launch it will assist you in installing the Android SDK components.
      (or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).
      If the Android SDK has been installed to a custom location, please use
      `flutter config --android-sdk` to update to that location.


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

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

[!] Android Studio (not installed)
    • Android Studio not found; download from https://developer.android.com/studio/index.html
      (or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).

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

[✓] Connected device (2 available)
    • macOS (desktop) • macos  • darwin-arm64   • macOS 12.6 21G115 darwin-arm
    • Chrome (web)    • chrome • web-javascript • Google Chrome 106.0.5249.119

[✓] HTTP Host Availability
    • All required HTTP hosts are available

! Doctor found issues in 2 categories.

Checklist before submitting a bug

  • I Google'd a solution and I couldn't find it
  • I searched on StackOverflow for a solution and I couldn't find it
  • I read the README.md file of the plugin
  • I'm using the latest version of the plugin
  • All dependencies are up to date with flutter pub upgrade
  • I did a flutter clean
  • I tried running the example project
@WorikQCI WorikQCI added bug Something isn't working triage labels Oct 31, 2022
@WorikQCI
Copy link
Author

This is similar to #1270

But I am not using Linux and it is only when running as a test.

@miquelbeltran
Copy link
Member

Because thats not how you write an integration test. Take a look at the included integrated tests in the repo.

@miquelbeltran miquelbeltran added the invalid Bad description, irrelevant information, not related to the plugin, etc. label Oct 31, 2022
@miquelbeltran miquelbeltran closed this as not planned Won't fix, can't repro, duplicate, stale Oct 31, 2022
@WorikQCI
Copy link
Author

WorikQCI commented Nov 1, 2022

If you mean this example I am not finding it much help.

That code tests package_info_plus in very general terms.

I want to test it in my specific case.

Starting from the example supplied I cannot get the most basic services of my code (specifically using the HTTPS client) to work.

I am unsure if you can help. This is a problem with the flutter test system that as far as I can tell is mostly undocumented. Each piece has a documentation page, but the way it is tied together is not covered by the official documentation.

OT but the Dart test framework has better documentation, most of it applies, but not all of it. The intersection of Flutter and Dart test frameworks is not covered.

Sigh. This package is going to work. Just not in my tests.

@WorikQCI
Copy link
Author

WorikQCI commented Nov 1, 2022

If you mean this example I am not finding it much help.

That code tests package_info_plus in very general terms.

I want to test it in my specific case.

Starting from the example supplied I cannot get the most #basic services of my code (specifically using the HTTPS client) to work.

I am unsure if you can help. This is a problem with the flutter test system that as far as I can tell is mostly undocumented. Each piece has a documentation page, but the way it is tied together is not covered by the official documentation.

OT but the Dart test framework has better documentation, most of it applies, but not all of it. The intersection of Flutter and Dart test frameworks is not covered.

Sigh. This package is going to work. Just not in my tests.

@miquelbeltran
Copy link
Member

That's a unit test. And you are calling to platform channel through a unit test. That's not how Flutter works.

Instead, you have to implement an integration test: https://github.com/fluttercommunity/plus_plugins/blob/main/packages/package_info_plus/package_info_plus/example/integration_test/package_info_plus_test.dart

Anyway, I am not sure why you are calling these methods inside a test. Either you should mock them or you should write integration tests instead.

Also, don't open a bug ticket for something that should have been a StackOverflow question.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working invalid Bad description, irrelevant information, not related to the plugin, etc. triage
Projects
None yet
Development

No branches or pull requests

2 participants