screenshots icon indicating copy to clipboard operation
screenshots copied to clipboard

Crash on execute type 'List<dynamic>' is not a subtype of type 'String'

Open obogz opened this issue 4 years ago • 6 comments

Starting flutter daemon... 5.9s Unhandled exception: type 'List' is not a subtype of type 'String' #0 Config._processDevices.. (package:screenshots/src/config.dart:150:54) #1 _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:379:8) #2 Config._processDevices. (package:screenshots/src/config.dart:137:15) #3 _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:379:8) #4 Config._processDevices (package:screenshots/src/config.dart:136:13) #5 Config.devices (package:screenshots/src/config.dart:57:7) #6 Config.androidDevices (package:screenshots/src/config.dart:60:44) #7 isValidConfig (package:screenshots/src/validate.dart:31:46) #8 Screenshots.run (package:screenshots/src/run.dart:109:16) #9 screenshots. (package:screenshots/src/run.dart:48:26) #10 AppContext.run. (package:tool_base/src/base/context.dart:154:29) #11 _rootRun (dart:async/zone.dart:1126:13) #12 _CustomZone.run (dart:async/zone.dart:1023:19) #13 _runZoned (dart:async/zone.dart:1518:10) #14 runZoned (dart:async/zone.dart:1465:12) #15 AppContext.run (package:tool_base/src/base/context.dart:153:18) #16 runInContext (package:screenshots/src/context_runner.dart:16:24) #17 screenshots (package:screenshots/src/run.dart:47:12) #18 main (/.pub-cache/hosted/pub.dartlang.org/screenshots-2.1.1/bin/main.dart:122:25) #19 _startIsolate. (dart:isolate-patch/isolate_patch.dart:305:32) #20 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:174:12)

obogz avatar Mar 05 '20 09:03 obogz

may try this https://github.com/mmcc007/screenshots/issues/176

bsr203 avatar Mar 05 '20 18:03 bsr203

Try running with the -v option and provide config file

mmcc007 avatar Mar 23 '20 06:03 mmcc007

The example throws this for me :( after cloning and installing required things

flutterfromscratch avatar Mar 29 '20 22:03 flutterfromscratch

@flutterfromscratch provide output of

flutter doctor -v
cat screenshots.yaml
screenshots -v

mmcc007 avatar Mar 29 '20 23:03 mmcc007

Same issue for me. Here is the output I get:


[✓] Flutter (Channel stable, v1.12.13+hotfix.9, on Mac OS X 10.15.4 19E287, locale en-US)
    • Flutter version 1.12.13+hotfix.9 at /Users/jpsheehan/Development/flutter
    • Framework revision f139b11009 (3 weeks ago), 2020-03-30 13:57:30 -0700
    • Engine revision af51afceb8
    • Dart version 2.7.2

 
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at /Users/jpsheehan/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-29, build-tools 28.0.3
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.4.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.4.1, Build version 11E503a
    • CocoaPods version 1.9.1

[✓] Android Studio (version 3.6)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 45.1.1
    • Dart plugin version 192.7761
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)

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

[✓] Connected device (1 available)
    • AOSP on IA Emulator • emulator-5554 • android-x86 • Android 9 (API 28) (emulator)

• No issues found!
# A list of screen capture tests
tests:
  # Note: flutter driver expects a pair of files eg, main1.dart and main1_test.dart
  - test_driver/screenshots/screenshots.dart

# Interim location of screenshots from tests
staging: /tmp/screenshots

# A list of locales supported by the app
locales:
  - en-US
  # - de-DE

# A map of devices to emulate
devices:
  ios:
    iPhone XS Max:
    iPhone 11 Pro:
      frame: false # no screen avail so frame must be false
    iPad Pro (12.9-inch) (3rd generation):
      orientation:
        - Portrait # default
        - LandscapeRight
  android:
    Nexus 6P:

# Frame screenshots
frame: true
[ +106 ms] Starting flutter daemon...
[  +14 ms] executing: flutter daemon
[ +988 ms] <== Starting device daemon...
[   +4 ms] <== [{"event":"daemon.connected","params":{"version":"0.5.3","pid":37726}}]
[   +7 ms] ==> [{"method":"device.enable","id":0}]
[   +1 ms] waiting for response: {method: device.enable, id: 0}
[  +58 ms] <== [{"id":0}]
[+5063 ms] executing: [./] sh -c ios-deploy -c || echo "no attached devices"
[ +142 ms] Starting flutter daemon... (completed in 6.2s)
[   +3 ms] ==> [{"method":"device.getDevices","id":1}]
[        ] waiting for response: {method: device.getDevices, id: 1}
[  +68 ms] <== [{"id":1,"result":[{"id":"emulator-5554","name":"AOSP on IA Emulator","platform":"android-arm","emulator":false,"category":"mobile","platformType":"android","ephemeral":true,"emulatorId":null}]}]
[  +20 ms] daemonDevice=id: emulator-5554, name: AOSP on IA Emulator, category: mobile, platformType: android platform: android-arm, emulator: false, ephemeral: true, emulatorId: null, iosModel: null
[   +3 ms] ==> [{"method":"emulator.getEmulators","id":2}]
[   +2 ms] waiting for response: {method: emulator.getEmulators, id: 2}
[ +144 ms] <== [{"id":2,"result":[{"id":"flutter_emulator","name":"flutter emulator","category":"mobile","platformType":"android"},{"id":"apple_ios_simulator","name":"iOS Simulator","category":"mobile","platformType":"ios"}]}]
[   +1 ms] daemonEmulator=id: flutter_emulator, name: flutter emulator, category: mobile, platformType: android
[   +1 ms] daemonEmulator=id: apple_ios_simulator, name: iOS Simulator, category: mobile, platformType: ios
Unhandled exception:
type 'List<dynamic>' is not a subtype of type 'String'
#0      Config._processDevices.<anonymous closure>.<anonymous closure> (package:screenshots/src/config.dart:150:54)
#1      _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:379:8)
#2      Config._processDevices.<anonymous closure> (package:screenshots/src/config.dart:137:15)
#3      _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:379:8)
#4      Config._processDevices (package:screenshots/src/config.dart:136:13)
#5      Config.devices (package:screenshots/src/config.dart:57:7)
#6      Config.androidDevices (package:screenshots/src/config.dart:60:44)
#7      isValidConfig (package:screenshots/src/validate.dart:31:46)
#8      Screenshots.run (package:screenshots/src/run.dart:109:16)
<asynchronous suspension>
#9      screenshots.<anonymous closure> (package:screenshots/src/run.dart:42:26)
#10     AppContext.run.<anonymous closure> (package:tool_base/src/base/context.dart:154:29)
#11     _rootRun (dart:async/zone.dart:1147:13)
#12     _CustomZone.run (dart:async/zone.dart:1040:19)
#13     _runZoned (dart:async/zone.dart:1582:10)
#14     runZoned (dart:async/zone.dart:1502:10)
#15     AppContext.run (package:tool_base/src/base/context.dart:153:18)
#16     runInContext (package:screenshots/src/context_runner.dart:16:24)
#17     screenshots (package:screenshots/src/run.dart:41:12)
#18     main (file:///Users/jpsheehan/.pub-cache/hosted/pub.dartlang.org/screenshots-2.1.1/bin/main.dart:122:25)
<asynchronous suspension>
#19     _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:299:32)
#20     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)

mentoc3000 avatar Apr 17 '20 11:04 mentoc3000

I resolved this by changing the configuration file to the example included in the pubspec page, as suggested in #176.


devices:
  ios:
    iPhone XS Max:
    iPhone 11 Pro:
      frame: false # no screen avail so frame must be false
    iPad Pro (12.9-inch) (3rd generation):
      orientation: Portrait

mentoc3000 avatar Apr 17 '20 11:04 mentoc3000