appium / appium-flutter-driver

Appium Flutter Driver is a test automation tool for Flutter apps on multiple platforms/OSes. Appium Flutter Driver is part of the Appium mobile test automation tool maintained by community
MIT License
455 stars 183 forks source link

"ext.flutter.driver" is not found in "extensionRPCs" #28

Closed hattersharath closed 3 years ago

hattersharath commented 4 years ago
[FlutterDriver] /Users/xxxx/Library/Android/sdk/platform-tools/adb forward tcp:42559 tcp:42559
[FlutterDriver] Attempt #1
[FlutterDriver] Connecting to Dart Observatory: ws://127.0.0.1:42559/TZyCumpgCHs=/ws
[FlutterDriver] Connected to ws://127.0.0.1:42559/TZyCumpgCHs=/ws
[FlutterDriver] "ext.flutter.driver" is not found in "extensionRPCs" ["ext.ui.window.scheduleFrame"]
[FlutterDriver] Cannot get Dart Isolate
[FlutterDriver] Error: "ext.flutter.driver" is not found in "extensionRPCs" ["ext.ui.window.scheduleFrame"]
[FlutterDriver]     at Object.wrappedLogger.errorAndThrow (/usr/local/lib/node_modules/appium-flutter-driver/node_modules/appium-support/lib/logging.js:74:35)
[FlutterDriver]     at Client.onOpenListener (/usr/local/lib/node_modules/appium-flutter-driver/lib/sessions/observatory.ts:91:17)
[FlutterDriver]     at runMicrotasks (<anonymous>)
[FlutterDriver]     at processTicksAndRejections (internal/process/task_queues.js:93:5)
[FlutterDriver] Waiting 300 seconds before trying...
(node:35764) UnhandledPromiseRejectionWarning: Error: "ext.flutter.driver" is not found in "extensionRPCs" ["ext.ui.window.scheduleFrame"]
    at Object.wrappedLogger.errorAndThrow (/usr/local/lib/node_modules/appium-flutter-driver/node_modules/appium-support/lib/logging.js:74:35)
    at Client.onOpenListener (/usr/local/lib/node_modules/appium-flutter-driver/lib/sessions/observatory.ts:91:17)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
(node:35764) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 21)
[FlutterDriver] Attempt #2
[FlutterDriver] Connecting to Dart Observatory: ws://127.0.0.1:42559/TZyCumpgCHs=/ws
[FlutterDriver] Connected to ws://127.0.0.1:42559/TZyCumpgCHs=/ws
[FlutterDriver] "ext.flutter.driver" is not found in "extensionRPCs" ["ext.ui.window.scheduleFrame","ext.flutter.reassemble","ext.flutter.exit","ext.flutter.saveCompilationTrace","ext.flutter.platformOverride","ext.flutter.evict","ext.flutter.timeDilation","ext.flutter.debugPaint","ext.flutter.debugPaintBaselinesEnabled","ext.flutter.repaintRainbow","ext.flutter.debugCheckElevationsEnabled","ext.flutter.debugDumpLayerTree","ext.flutter.debugDumpRenderTree","ext.flutter.debugDumpSemanticsTreeInTraversalOrder","ext.flutter.debugDumpSemanticsTreeInInverseHitTestOrder","ext.flutter.debugDumpApp","ext.flutter.showPerformanceOverlay","ext.flutter.didSendFirstFrameEvent","ext.flutter.didSendFirstFrameRasterizedEvent","ext.flutter.profileWidgetBuilds","ext.flutter.debugAllowBanner","ext.flutter.debugWidgetInspector","ext.flutter.inspector.structuredErrors","ext.flutter.inspector.show","ext.flutter.inspector.trackRebuildDirtyWidgets","ext.flutter.inspector.trackRepaintWidgets","ext.flutter.inspector.disposeAllGroups","ext.flutter.inspector.disposeGroup","ext.flutter.inspector.isWidgetTreeReady","ext.flutter.inspector.disposeId","ext.flutter.inspector.setPubRootDirectories","ext.flutter.inspector.setSelectionById","ext.flutter.inspector.getParentChain","ext.flutter.inspector.getProperties","ext.flutter.inspector.getChildren","ext.flutter.inspector.getChildrenSummaryTree","ext.flutter.inspector.getChildrenDetailsSubtree","ext.flutter.inspector.getRootWidget","ext.flutter.inspector.getRootRenderObject","ext.flutter.inspector.getRootWidgetSummaryTree","ext.flutter.inspector.getDetailsSubtree","ext.flutter.inspector.getSelectedRenderObject","ext.flutter.inspector.getSelectedWidget","ext.flutter.inspector.getSelectedSummaryWidget","ext.flutter.inspector.isWidgetCreationTracked","ext.flutter.inspector.screenshot","ext.dart.io.getOpenFiles","ext.dart.io.getFileByID","ext.dart.io.getOpenSockets","ext.dart.io.getSocketByID"]
[FlutterDriver] Cannot get Dart Isolate
[FlutterDriver] Error: "ext.flutter.driver" is not found in "extensionRPCs" ["ext.ui.window.scheduleFrame","ext.flutter.reassemble","ext.flutter.exit","ext.flutter.saveCompilationTrace","ext.flutter.platformOverride","ext.flutter.evict","ext.flutter.timeDilation","ext.flutter.debugPaint","ext.flutter.debugPaintBaselinesEnabled","ext.flutter.repaintRainbow","ext.flutter.debugCheckElevationsEnabled","ext.flutter.debugDumpLayerTree","ext.flutter.debugDumpRenderTree","ext.flutter.debugDumpSemanticsTreeInTraversalOrder","ext.flutter.debugDumpSemanticsTreeInInverseHitTestOrder","ext.flutter.debugDumpApp","ext.flutter.showPerformanceOverlay","ext.flutter.didSendFirstFrameEvent","ext.flutter.didSendFirstFrameRasterizedEvent","ext.flutter.profileWidgetBuilds","ext.flutter.debugAllowBanner","ext.flutter.debugWidgetInspector","ext.flutter.inspector.structuredErrors","ext.flutter.inspector.show","ext.flutter.inspector.trackRebuildDirtyWidgets","ext.flutter.inspector.trackRepaintWidgets","ext.flutter.inspector.disposeAllGroups","ext.flutter.inspector.disposeGroup","ext.flutter.inspector.isWidgetTreeReady","ext.flutter.inspector.disposeId","ext.flutter.inspector.setPubRootDirectories","ext.flutter.inspector.setSelectionById","ext.flutter.inspector.getParentChain","ext.flutter.inspector.getProperties","ext.flutter.inspector.getChildren","ext.flutter.inspector.getChildrenSummaryTree","ext.flutter.inspector.getChildrenDetailsSubtree","ext.flutter.inspector.getRootWidget","ext.flutter.inspector.getRootRenderObject","ext.flutter.inspector.getRootWidgetSummaryTree","ext.flutter.inspector.getDetailsSubtree","ext.flutter.inspector.getSelectedRenderObject","ext.flutter.inspector.getSelectedWidget","ext.flutter.inspector.getSelectedSummaryWidget","ext.flutter.inspector.isWidgetCreationTracked","ext.flutter.inspector.screenshot","ext.dart.io.getOpenFiles","ext.dart.io.getFileByID","ext.dart.io.getOpenSockets","ext.dart.io.getSocketByID"]
[FlutterDriver]     at Object.wrappedLogger.errorAndThrow (/usr/local/lib/node_modules/appium-flutter-driver/node_modules/appium-support/lib/logging.js:74:35)
[FlutterDriver]     at Client.onOpenListener (/usr/local/lib/node_modules/appium-flutter-driver/lib/sessions/observatory.ts:91:17)
[FlutterDriver]     at runMicrotasks (<anonymous>)
[FlutterDriver]     at processTicksAndRejections (internal/process/task_queues.js:93:5)
shibupanda commented 4 years ago

@hattersharath The issue has already been created. Please refer the below link. https://github.com/truongsinh/appium-flutter-driver/issues/27

shibupanda commented 4 years ago

@hattersharath could you please close this if the issue has been resolved for you.

hattersharath commented 4 years ago

@shibupanda working on that will be closing soon.

hattersharath commented 4 years ago

I still get most of the sometimes while running script

 Attempt #1
[FlutterDriver] Connecting to Dart Observatory: ws://127.0.0.1:36023/QWYhtNSA7Ak=/ws
[FlutterDriver] Connected to ws://127.0.0.1:36023/QWYhtNSA7Ak=/ws
[FlutterDriver] "ext.flutter.driver" is not found in "extensionRPCs" ["ext.ui.window.scheduleFrame"]
[FlutterDriver] Cannot get Dart Isolate
[FlutterDriver] Error: "ext.flutter.driver" is not found in "extensionRPCs" ["ext.ui.window.scheduleFrame"]
[FlutterDriver]     at Object.wrappedLogger.errorAndThrow (/usr/local/lib/node_modules/appium-flutter-driver/node_modules/appium-support/lib/logging.js:74:35)
[FlutterDriver]     at Client.onOpenListener (/usr/local/lib/node_modules/appium-flutter-driver/lib/sessions/observatory.ts:91:17)
[FlutterDriver]     at processTicksAndRejections (internal/process/task_queues.js:93:5)
[FlutterDriver] Waiting 300 seconds before trying...
(node:4524) UnhandledPromiseRejectionWarning: Error: "ext.flutter.driver" is not found in "extensionRPCs" ["ext.ui.window.scheduleFrame"]
    at Object.wrappedLogger.errorAndThrow (/usr/local/lib/node_modules/appium-flutter-driver/node_modules/appium-support/lib/logging.js:74:35)
    at Client.onOpenListener (/usr/local/lib/node_modules/appium-flutter-driver/lib/sessions/observatory.ts:91:17)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
(node:4524) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:4524) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
truongsinh commented 4 years ago

@hattersharath please make sure you have enableFlutterDriverExtension(); before running your main app, ref https://github.com/truongsinh/appium-flutter-driver/blob/master/example/flutter_app_under_test/lib/main.dart#L9

hattersharath commented 4 years ago

Hi @truongsinh, I have added it in my code before runapp. But still most of the time it comes for android but works smooth for iOS.

truongsinh commented 4 years ago

@hattersharath does it happen intermittently to the same build? Is it possible that you can provide us that build, or a trimmed down version which can help us to debug?

hattersharath commented 4 years ago

@truongsinh Yes, It happens intermittently. Sorry, I can't share the build due to some reasons.

truongsinh commented 4 years ago

How frequent is that? Like 1 every 5 times, and then after several re-run (with the same build) then it works?

kirill09 commented 4 years ago

hi. I have the same problem all the time.

hattersharath commented 4 years ago

@truongsinh, it is just random. 1-2 times for every 5 times.

ahashmi24 commented 4 years ago

@hattersharath @kirill09 Can you please confirm if you guys are using --flavor in your command when building your apk?

I have seen a similar issue in flutter community. https://github.com/flutter/flutter/issues/26968

kirill09 commented 4 years ago

@ahashmi24 yes we use --flavor. but issues 26968 started flutter driver. I usage appium test. We have test "flutter driver" and they start without any problems.

hattersharath commented 4 years ago

@ahashmi24 I have tried using both dev and prod flavor but the result is still same.

Got response with status 200: {"sessionId":"1a1c7574-3d1a-4231-9e77-985e27b0be22","value":{"height":1794,"width":1080}}
[debug] [FlutterDriver] /Users/sharathrudramuniyappa/Library/Android/sdk/platform-tools/adb forward tcp:40283 tcp:40283
[FlutterDriver] Attempt #1
[FlutterDriver] Connecting to Dart Observatory: ws://127.0.0.1:40283/yuHoLut99EI=/ws
[FlutterDriver] Connected to ws://127.0.0.1:40283/yuHoLut99EI=/ws
[FlutterDriver] "ext.flutter.driver" is not found in "extensionRPCs" ["ext.ui.window.scheduleFrame"]
[FlutterDriver] Cannot get Dart Isolate
[FlutterDriver] Error: "ext.flutter.driver" is not found in "extensionRPCs" ["ext.ui.window.scheduleFrame"]
[FlutterDriver]     at Object.wrappedLogger.errorAndThrow (/usr/local/lib/node_modules/appium-flutter-driver/node_modules/appium-support/lib/logging.js:87:35)
[FlutterDriver]     at Client.onOpenListener (/usr/local/lib/node_modules/appium-flutter-driver/lib/sessions/observatory.ts:91:17)
[FlutterDriver]     at runMicrotasks (<anonymous>)
[FlutterDriver]     at processTicksAndRejections (internal/process/task_queues.js:93:5)
[FlutterDriver] Waiting 300 seconds before trying...
(node:83228) UnhandledPromiseRejectionWarning: Error: "ext.flutter.driver" is not found in "extensionRPCs" ["ext.ui.window.scheduleFrame"]
    at Object.wrappedLogger.errorAndThrow (/usr/local/lib/node_modules/appium-flutter-driver/node_modules/appium-support/lib/logging.js:87:35)
    at Client.onOpenListener (/usr/local/lib/node_modules/appium-flutter-driver/lib/sessions/observatory.ts:91:17)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
(node:83228) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:83228) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Once 300 seconds is done, it starts executing script.

truongsinh commented 4 years ago

Having ext.ui.window.scheduleFrame is quite unexpected. Do you have more than one device (including virtual one) connected, and one of which is ready for Flutter hot reload?

After reading the source code, even when I'm not able to reproduce this, I guest that the root cause is because the app has more than 1 isolates, and so far the driver assumes app has 1 isolate only. Thus I created a fix to check for the isolate with the exact name main.

truongsinh commented 4 years ago

Published, can you try https://www.npmjs.com/package/appium-flutter-driver/v/0.0.23

phabreeze commented 4 years ago

Published, can you try https://www.npmjs.com/package/appium-flutter-driver/v/0.0.23

It still working intermittently for me on both Android and iOS.

App built with Flutter v1.9.1+hotfix.6 Emulator Pixel 3 XL API 26

dependencies": { "appium": "^1.16.0", "appium-doctor": "^1.13.1", "appium-flutter-driver": "0.0.24-1", "webdriver": "^5.18.7" }

shibupanda commented 4 years ago

@fabdotnet there is no fixes for this with the latest build only we put some logs to debug the issue closely. Could you please share entire Appium logs using gist.

kirill09 commented 4 years ago

Hey, I'm still experimenting. Got the test project https://github.com/kirill09/flutter-appium-example. Tried running tests on a real Google pixel android 10 device. It's working fine.

I create Virtual Device via android SDK: Name: Pixel_2_API_27 CPU/ABI: Google Play Intel Atom (x86) Path: /Users/kirillbelyshev/.android/avd/Pixel_2_API_27.avd Target: google_apis_playstore [Google Play] (API level 27) Skin: pixel_2 SD Card: 512M fastboot.chosenSnapshotFile: runtime.network.speed: full hw.accelerometer: yes hw.device.name: pixel_2 hw.lcd.width: 1080 hw.initialOrientation: Portrait image.androidVersion.api: 27 tag.id: google_apis_playstore hw.mainKeys: no hw.camera.front: emulated avd.ini.displayname: Pixel 2 API 27 hw.gpu.mode: auto hw.ramSize: 1536 PlayStore.enabled: true fastboot.forceColdBoot: yes hw.cpu.ncore: 2 hw.keyboard: yes hw.sensors.proximity: yes hw.dPad: no hw.lcd.height: 1920 vm.heapSize: 256 skin.dynamic: yes hw.device.manufacturer: Google hw.gps: yes hw.audioInput: yes image.sysdir.1: system-images/android-27/google_apis_playstore/x86/ showDeviceFrame: yes hw.camera.back: virtualscene AvdId: Pixel_2_API_27 hw.lcd.density: 420 hw.arc: false hw.device.hash2: MD5:55acbc835978f326788ed66a5cd4c9a7 fastboot.forceChosenSnapshotBoot: no fastboot.forceFastBoot: no hw.trackBall: no hw.battery: yes hw.sdCard: yes tag.display: Google Play runtime.network.latency: none disk.dataPartition.size: 6442450944 hw.sensors.orientation: yes avd.ini.encoding: UTF-8 hw.gpu.enabled: yes

Launching. On Virtual Device I see applications in appium console:

[FlutterDriver] Attempt #1 [FlutterDriver] Connecting to Dart Observatory: ws://127.0.0.1:55517/NefCftHGZDs=/ws [FlutterDriver] Connected to ws://127.0.0.1:55517/NefCftHGZDs=/ws [FlutterDriver] "ext.flutter.driver" is not found in "extensionRPCs" ["ext.ui.window.scheduleFrame"] [FlutterDriver] Cannot get Dart Isolate [FlutterDriver] Error: "ext.flutter.driver" is not found in "extensionRPCs" ["ext.ui.window.scheduleFrame"] [FlutterDriver] at Object.wrappedLogger.errorAndThrow (/usr/local/lib/node_modules/appium/node_modules/appium-support/lib/logging.js:74:35) [FlutterDriver] at Client.onOpenListener (/usr/local/lib/node_modules/appium/node_modules/appium-flutter-driver/lib/sessions/observatory.ts:91:17) [FlutterDriver] at process._tickCallback (internal/process/next_tick.js:68:7) [FlutterDriver] Waiting 300 seconds before trying... (node:82725) UnhandledPromiseRejectionWarning: Error: "ext.flutter.driver" is not found in "extensionRPCs" ["ext.ui.window.scheduleFrame"] at Object.wrappedLogger.errorAndThrow (/usr/local/lib/node_modules/appium/node_modules/appium-support/lib/logging.js:74:35) at Client.onOpenListener (/usr/local/lib/node_modules/appium/node_modules/appium-flutter-driver/lib/sessions/observatory.ts:91:17) at process._tickCallback (internal/process/next_tick.js:68:7) (node:82725) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) (node:82725) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

kirill09 commented 4 years ago

I ran two more tests: 1) Virtual Device android 10. The result is successful completion of tests 2) Virtual Device android 9. Got the result an error.

Configuration 1: Name: Pixel_2_API_29 CPU/ABI: Google Play Intel Atom (x86) Path: /Users/kirillbelyshev/.android/avd/Pixel_2_API_29.avd Target: google_apis_playstore [Google Play] (API level 29) Skin: pixel_2 SD Card: 512M fastboot.chosenSnapshotFile: runtime.network.speed: full hw.accelerometer: yes hw.device.name: pixel_2 hw.lcd.width: 1080 hw.initialOrientation: Portrait image.androidVersion.api: 29 tag.id: google_apis_playstore hw.mainKeys: no hw.camera.front: emulated avd.ini.displayname: Pixel 2 API 29 hw.gpu.mode: auto hw.ramSize: 1536 PlayStore.enabled: true fastboot.forceColdBoot: no hw.cpu.ncore: 2 hw.keyboard: yes hw.sensors.proximity: yes hw.dPad: no hw.lcd.height: 1920 vm.heapSize: 256 skin.dynamic: yes hw.device.manufacturer: Google hw.gps: yes hw.audioInput: yes image.sysdir.1: system-images/android-29/google_apis_playstore/x86/ showDeviceFrame: yes hw.camera.back: virtualscene AvdId: Pixel_2_API_29 hw.lcd.density: 420 hw.arc: false hw.device.hash2: MD5:55acbc835978f326788ed66a5cd4c9a7 fastboot.forceChosenSnapshotBoot: no fastboot.forceFastBoot: yes hw.trackBall: no hw.battery: yes hw.sdCard: yes tag.display: Google Play runtime.network.latency: none disk.dataPartition.size: 6442450944 hw.sensors.orientation: yes avd.ini.encoding: UTF-8 hw.gpu.enabled: yes

Configuration 2: Name: Pixel_2_API_28 CPU/ABI: Google Play Intel Atom (x86) Path: /Users/kirillbelyshev/.android/avd/Pixel_2_API_28.avd Target: google_apis_playstore [Google Play] (API level 28) Skin: pixel_2 SD Card: 512M fastboot.chosenSnapshotFile: runtime.network.speed: full hw.accelerometer: yes hw.device.name: pixel_2 hw.lcd.width: 1080 hw.initialOrientation: Portrait image.androidVersion.api: 28 tag.id: google_apis_playstore hw.mainKeys: no hw.camera.front: emulated avd.ini.displayname: Pixel 2 API 28 hw.gpu.mode: auto hw.ramSize: 1536 PlayStore.enabled: true fastboot.forceColdBoot: no hw.cpu.ncore: 2 hw.keyboard: yes hw.sensors.proximity: yes hw.dPad: no hw.lcd.height: 1920 vm.heapSize: 256 skin.dynamic: yes hw.device.manufacturer: Google hw.gps: yes hw.audioInput: yes image.sysdir.1: system-images/android-28/google_apis_playstore/x86/ showDeviceFrame: yes hw.camera.back: virtualscene AvdId: Pixel_2_API_28 hw.lcd.density: 420 hw.arc: false hw.device.hash2: MD5:55acbc835978f326788ed66a5cd4c9a7 fastboot.forceChosenSnapshotBoot: no fastboot.forceFastBoot: yes hw.trackBall: no hw.battery: yes hw.sdCard: yes tag.display: Google Play runtime.network.latency: none disk.dataPartition.size: 6442450944 hw.sensors.orientation: yes avd.ini.encoding: UTF-8 hw.gpu.enabled: yes

[FlutterDriver] Attempt #1 [FlutterDriver] Connecting to Dart Observatory: ws://127.0.0.1:44347/XYZuUtL1r3g=/ws [FlutterDriver] Connected to ws://127.0.0.1:44347/XYZuUtL1r3g=/ws [FlutterDriver] "ext.flutter.driver" is not found in "extensionRPCs" ["ext.ui.window.scheduleFrame"] [FlutterDriver] Cannot get Dart Isolate [FlutterDriver] Error: "ext.flutter.driver" is not found in "extensionRPCs" ["ext.ui.window.scheduleFrame"] [FlutterDriver] at Object.wrappedLogger.errorAndThrow (/usr/local/lib/node_modules/appium/node_modules/appium-support/lib/logging.js:74:35) [FlutterDriver] at Client.onOpenListener (/usr/local/lib/node_modules/appium/node_modules/appium-flutter-driver/lib/sessions/observatory.ts:91:17) [FlutterDriver] at process._tickCallback (internal/process/next_tick.js:68:7) [FlutterDriver] Waiting 300 seconds before trying... (node:4173) UnhandledPromiseRejectionWarning: Error: "ext.flutter.driver" is not found in "extensionRPCs" ["ext.ui.window.scheduleFrame"] at Object.wrappedLogger.errorAndThrow (/usr/local/lib/node_modules/appium/node_modules/appium-support/lib/logging.js:74:35) at Client.onOpenListener (/usr/local/lib/node_modules/appium/node_modules/appium-flutter-driver/lib/sessions/observatory.ts:91:17) at process._tickCallback (internal/process/next_tick.js:68:7) (node:4173) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) (node:4173) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

kirill09 commented 4 years ago

Maybe the appium-flutter-driver works correctly with android API level 29?

truongsinh commented 4 years ago

Maybe the appium-flutter-driver works correctly with android API level 29?

Possible but improbable. Btw, did you check out the latest branch, which include the commit https://github.com/truongsinh/appium-flutter-driver/commit/395177e03afeeb5e8804b9c989e6572795012de1 ? It's supposed to have much more log

davidyukav commented 4 years ago

Hi! Im got some logs to share. I hope it'll be helpfull

Most often log looks like: [FlutterDriver] Attempt #1 [FlutterDriver] Connecting to Dart Observatory: ws://127.0.0.1:41330/fEEPmkSE-eE=/ws [FlutterDriver] Connected to ws://127.0.0.1:41330/fEEPmkSE-eE=/ws [FlutterDriver] Listing all isolates: [{"type":"@Isolate","id":"isolates/873273334157827","name":"main","number":"873273334157827"}] [FlutterDriver] "ext.flutter.driver" is not found in "extensionRPCs" ["ext.ui.window.scheduleFrame"] [FlutterDriver] Waiting 300 seconds before trying...

Once or twice i got: [FlutterDriver] Attempt #1 [FlutterDriver] Connecting to Dart Observatory: ws://127.0.0.1:37181/fc3C_glNKD4=/ws [FlutterDriver] Connected to ws://127.0.0.1:37181/fc3C_glNKD4=/ws [FlutterDriver] Listing all isolates: [{"type":"@Isolate","id":"isolates/1173056420837443","name":"main","number":"1173056420837443"}] [FlutterDriver] "ext.flutter.driver" is not found in "extensionRPCs" ["ext.ui.window.scheduleFrame","ext.flutter.reassemble","ext.flutter.exit","ext.flutter.saveCompilationTrace","ext.flutter.platformOverride","ext.flutter.evict","ext.flutter.timeDilation","ext.flutter.debugPaint","ext.flutter.debugPaintBaselinesEnabled","ext.flutter.repaintRainbow","ext.flutter.debugCheckElevationsEnabled","ext.flutter.debugDumpLayerTree","ext.flutter.debugDumpRenderTree","ext.flutter.debugDumpSemanticsTreeInTraversalOrder","ext.flutter.debugDumpSemanticsTreeInInverseHitTestOrder","ext.flutter.debugDumpApp","ext.flutter.showPerformanceOverlay","ext.flutter.didSendFirstFrameEvent","ext.flutter.didSendFirstFrameRasterizedEvent","ext.flutter.profileWidgetBuilds","ext.flutter.debugAllowBanner","ext.flutter.debugWidgetInspector","ext.flutter.inspector.structuredErrors","ext.flutter.inspector.show","ext.flutter.inspector.trackRebuildDirtyWidgets","ext.flutter.inspector.trackRepaintWidgets","ext.flutter.inspector.disposeAllGroups","ext.flutter.inspector.disposeGroup","ext.flutter.inspector.isWidgetTreeReady","ext.flutter.inspector.disposeId","ext.flutter.inspector.setPubRootDirectories","ext.flutter.inspector.setSelectionById","ext.flutter.inspector.getParentChain","ext.flutter.inspector.getProperties","ext.flutter.inspector.getChildren","ext.flutter.inspector.getChildrenSummaryTree","ext.flutter.inspector.getChildrenDetailsSubtree","ext.flutter.inspector.getRootWidget","ext.flutter.inspector.getRootRenderObject","ext.flutter.inspector.getRootWidgetSummaryTree","ext.flutter.inspector.getDetailsSubtree","ext.flutter.inspector.getSelectedRenderObject","ext.flutter.inspector.getSelectedWidget","ext.flutter.inspector.getSelectedSummaryWidget","ext.flutter.inspector.isWidgetCreationTracked","ext.flutter.inspector.screenshot"] [FlutterDriver] Waiting 300 seconds before trying...

gofur commented 4 years ago

i have same problem..any update for this issue? @truongsinh thanks :)

shibupanda commented 4 years ago

We have updated lastest version. Could you please try with the latest version of appium-flutter-driver.

dannysood commented 4 years ago

@shibupanda Sadly even with the latest update the issue is not going away.

dannysood commented 4 years ago

I have tried a few different things. I have tried switching to various different versions of appium, appium-flutter-driver and flutter. However there's been very little success. Randomly after reinstalling the package it works or after waiting a while it may. But sadly its totally unpredictable and probably works once every 30 tries. I havent been able to identify any pattern. However I would appreciate the help in resolving this quickly as this is the only tool that integrates with nodejs and helps us run e2e tests where rest of our application is outside flutter (web and api).

shibupanda commented 4 years ago

@dannysood Could you please have a look on this. Please let us know if this can fix your issue.

https://github.com/truongsinh/appium-flutter-driver/issues/91

dannysood commented 4 years ago

@shibupanda I have tried the proposed solution and havent been able to get it working sadly. It hasnt worked even once sadly. Is there anything else I am missing. Can you tell me your configuration if this is working for you (android sdk version, appium version, driver version etc). I am on macos.

shibupanda commented 4 years ago

@dannysood Strange! Did you include enableFlutteDriverrExtension() in the debug app? Please refer https://github.com/truongsinh/appium-flutter-driver/blob/326967b44ed6b86cda65c48bf8840f62643c827b/example/flutter_app_under_test/lib/main.dart#L9

dannysood commented 4 years ago

First really appreciate you being so prompt and helping out with the solution. When this issue is resolved I would love to contribute some functionality from the TODOs. I have added this but still isnt working. Maybe reviewing the different dependencies like dart, flutter, sdk used, avm configuration, appium version and driver version etc) can be of some help. I am on the latest version of macos if that helps in any way. But I can try replicating and testing this on windows/ubuntu VM.

shibupanda commented 4 years ago

@dannysood Please run flutter doctor. And please the complete Appium server logs which can help me to debug the issue. If possible please try once with our sample application as well. Please share reproducible apk if you have need to identify where the issue is.

dannysood commented 4 years ago

@shibupanda when I build flutter_app_under_test on my macos machine and test it via nodejs example it shows the same error (ext.flutter.driver not found) (after updating the apk path) however when I use your pre built version of apk (downloaded from releases) as mentioned in nodejs example it works as expected. For some reason my builds (i have tried both --debug and --profile) dont integrate instrumentation as they are supposed to. Can i do something more iwith my flutter setup. I have the latest flutter version (channel stable, 1.20.1) and have followed the standard getting started setup. Ill try to dig deeper a later today/tomorrow because I finally feel I am making some progress on it and come back with logs and more details. APpreciate all the help :)

shibupanda commented 4 years ago

@dannysood Below is my machine configuration. $ dart --version Dart SDK version: 2.10.0-11.0.dev (dev) (Tue Aug 11 02:21:48 2020 -0700) on "linux_x64" $ flutter --version Flutter 1.21.0-10.0.pre.55 • channel master • https://github.com/flutter/flutter.git Framework • revision 54f21ec7aa (8 hours ago) • 2020-08-12 08:01:03 -0400 Engine • revision ccfc7e5179 Tools • Dart 2.10.0 (build 2.10.0-11.0.dev)

NOTE: Please use debug application. It's not reproducible for me. Could you please create a sample app which can have the same issue I may help you.

I do flutter run command to create app.

rtiedt1051 commented 4 years ago

I also have this issue, on Windows OS with an Android emulator, if happens 75% the time and then connects after 300 seconds.. On Mac OS with an Android Emulator it happens 100% of the time and then connects after 300 seconds. On Mac OS with iOS simulator it works correctly every time.

[FlutterDriver] Attempt #1 [FlutterDriver] Connecting to Dart Observatory: ws://127.0.0.1:39061/PpOxMsRlfok=/ws [FlutterDriver] Connected to ws://127.0.0.1:39061/PpOxMsRlfok=/ws [FlutterDriver] Listing all isolates: [{"type":"@Isolate","id":"isolates/3323795019074815","name":"main","number":"3323795019074815"}] [FlutterDriver] Waiting 300 seconds before trying... [FlutterDriver] "ext.flutter.driver" is not found in "extensionRPCs" ["ext.ui.window.scheduleFrame","ext.dart.io.getHttpEnableTimelineLogging","ext.dart.io.setHttpEnableTimelineLogging","ext.dart.io.getSocketProfile","ext.dart.io.startSocketProfiling","ext.dart.io.pauseSocketProfiling","ext.dart.io.clearSocketProfile","ext.dart.io.getVersion"]

shibupanda commented 4 years ago

@dannysood Are you still facing the issue. Have you tried the above configuration and use flutter run command to build an app?

Reppinger commented 4 years ago

I am having the same issue:

Flutter 1.22.0-12.0.pre • channel dev • https://github.com/flutter/flutter.git
Framework • revision a27c242b0e (2 weeks ago) • 2020-09-11 17:46:57 -0400
Engine • revision fee6f9e533
Tools • Dart 2.10.0 (build 2.10.0-110.0.dev)
% npm list -g appium-flutter-driver
/usr/local/lib
└─┬ appium@1.19.0-beta.0
  └── appium-flutter-driver@0.0.25 

AndroidManifest.xml:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.verasana">
    <!-- Flutter needs it to communicate with the running application
         to allow setting breakpoints, to provide hot reload, etc.
    -->
    <uses-permission android:name="android.permission.INTERNET"/>
</manifest>

I get the ext.flutter.driver" is not found in "extensionRPCs" EVERY TIME if I simply do a flutter build apk --debug. Instead, run flutter drive to build the app (even though I have no flutter driver tests): flutter drive --target=test_driver/app.dart

Start emulator with: emulator -wipe-data -no-snapshot-save @Pixel_3_API_29

desired_caps = {
    caps: {
        platformName:  'Android',
        platformVersion: '10.0',
        deviceName:    'Android',
        app:           '../app/build/app/outputs/flutter-apk/app-debug.apk',
        avd: 'Pixel_3_API_29',
        automationName: 'flutter',
        # appActivity: '.app.SearchInvoke'
    },
    appium_lib: {
        wait: 30
    }
}

Call to core.start_driver loads and displays app on simulator, then Appium log:

...
[debug] [WD Proxy] Got response with status 200: {"sessionId":"628019cd-f243-4044-8e2d-a112ae295878","value":{"androidId":"2215fdf84783bd62","apiVersion":"29","bluetooth":null,"brand":"google","carrierName":"Android","displayDensity":440,"locale":"en_US","manufacturer":"Google","model":"Android SDK built for x86","networks":[{"capabilities":{"SSID":null,"linkDownBandwidthKbps":102400,"linkUpstreamBandwidthKbps":51200,"networkCapabilities":"NET_CAPABILITY_MMS,NET_CAPABILITY_SUPL,NET_CAPABILITY_DUN,NET_CAPABILITY_FOTA,NET_CAPABILITY_IMS,NET_CAPABILITY_CBS,NET_CAPABILITY_INTERNET,NET_CAPABILITY_NOT_RESTRICTED,NET_CAPABILITY_TRUSTED,NET_CAPABILITY_NOT_VPN,NET_CAPABILITY_VALIDATED,NET_CAPABILITY_NOT_ROAMING,NET_CAPABILITY_NOT_CONGESTED,NET_CAPABILITY_NOT_SUSPENDED","signalStrength":-2147483648,"transportTypes":"TRANSPORT_CELLULAR"},"detailedState":"CONNECTED","extraInfo":"epc.tmobile.com","isAvailable":true,"isConnected":true,"isFailover":false,"isRoaming":false,"state":"CONNECTED","subtype":13,"subtypeName":"LTE","type":0,"typeName":"MOBILE"},{"capabilities"...
[debug] [ADB] Running '/Users/randyeppinger/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell dumpsys window'
[AndroidDriver] Screen already unlocked, doing nothing
[UiAutomator2] Starting 'com.example.verasana/com.example.verasana.MainActivity and waiting for 'com.example.verasana/com.example.verasana.MainActivity'
[debug] [ADB] Running '/Users/randyeppinger/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell am start -W -n com.example.verasana/com.example.verasana.MainActivity -S'
[debug] [ADB] Waiting up to 20000ms for activity matching pkg: 'com.example.verasana' and activity: 'com.example.verasana.MainActivity' to be focused
[debug] [ADB] Possible activities, to be checked: 'com.example.verasana.MainActivity', 'com.example.verasana.com.example.verasana.MainActivity'
[debug] [ADB] Getting focused package and activity
[debug] [ADB] Running '/Users/randyeppinger/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell dumpsys window displays'
[debug] [ADB] Found package: 'com.example.verasana' and fully qualified activity name : 'com.example.verasana.MainActivity'
[debug] [WD Proxy] Proxying [GET /appium/device/pixel_ratio] to [GET http://127.0.0.1:8200/wd/hub/session/628019cd-f243-4044-8e2d-a112ae295878/appium/device/pixel_ratio] with no body
[debug] [WD Proxy] Got response with status 200: {"sessionId":"628019cd-f243-4044-8e2d-a112ae295878","value":2.75}
[debug] [WD Proxy] Matched '/appium/device/system_bars' to command name 'getSystemBars'
[debug] [WD Proxy] Proxying [GET /appium/device/system_bars] to [GET http://127.0.0.1:8200/wd/hub/session/628019cd-f243-4044-8e2d-a112ae295878/appium/device/system_bars] with no body
[debug] [WD Proxy] Got response with status 200: {"sessionId":"628019cd-f243-4044-8e2d-a112ae295878","value":{"statusBar":66}}
[debug] [WD Proxy] Matched '/window/current/size' to command name 'getWindowSize'
[debug] [WD Proxy] Proxying [GET /window/current/size] to [GET http://127.0.0.1:8200/wd/hub/session/628019cd-f243-4044-8e2d-a112ae295878/window/current/size] with no body
[debug] [WD Proxy] Got response with status 200: {"sessionId":"628019cd-f243-4044-8e2d-a112ae295878","value":{"height":2028,"width":1080}}
[debug] [FlutterDriver] /Users/randyeppinger/Library/Android/sdk/platform-tools/adb forward tcp:38453 tcp:38453
[FlutterDriver] Attempt #1
[FlutterDriver] Connecting to Dart Observatory: ws://127.0.0.1:38453/hQ5RAV-K23g=/ws
[FlutterDriver] Connected to ws://127.0.0.1:38453/hQ5RAV-K23g=/ws
[FlutterDriver] Listing all isolates: [{"type":"@Isolate","id":"isolates/751656550747915","name":"main","number":"751656550747915","isSystemIsolate":false}]
[FlutterDriver] "ext.flutter.driver" is not found in "extensionRPCs" ["ext.ui.window.scheduleFrame","ext.dart.io.getHttpEnableTimelineLogging","ext.dart.io.setHttpEnableTimelineLogging","ext.dart.io.getSocketProfile","ext.dart.io.startSocketProfiling","ext.dart.io.pauseSocketProfiling","ext.dart.io.clearSocketProfile","ext.dart.io.getVersion","ext.flutter.reassemble","ext.flutter.exit","ext.flutter.platformOverride","ext.flutter.brightnessOverride","ext.flutter.timeDilation","ext.flutter.evict","ext.flutter.debugPaint","ext.flutter.debugPaintBaselinesEnabled","ext.flutter.repaintRainbow","ext.flutter.debugCheckElevationsEnabled","ext.flutter.debugDumpLayerTree","ext.flutter.debugDumpRenderTree","ext.flutter.debugDumpSemanticsTreeInTraversalOrder","ext.flutter.debugDumpSemanticsTreeInInverseHitTestOrder","ext.flutter.debugDumpApp","ext.flutter.showPerformanceOverlay","ext.flutter.didSendFirstFrameEvent","ext.flutter.didSendFirstFrameRasterizedEvent","ext.flutter.fastReassemble","ext.flutter.profileWidgetBuilds","ext.flutter.invertOversizedImages","ext.flutter.debugAllowBanner","ext.flutter.debugWidgetInspector","ext.flutter.inspector.structuredErrors","ext.flutter.inspector.show","ext.flutter.inspector.trackRebuildDirtyWidgets","ext.flutter.inspector.trackRepaintWidgets","ext.flutter.inspector.disposeAllGroups","ext.flutter.inspector.disposeGroup","ext.flutter.inspector.isWidgetTreeReady","ext.flutter.inspector.disposeId","ext.flutter.inspector.setPubRootDirectories","ext.flutter.inspector.setSelectionById","ext.flutter.inspector.getParentChain","ext.flutter.inspector.getProperties","ext.flutter.inspector.getChildren","ext.flutter.inspector.getChildrenSummaryTree","ext.flutter.inspector.getChildrenDetailsSubtree","ext.flutter.inspector.getRootWidget","ext.flutter.inspector.getRootRenderObject","ext.flutter.inspector.getRootWidgetSummaryTree","ext.flutter.inspector.getDetailsSubtree","ext.flutter.inspector.getSelectedRenderObject","ext.flutter.inspector.getSelectedWidget","ext.flutter.inspector.getSelectedSummaryWidget","ext.flutter.inspector.isWidgetCreationTracked","ext.flutter.inspector.screenshot"]
[FlutterDriver] Waiting 300 seconds before trying...
Reppinger commented 4 years ago

Now I have to take that back. I ran it several times without issue. Now it is doing it again. So, put me on the list of people getting the error intermittently. :) Will keep investigating....

Reppinger commented 4 years ago

Just adding another update that was contributing to my confusion. I get the ext.flutter.driver" is not found in "extensionRPCs" EVERY TIME if I simply do a flutter build apk --debug. Instead, I MUST run flutter drive to build the app (even though I have no flutter driver tests): flutter drive --target=test_driver/app.dart

I still receive the error intermittently but it is much more tolerable.

pablo-gonzalez commented 4 years ago

Hi. I am facing the same issue running on Android emulator using Ruby.

[FlutterDriver] "ext.flutter.driver" is not found in "extensionRPCs" 
[FlutterDriver] Waiting 300 seconds before trying...

After second try it works fine.

A possible workaround until fix the issue could be to reduce time for next try. 300 seconds (5 minutes) is too much in my opinion). Is it possible to reduce that time using some parameter? Do you need more details to help to fix the issue? Thanks

sw_vers
ProductName:    Mac OS X
ProductVersion: 10.15.7
BuildVersion:   19H2

node -v
v12.18.4

ruby -v
ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x86_64-darwin19]

gem list  
*** LOCAL GEMS ***

appium_console (2.12.0)
appium_flutter_finder (0.1.1)
appium_lib (10.6.0)
appium_lib_core (3.11.0)
benchmark (default: 0.1.0)
bigdecimal (default: 2.0.0)
bond (0.5.1)
bundle (0.0.1)
bundler (default: 2.1.4)
bundler-unload (1.0.2)
cgi (default: 0.1.0)
childprocess (3.0.0)
chronic_duration (0.10.6)
coderay (1.1.3)
csv (default: 3.1.2)
date (default: 3.0.0)
dbm (default: 1.1.0)
delegate (default: 0.1.0)
did_you_mean (default: 1.4.0)
diff-lcs (1.4.4)
etc (default: 1.1.0)
eventmachine (1.2.7)
executable-hooks (1.6.0)
faye-websocket (0.11.0)
fcntl (default: 1.0.0)
fiddle (default: 1.0.0)
fileutils (default: 1.4.1)
forwardable (default: 1.3.1)
gem-wrappers (1.4.0)
getoptlong (default: 0.1.0)
io-console (default: 0.5.6)
ipaddr (default: 1.2.2)
irb (default: 1.2.3)
json (default: 2.3.0)
logger (default: 1.4.2)
matrix (default: 0.2.0)
method_source (0.9.2)
mini_portile2 (2.4.0)
minitest (5.14.2, 5.13.0)
mutex_m (default: 0.1.0)
net-pop (default: 0.1.0)
net-smtp (default: 0.1.0)
net-telnet (0.2.0)
nokogiri (1.10.10)
numerizer (0.1.1)
observer (default: 0.1.0)
open3 (default: 0.1.0)
openssl (default: 2.1.2)
ostruct (default: 0.2.0)
power_assert (1.1.7)
prime (default: 0.1.1)
pry (0.12.2)
pstore (default: 0.1.0)
psych (default: 3.1.0)
racc (default: 1.4.16)
rake (13.0.1)
rdoc (default: 6.2.1)
readline (default: 0.0.2)
readline-ext (default: 0.1.0)
reline (default: 0.1.3)
rexml (default: 3.2.3)
rspec (3.9.0)
rspec-core (3.9.2)
rspec-expectations (3.9.2)
rspec-mocks (3.9.1)
rspec-support (3.9.3)
rss (default: 0.2.8)
rubygems-bundler (1.4.5)
rubyzip (2.3.0)
rvm (1.11.3.9)
sdbm (default: 1.0.0)
selenium-webdriver (3.142.7)
singleton (default: 0.1.0)
spec (5.3.4)
stringio (default: 0.1.0)
strscan (default: 1.0.3)
test-unit (3.3.4)
thor (0.20.3)
timeout (default: 0.1.0)
tomlrb (1.3.0)
tracer (default: 0.1.0)
uri (default: 0.10.0)
webrick (default: 1.6.0)
websocket-driver (0.7.3)
websocket-extensions (0.1.5)
xmlrpc (0.3.0)
yaml (default: 0.1.0)
zlib (default: 1.1.0)
[simctl] FlutterDriver Attempt #1
[simctl] FlutterDriver Connecting to Dart Observatory: ws://127.0.0.1:41651/TNOgU2xxEdk=/ws
[simctl] FlutterDriver Connected to ws://127.0.0.1:41651/TNOgU2xxEdk=/ws
[simctl] FlutterDriver Listing all isolates: [{"type":"@Isolate","id":"isolates/1455650481450547","name":"main","number":"1455650481450547"}]
[simctl] FlutterDriver "ext.flutter.driver" is not found in "extensionRPCs" ["ext.ui.window.scheduleFrame","ext.dart.io.getHttpEnableTimelineLogging","ext.dart.io.setHttpEnableTimelineLogging","ext.dart.io.getSocketProfile","ext.dart.io.startSocketProfiling","ext.dart.io.pauseSocketProfiling","ext.dart.io.clearSocketProfile","ext.dart.io.getVersion"]
[simctl] FlutterDriver Waiting 300 seconds before trying...
[simctl] FlutterDriver Attempt #2
[simctl] FlutterDriver Connecting to Dart Observatory: ws://127.0.0.1:41651/TNOgU2xxEdk=/ws
[simctl] FlutterDriver Connected to ws://127.0.0.1:41651/TNOgU2xxEdk=/ws
[simctl] FlutterDriver Listing all isolates: [{"type":"@Isolate","id":"isolates/1455650481450547","name":"main","number":"1455650481450547"}]
[simctl] Appium New FlutterDriver session created successfully, session e9ac007d-d2e8-42b1-a763-f9adccef7d92 added to master session list
[debug] [simctl] BaseDriver Event 'newSessionStarted' logged at 1601579773461 (16:16:13 GMT-0300 (GMT-03:00))
[debug] [simctl] MJSONWP (e9ac007d) Cached the protocol value 'MJSONWP' for the new session e9ac007d-d2e8-42b1-a763-f9adccef7d92
[debug] [simctl] MJSONWP (e9ac007d) Responding to client with driver.createSession() result: {"shell":null,"allowCors":false,"reboot":false,"ipa":null,"address":"0.0.0.0","port":4723,"basePath":"/wd/hub","callbackAddress":null,"callbackPort":null,"bootstrapPort":4724,"backendRetries":3,"sessionOverride":false,"launch":false,"logFile":null,"loglevel":"debug","logTimestamp":false,"localTimezone":false,"logNoColors":false,"webhook":null,"safari":false,"defaultDevice":false,"forceIphone":false,"forceIpad":false,"automationTraceTemplatePath":null,"instrumentsPath":null,"nodeconfig":null,"robotAddress":"0.0.0.0","robotPort":-1,"chromedriverExecutable":null,"showConfig":false,"noPermsCheck":false,"enforceStrictCaps":false,"isolateSimDevice":false,"tmpDir":"/var/folders/1q/0kgd4z1x23z13kl_jmlytwcr0000gp/T","traceDir":null,"debugLogSpacing":false,"suppressKillServer":false,"longStacktrace":false,"webkitDebugProxyPort":27753,"wdaLocalPort":8100,"defaultCapabilities":{},"relaxedSecurityEnabled":false,"allowInsecure":[],"denyInsecure":[],"defaultCommandTimeout":60,"keepArtifacts":false,"platformName":"Android...
  ANDROID_CAPS = {
    caps: {
      platformName: 'Android',
      automationName: 'Flutter',
      deviceName: 'emulator-5554',
      app: "/Users/pablo.gonzalez/projects/my_app/build/app/outputs/flutter-apk/app-debug.apk",
      retryBackoffTime: 100
    },
    appium_lib: {
      export_session: true,
      wait_timeout: 20,
      wait_interval: 1
    }
  }.freeze
Reppinger commented 4 years ago

I too wondered if the 300 seconds is configurable. It would certainly make the intermittent issue a little more tolerable.

Reppinger commented 4 years ago

@pablo-gonzalez For some reason, I had to "ruby-fy" that setting.
retry_backoff_time: 30000 #milliseconds worked instead of retryBackoffTime.

pablo-gonzalez commented 4 years ago

@pablo-gonzalez For some reason, I had to "ruby-fy" that setting. retry_backoff_time: 30000 #milliseconds worked instead of retryBackoffTime.

@Reppinger Thank you for your comments. You are right, retryBackoffTime is not recognized by Appium in Ruby.

I am not sure but that capability seems to be related to this in the log:

[simctl] UiAutomator2 Waiting up to 30000ms for UiAutomator2 to be online...

retryBackoffTime | the time wait for socket connection retry for get flutter session (default 300000ms) | 500

By the way the value in documentation seems to be wrong. @truongsinh could you provide some clarification on this?

[Appium] Welcome to Appium v1.18.2
[Appium] Appium REST http interface listener started on 0.0.0.0:4723
[debug] [HTTP] Request idempotency key: 1198053b-fb30-4fb5-85dc-5c463974ad2d
[HTTP] --> POST /wd/hub/session
[HTTP] {"desiredCapabilities":{"platformName":"Android","automationName":"Flutter","deviceName":"emulator-5554","app":"/Users/pablo.gonzalez/projects/my_app/build/app/outputs/flutter-apk/app-debug.apk","retryBackoffTime":100},"capabilities":{"firstMatch":[{"platformName":"Android","appium:automationName":"Flutter","appium:deviceName":"emulator-5554","appium:app":"/Users/pablo.gonzalez/projects/my_app/build/app/outputs/flutter-apk/app-debug.apk","appium:retryBackoffTime":100}]}}
[debug] [W3C] Calling AppiumDriver.createSession() with args: [{"platformName":"Android","automationName":"Flutter","deviceName":"emulator-5554","app":"/Users/pablo.gonzalez/projects/my_app/build/app/outputs/flutter-apk/app-debug.apk","retryBackoffTime":100},null,{"firstMatch":[{"platformName":"Android","appium:automationName":"Flutter","appium:deviceName":"emulator-5554","appium:app":"/Users/pablo.gonzalez/projects/my_app/build/app/outputs/flutter-apk/app-debug.apk","appium:retryBackoffTime":100}]}]
[debug] [BaseDriver] Event 'newSessionRequested' logged at 1601659128733 (14:18:48 GMT-0300 (GMT-03:00))
[simctl] Appium Appium v1.18.2 creating new FlutterDriver (v0.0.23) session
[debug] [simctl] BaseDriver Creating session with MJSONWP desired capabilities: {
[debug] [simctl] BaseDriver   "platformName": "Android",
[debug] [simctl] BaseDriver   "automationName": "Flutter",
[debug] [simctl] BaseDriver   "deviceName": "emulator-5554",
[debug] [simctl] BaseDriver   "app": "/Users/pablo.gonzalez/projects/my_app/build/app/outputs/flutter-apk/app-debug.apk",
[debug] [simctl] BaseDriver   "retryBackoffTime": 100
[debug] [simctl] BaseDriver }
[simctl] BaseDriver The following capabilities were provided, but are not recognized by Appium:
[simctl] BaseDriver   retryBackoffTime
[simctl] BaseDriver Session created with session id: 47f6937d-a22d-434b-be5a-7ceb2194ce52
[simctl] FlutterDriver Starting an Android proxy session
[debug] [simctl] BaseDriver Creating session with MJSONWP desired capabilities: {
[debug] [simctl] BaseDriver   "platformName": "Android",
[debug] [simctl] BaseDriver   "automationName": "Flutter",
[debug] [simctl] BaseDriver   "deviceName": "emulator-5554",
[debug] [simctl] BaseDriver   "app": "/Users/pablo.gonzalez/projects/my_app/build/app/outputs/flutter-apk/app-debug.apk",
[debug] [simctl] BaseDriver   "retryBackoffTime": 100,
[debug] [simctl] BaseDriver   "newCommandTimeout": 0
[debug] [simctl] BaseDriver }
[simctl] BaseDriver The following capabilities were provided, but are not recognized by Appium:
[simctl] BaseDriver   retryBackoffTime
[simctl] BaseDriver Session created with session id: dbb002c0-4fdc-4768-a7f6-1f166dbce770
[simctl] BaseDriver Using local app '/Users/pablo.gonzalez/projects/my_app/build/app/outputs/flutter-apk/app-debug.apk'
[debug] [simctl] UiAutomator2 Checking whether app is actually present

Even using retry_backoff_time the capability is not recognized:

[Appium] Welcome to Appium v1.18.2
[Appium] Appium REST http interface listener started on 0.0.0.0:4723
[debug] [HTTP] Request idempotency key: e72bf9f0-ad38-409d-b6d8-300697f2405d
[HTTP] --> POST /wd/hub/session
[HTTP] {"desiredCapabilities":{"platformName":"Android","automationName":"Flutter","deviceName":"emulator-5554","app":"/Users/pablo.gonzalez/projects/my_app/build/app/outputs/flutter-apk/app-debug.apk","retryBackoffTime":100},"capabilities":{"firstMatch":[{"platformName":"Android","appium:automationName":"Flutter","appium:deviceName":"emulator-5554","appium:app":"/Users/pablo.gonzalez/projects/my_app/build/app/outputs/flutter-apk/app-debug.apk","appium:retry_backoff_time":100}]}}
[debug] [W3C] Calling AppiumDriver.createSession() with args: [{"platformName":"Android","automationName":"Flutter","deviceName":"emulator-5554","app":"/Users/pablo.gonzalez/projects/my_app/build/app/outputs/flutter-apk/app-debug.apk","retryBackoffTime":100},null,{"firstMatch":[{"platformName":"Android","appium:automationName":"Flutter","appium:deviceName":"emulator-5554","appium:app":"/Users/pablo.gonzalez/projects/my_app/build/app/outputs/flutter-apk/app-debug.apk","appium:retry_backoff_time":100}]}]
[debug] [BaseDriver] Event 'newSessionRequested' logged at 1601660015713 (14:33:35 GMT-0300 (GMT-03:00))
[Appium] The following capabilities were provided in the JSONWP desired capabilities that are missing in W3C capabilities: ["retryBackoffTime"]
[Appium] Trying to fix W3C capabilities by merging them with JSONWP caps
[BaseDriver] The following capabilities are not standard capabilities and should have an extension prefix:
[BaseDriver]   retryBackoffTime
[BaseDriver]   automationName
[BaseDriver]   deviceName
[BaseDriver]   app
[BaseDriver]   retry_backoff_time
[simctl] Appium Appium v1.18.2 creating new FlutterDriver (v0.0.23) session
[debug] [simctl] BaseDriver Creating session with MJSONWP desired capabilities: {
[debug] [simctl] BaseDriver   "platformName": "Android",
[debug] [simctl] BaseDriver   "automationName": "Flutter",
[debug] [simctl] BaseDriver   "deviceName": "emulator-5554",
[debug] [simctl] BaseDriver   "app": "/Users/pablo.gonzalez/projects/my_app/build/app/outputs/flutter-apk/app-debug.apk",
[debug] [simctl] BaseDriver   "retryBackoffTime": 100
[debug] [simctl] BaseDriver }
[simctl] BaseDriver The following capabilities were provided, but are not recognized by Appium:
[simctl] BaseDriver   retryBackoffTime
[simctl] BaseDriver Session created with session id: 0023129c-c865-40d7-9be3-97198ec78085
[simctl] FlutterDriver Starting an Android proxy session
[debug] [simctl] BaseDriver Creating session with MJSONWP desired capabilities: {
[debug] [simctl] BaseDriver   "platformName": "Android",
[debug] [simctl] BaseDriver   "automationName": "Flutter",
[debug] [simctl] BaseDriver   "deviceName": "emulator-5554",
[debug] [simctl] BaseDriver   "app": "/Users/pablo.gonzalez/projects/my_app/build/app/outputs/flutter-apk/app-debug.apk",
[debug] [simctl] BaseDriver   "retryBackoffTime": 100,
[debug] [simctl] BaseDriver   "newCommandTimeout": 0
[debug] [simctl] BaseDriver }
[simctl] BaseDriver The following capabilities were provided, but are not recognized by Appium:
[simctl] BaseDriver   retryBackoffTime
[simctl] BaseDriver Session created with session id: dd2c8eaa-9795-4ed3-a40f-a6235b9523df
[simctl] BaseDriver Using local app '/Users/pablo.gonzalez/projects/my_app/build/app/outputs/flutter-apk/app-debug.apk'
[debug] [simctl] UiAutomator2 Checking whether app is actually present

@Reppinger could you kill Appium, restart and share your logs to verify the capabilities for your session?

Thanks in advance.

Reppinger commented 4 years ago

@pablo-gonzalez, I get the same error that it doesn't recognize the setting, but it works for me.

Here is my desired caps that I am passing from my Cucumber project to Appium:

desired_caps = {
    caps: {
        platformName:  'Android',
        deviceName:    'Pixel',
        app:           ANDROID_APP,
        avd: FigNewton.avd,
        automationName: 'Flutter',
        retry_backoff_time: 10000 #10 seconds
    },
    appium_lib: {
        export_session: true,
        wait_timeout: 20,
        wait_interval: 1
    }
}

$core = ::Appium::Core.for(desired_caps)

Appium logs the following:

The following capabilities are not standard capabilities and should have an extension prefix:
[BaseDriver]   retryBackoffTime
[BaseDriver]   deviceName
[BaseDriver]   app
[BaseDriver]   avd
[BaseDriver]   automationName
[BaseDriver]   retry_backoff_time
[BaseDriver] The following capabilities were provided, but are not recognized by Appium:
[BaseDriver]   retryBackoffTime

Yet, when it gets the intermittent error it only waits 10 seconds before making Attempt 2:

[FlutterDriver] Attempt #1
[FlutterDriver] Connecting to Dart Observatory: ws://127.0.0.1:42859/OZMCTuegozY=/ws
[FlutterDriver] Connected to ws://127.0.0.1:42859/OZMCTuegozY=/ws
[FlutterDriver] Listing all isolates: [{"type":"@Isolate","id":"isolates/3728727374444047","name":"main","number":"3728727374444047","isSystemIsolate":false}]
[FlutterDriver] "ext.flutter.driver" is not found in "extensionRPCs" ["ext.ui.window.scheduleFrame","ext.dart.io.getHttpEnableTimelineLogging","ext.dart.io.setHttpEnableTimelineLogging","ext.dart.io.getSocketProfile","ext.dart.io.startSocketProfiling","ext.dart.io.pauseSocketProfiling","ext.dart.io.clearSocketProfile","ext.dart.io.getVersion","ext.flutter.reassemble","ext.flutter.exit","ext.flutter.platformOverride","ext.flutter.brightnessOverride"]
[FlutterDriver] Waiting 10 seconds before trying...
[FlutterDriver] Attempt #2

I hope that helps!

pablo-gonzalez commented 4 years ago

Thank you @Reppinger for your clarification!

I have tried using the same capability you shared (check log below) but it is not working.

I think you are running on emulator too, right? Could you share your Appium and Ruby versions and gem list to check the differences please?

Thanks in advance

[Appium] Welcome to Appium v1.18.2
[Appium] Appium REST http interface listener started on 0.0.0.0:4723
[debug] [HTTP] Request idempotency key: 5880511b-9224-4aed-807c-76beb958499e
[HTTP] --> POST /wd/hub/session
[HTTP] {"desiredCapabilities":{"platformName":"Android","automationName":"Flutter","deviceName":"emulator-5554","app":"/Users/pablo.gonzalez/projects/my_app/build/app/outputs/flutter-apk/app-debug.apk","retryBackoffTime":10000},"capabilities":{"firstMatch":[{"platformName":"Android","appium:automationName":"Flutter","appium:deviceName":"emulator-5554","appium:app":"/Users/pablo.gonzalez/projects/my_app/build/app/outputs/flutter-apk/app-debug.apk","appium:retry_backoff_time":10000}]}}
[debug] [W3C] Calling AppiumDriver.createSession() with args: [{"platformName":"Android","automationName":"Flutter","deviceName":"emulator-5554","app":"/Users/pablo.gonzalez/projects/my_app/build/app/outputs/flutter-apk/app-debug.apk","retryBackoffTime":10000},null,{"firstMatch":[{"platformName":"Android","appium:automationName":"Flutter","appium:deviceName":"emulator-5554","appium:app":"/Users/pablo.gonzalez/projects/my_app/build/app/outputs/flutter-apk/app-debug.apk","appium:retry_backoff_time":10000}]}]
[debug] [BaseDriver] Event 'newSessionRequested' logged at 1601919961661 (14:46:01 GMT-0300 (GMT-03:00))
[Appium] The following capabilities were provided in the JSONWP desired capabilities that are missing in W3C capabilities: ["retryBackoffTime"]
[Appium] Trying to fix W3C capabilities by merging them with JSONWP caps
[BaseDriver] The following capabilities are not standard capabilities and should have an extension prefix:
[BaseDriver]   retryBackoffTime
[BaseDriver]   automationName
[BaseDriver]   deviceName
[BaseDriver]   app
[BaseDriver]   retry_backoff_time
[simctl] Appium Appium v1.18.2 creating new FlutterDriver (v0.0.23) session
[debug] [simctl] BaseDriver Creating session with MJSONWP desired capabilities: {
[debug] [simctl] BaseDriver   "platformName": "Android",
[debug] [simctl] BaseDriver   "automationName": "Flutter",
[debug] [simctl] BaseDriver   "deviceName": "emulator-5554",
[debug] [simctl] BaseDriver   "app": "/Users/pablo.gonzalez/projects/my_app/build/app/outputs/flutter-apk/app-debug.apk",
[debug] [simctl] BaseDriver   "retryBackoffTime": 10000
[debug] [simctl] BaseDriver }
[simctl] BaseDriver The following capabilities were provided, but are not recognized by Appium:
[simctl] BaseDriver   retryBackoffTime
[simctl] BaseDriver Session created with session id: 8ded6f23-acd4-4854-93fb-ab54bbeb1a7d
[simctl] FlutterDriver Starting an Android proxy session
[debug] [simctl] BaseDriver Creating session with MJSONWP desired capabilities: {
[debug] [simctl] BaseDriver   "platformName": "Android",
[debug] [simctl] BaseDriver   "automationName": "Flutter",
[debug] [simctl] BaseDriver   "deviceName": "emulator-5554",
[debug] [simctl] BaseDriver   "app": "/Users/pablo.gonzalez/projects/my_app/build/app/outputs/flutter-apk/app-debug.apk",
[debug] [simctl] BaseDriver   "retryBackoffTime": 10000,
[debug] [simctl] BaseDriver   "newCommandTimeout": 0
[debug] [simctl] BaseDriver }
[simctl] BaseDriver The following capabilities were provided, but are not recognized by Appium:
[simctl] BaseDriver   retryBackoffTime
[simctl] BaseDriver Session created with session id: bf0cf036-6efd-4aff-bdd5-4e38acf13045
[simctl] BaseDriver Using local app '/Users/pablo.gonzalez/projects/my_app/build/app/outputs/flutter-apk/app-debug.apk'
[debug] [simctl] UiAutomator2 Checking whether app is actually present
...
[simctl] FlutterDriver Attempt #1
[simctl] FlutterDriver Connecting to Dart Observatory: ws://127.0.0.1:33141/ORAT-h4wA70=/ws
[simctl] FlutterDriver Connected to ws://127.0.0.1:33141/ORAT-h4wA70=/ws
[simctl] FlutterDriver Listing all isolates: [{"type":"@Isolate","id":"isolates/1028156084125559","name":"main","number":"1028156084125559"}]
[simctl] FlutterDriver "ext.flutter.driver" is not found in "extensionRPCs" ["ext.ui.window.scheduleFrame","ext.dart.io.getHttpEnableTimelineLogging","ext.dart.io.setHttpEnableTimelineLogging","ext.dart.io.getSocketProfile","ext.dart.io.startSocketProfiling","ext.dart.io.pauseSocketProfiling","ext.dart.io.clearSocketProfile","ext.dart.io.getVersion"]
[simctl] FlutterDriver Waiting 300 seconds before trying...
Reppinger commented 4 years ago

Yes, @pablo-gonzalez I am using an Android emulator. It also works with another dev's emulator and on the emulator on the build server. I don't recall where I read it, but you want to use appium-flutter-driver 0.25 which requires installing Appium 1.19 beta.

npm install -g appium@1.19.0-beta.0

npm list -g appium-flutter-driver
/usr/local/lib
└─┬ appium@1.19.0-beta.0
  └── appium-flutter-driver@0.0.25 

I'm using ruby 2.6.6p146 on MacOS with rvm.

Here's my Gemfile.lock:

GEM
  remote: https://rubygems.org/
  specs:
    activesupport (6.0.3.3)
      concurrent-ruby (~> 1.0, >= 1.0.2)
      i18n (>= 0.7, < 2)
      minitest (~> 5.1)
      tzinfo (~> 1.1)
      zeitwerk (~> 2.2, >= 2.2.2)
    appium_flutter_finder (0.1.1)
      appium_lib_core (~> 3.4, >= 3.4.2)
    appium_lib (10.6.0)
      appium_lib_core (~> 3.3)
      nokogiri (~> 1.8, >= 1.8.1)
      tomlrb (~> 1.1)
    appium_lib_core (3.11.0)
      faye-websocket (~> 0.11.0)
      selenium-webdriver (~> 3.14, >= 3.14.1)
    builder (3.2.4)
    childprocess (3.0.0)
    concurrent-ruby (1.1.7)
    cucumber (5.1.2)
      builder (~> 3.2, >= 3.2.4)
      cucumber-core (~> 8.0, >= 8.0.1)
      cucumber-create-meta (~> 2.0, >= 2.0.2)
      cucumber-cucumber-expressions (~> 10.3, >= 10.3.0)
      cucumber-gherkin (~> 15.0, >= 15.0.2)
      cucumber-html-formatter (~> 9.0, >= 9.0.0)
      cucumber-messages (~> 13.1, >= 13.1.0)
      cucumber-wire (~> 4.0, >= 4.0.1)
      diff-lcs (~> 1.4, >= 1.4.4)
      multi_test (~> 0.1, >= 0.1.2)
      sys-uname (~> 1.2, >= 1.2.1)
    cucumber-core (8.0.1)
      cucumber-gherkin (~> 15.0, >= 15.0.2)
      cucumber-messages (~> 13.0, >= 13.0.1)
      cucumber-tag-expressions (~> 2.0, >= 2.0.4)
    cucumber-create-meta (2.0.2)
      cucumber-messages (~> 13.0, >= 13.0.1)
      sys-uname (~> 1.2, >= 1.2.1)
    cucumber-cucumber-expressions (10.3.0)
    cucumber-gherkin (15.0.2)
      cucumber-messages (~> 13.0, >= 13.0.1)
    cucumber-html-formatter (9.0.0)
      cucumber-messages (~> 13.0, >= 13.0.1)
    cucumber-messages (13.1.0)
      protobuf-cucumber (~> 3.10, >= 3.10.8)
    cucumber-tag-expressions (2.0.4)
    cucumber-wire (4.0.1)
      cucumber-core (~> 8.0, >= 8.0.1)
      cucumber-cucumber-expressions (~> 10.3, >= 10.3.0)
      cucumber-messages (~> 13.0, >= 13.0.1)
    diff-lcs (1.4.4)
    eventmachine (1.2.7)
    faye-websocket (0.11.0)
      eventmachine (>= 0.12.0)
      websocket-driver (>= 0.5.1)
    ffi (1.13.1)
    fig_newton (1.0)
      yml_reader (>= 0.7)
    i18n (1.8.5)
      concurrent-ruby (~> 1.0)
    middleware (0.1.0)
    mini_portile2 (2.4.0)
    minitest (5.14.2)
    multi_test (0.1.2)
    nokogiri (1.10.10)
      mini_portile2 (~> 2.4.0)
    protobuf-cucumber (3.10.8)
      activesupport (>= 3.2)
      middleware
      thor
      thread_safe
    rake (13.0.1)
    rspec (3.9.0)
      rspec-core (~> 3.9.0)
      rspec-expectations (~> 3.9.0)
      rspec-mocks (~> 3.9.0)
    rspec-core (3.9.2)
      rspec-support (~> 3.9.3)
    rspec-expectations (3.9.2)
      diff-lcs (>= 1.2.0, < 2.0)
      rspec-support (~> 3.9.0)
    rspec-mocks (3.9.1)
      diff-lcs (>= 1.2.0, < 2.0)
      rspec-support (~> 3.9.0)
    rspec-support (3.9.3)
    rubyzip (2.3.0)
    selenium-webdriver (3.142.7)
      childprocess (>= 0.5, < 4.0)
      rubyzip (>= 1.2.2)
    sys-uname (1.2.1)
      ffi (>= 1.0.0)
    thor (1.0.1)
    thread_safe (0.3.6)
    tomlrb (1.3.0)
    tzinfo (1.2.7)
      thread_safe (~> 0.1)
    websocket-driver (0.7.3)
      websocket-extensions (>= 0.1.0)
    websocket-extensions (0.1.5)
    yml_reader (0.7)
    zeitwerk (2.4.0)

PLATFORMS
  ruby

DEPENDENCIES
  appium_flutter_finder
  appium_lib
  cucumber
  fig_newton
  rake
  rspec

BUNDLED WITH
   2.1.4
pablo-gonzalez commented 4 years ago

Hi @Reppinger It worked using the appium and driver version you informed. Now the issue is more tolerable.

Thank you very much for your support.

Trongk58d commented 3 years ago

Thank you @Reppinger for your clarification!

I have tried using the same capability you shared (check log below) but it is not working.

I think you are running on emulator too, right? Could you share your Appium and Ruby versions and gem list to check the differences please?

Thanks in advance

[Appium] Welcome to Appium v1.18.2
[Appium] Appium REST http interface listener started on 0.0.0.0:4723
[debug] [HTTP] Request idempotency key: 5880511b-9224-4aed-807c-76beb958499e
[HTTP] --> POST /wd/hub/session
[HTTP] {"desiredCapabilities":{"platformName":"Android","automationName":"Flutter","deviceName":"emulator-5554","app":"/Users/pablo.gonzalez/projects/my_app/build/app/outputs/flutter-apk/app-debug.apk","retryBackoffTime":10000},"capabilities":{"firstMatch":[{"platformName":"Android","appium:automationName":"Flutter","appium:deviceName":"emulator-5554","appium:app":"/Users/pablo.gonzalez/projects/my_app/build/app/outputs/flutter-apk/app-debug.apk","appium:retry_backoff_time":10000}]}}
[debug] [W3C] Calling AppiumDriver.createSession() with args: [{"platformName":"Android","automationName":"Flutter","deviceName":"emulator-5554","app":"/Users/pablo.gonzalez/projects/my_app/build/app/outputs/flutter-apk/app-debug.apk","retryBackoffTime":10000},null,{"firstMatch":[{"platformName":"Android","appium:automationName":"Flutter","appium:deviceName":"emulator-5554","appium:app":"/Users/pablo.gonzalez/projects/my_app/build/app/outputs/flutter-apk/app-debug.apk","appium:retry_backoff_time":10000}]}]
[debug] [BaseDriver] Event 'newSessionRequested' logged at 1601919961661 (14:46:01 GMT-0300 (GMT-03:00))
[Appium] The following capabilities were provided in the JSONWP desired capabilities that are missing in W3C capabilities: ["retryBackoffTime"]
[Appium] Trying to fix W3C capabilities by merging them with JSONWP caps
[BaseDriver] The following capabilities are not standard capabilities and should have an extension prefix:
[BaseDriver]   retryBackoffTime
[BaseDriver]   automationName
[BaseDriver]   deviceName
[BaseDriver]   app
[BaseDriver]   retry_backoff_time
[simctl] Appium Appium v1.18.2 creating new FlutterDriver (v0.0.23) session
[debug] [simctl] BaseDriver Creating session with MJSONWP desired capabilities: {
[debug] [simctl] BaseDriver   "platformName": "Android",
[debug] [simctl] BaseDriver   "automationName": "Flutter",
[debug] [simctl] BaseDriver   "deviceName": "emulator-5554",
[debug] [simctl] BaseDriver   "app": "/Users/pablo.gonzalez/projects/my_app/build/app/outputs/flutter-apk/app-debug.apk",
[debug] [simctl] BaseDriver   "retryBackoffTime": 10000
[debug] [simctl] BaseDriver }
[simctl] BaseDriver The following capabilities were provided, but are not recognized by Appium:
[simctl] BaseDriver   retryBackoffTime
[simctl] BaseDriver Session created with session id: 8ded6f23-acd4-4854-93fb-ab54bbeb1a7d
[simctl] FlutterDriver Starting an Android proxy session
[debug] [simctl] BaseDriver Creating session with MJSONWP desired capabilities: {
[debug] [simctl] BaseDriver   "platformName": "Android",
[debug] [simctl] BaseDriver   "automationName": "Flutter",
[debug] [simctl] BaseDriver   "deviceName": "emulator-5554",
[debug] [simctl] BaseDriver   "app": "/Users/pablo.gonzalez/projects/my_app/build/app/outputs/flutter-apk/app-debug.apk",
[debug] [simctl] BaseDriver   "retryBackoffTime": 10000,
[debug] [simctl] BaseDriver   "newCommandTimeout": 0
[debug] [simctl] BaseDriver }
[simctl] BaseDriver The following capabilities were provided, but are not recognized by Appium:
[simctl] BaseDriver   retryBackoffTime
[simctl] BaseDriver Session created with session id: bf0cf036-6efd-4aff-bdd5-4e38acf13045
[simctl] BaseDriver Using local app '/Users/pablo.gonzalez/projects/my_app/build/app/outputs/flutter-apk/app-debug.apk'
[debug] [simctl] UiAutomator2 Checking whether app is actually present
...
[simctl] FlutterDriver Attempt #1
[simctl] FlutterDriver Connecting to Dart Observatory: ws://127.0.0.1:33141/ORAT-h4wA70=/ws
[simctl] FlutterDriver Connected to ws://127.0.0.1:33141/ORAT-h4wA70=/ws
[simctl] FlutterDriver Listing all isolates: [{"type":"@Isolate","id":"isolates/1028156084125559","name":"main","number":"1028156084125559"}]
[simctl] FlutterDriver "ext.flutter.driver" is not found in "extensionRPCs" ["ext.ui.window.scheduleFrame","ext.dart.io.getHttpEnableTimelineLogging","ext.dart.io.setHttpEnableTimelineLogging","ext.dart.io.getSocketProfile","ext.dart.io.startSocketProfiling","ext.dart.io.pauseSocketProfiling","ext.dart.io.clearSocketProfile","ext.dart.io.getVersion"]
[simctl] FlutterDriver Waiting 300 seconds before trying...

i have same issue with You, have any update for this issue?

Trongk58d commented 3 years ago

Thank you @Reppinger for your clarification! I have tried using the same capability you shared (check log below) but it is not working. I think you are running on emulator too, right? Could you share your Appium and Ruby versions and gem list to check the differences please? Thanks in advance

[Appium] Welcome to Appium v1.18.2
[Appium] Appium REST http interface listener started on 0.0.0.0:4723
[debug] [HTTP] Request idempotency key: 5880511b-9224-4aed-807c-76beb958499e
[HTTP] --> POST /wd/hub/session
[HTTP] {"desiredCapabilities":{"platformName":"Android","automationName":"Flutter","deviceName":"emulator-5554","app":"/Users/pablo.gonzalez/projects/my_app/build/app/outputs/flutter-apk/app-debug.apk","retryBackoffTime":10000},"capabilities":{"firstMatch":[{"platformName":"Android","appium:automationName":"Flutter","appium:deviceName":"emulator-5554","appium:app":"/Users/pablo.gonzalez/projects/my_app/build/app/outputs/flutter-apk/app-debug.apk","appium:retry_backoff_time":10000}]}}
[debug] [W3C] Calling AppiumDriver.createSession() with args: [{"platformName":"Android","automationName":"Flutter","deviceName":"emulator-5554","app":"/Users/pablo.gonzalez/projects/my_app/build/app/outputs/flutter-apk/app-debug.apk","retryBackoffTime":10000},null,{"firstMatch":[{"platformName":"Android","appium:automationName":"Flutter","appium:deviceName":"emulator-5554","appium:app":"/Users/pablo.gonzalez/projects/my_app/build/app/outputs/flutter-apk/app-debug.apk","appium:retry_backoff_time":10000}]}]
[debug] [BaseDriver] Event 'newSessionRequested' logged at 1601919961661 (14:46:01 GMT-0300 (GMT-03:00))
[Appium] The following capabilities were provided in the JSONWP desired capabilities that are missing in W3C capabilities: ["retryBackoffTime"]
[Appium] Trying to fix W3C capabilities by merging them with JSONWP caps
[BaseDriver] The following capabilities are not standard capabilities and should have an extension prefix:
[BaseDriver]   retryBackoffTime
[BaseDriver]   automationName
[BaseDriver]   deviceName
[BaseDriver]   app
[BaseDriver]   retry_backoff_time
[simctl] Appium Appium v1.18.2 creating new FlutterDriver (v0.0.23) session
[debug] [simctl] BaseDriver Creating session with MJSONWP desired capabilities: {
[debug] [simctl] BaseDriver   "platformName": "Android",
[debug] [simctl] BaseDriver   "automationName": "Flutter",
[debug] [simctl] BaseDriver   "deviceName": "emulator-5554",
[debug] [simctl] BaseDriver   "app": "/Users/pablo.gonzalez/projects/my_app/build/app/outputs/flutter-apk/app-debug.apk",
[debug] [simctl] BaseDriver   "retryBackoffTime": 10000
[debug] [simctl] BaseDriver }
[simctl] BaseDriver The following capabilities were provided, but are not recognized by Appium:
[simctl] BaseDriver   retryBackoffTime
[simctl] BaseDriver Session created with session id: 8ded6f23-acd4-4854-93fb-ab54bbeb1a7d
[simctl] FlutterDriver Starting an Android proxy session
[debug] [simctl] BaseDriver Creating session with MJSONWP desired capabilities: {
[debug] [simctl] BaseDriver   "platformName": "Android",
[debug] [simctl] BaseDriver   "automationName": "Flutter",
[debug] [simctl] BaseDriver   "deviceName": "emulator-5554",
[debug] [simctl] BaseDriver   "app": "/Users/pablo.gonzalez/projects/my_app/build/app/outputs/flutter-apk/app-debug.apk",
[debug] [simctl] BaseDriver   "retryBackoffTime": 10000,
[debug] [simctl] BaseDriver   "newCommandTimeout": 0
[debug] [simctl] BaseDriver }
[simctl] BaseDriver The following capabilities were provided, but are not recognized by Appium:
[simctl] BaseDriver   retryBackoffTime
[simctl] BaseDriver Session created with session id: bf0cf036-6efd-4aff-bdd5-4e38acf13045
[simctl] BaseDriver Using local app '/Users/pablo.gonzalez/projects/my_app/build/app/outputs/flutter-apk/app-debug.apk'
[debug] [simctl] UiAutomator2 Checking whether app is actually present
...
[simctl] FlutterDriver Attempt #1
[simctl] FlutterDriver Connecting to Dart Observatory: ws://127.0.0.1:33141/ORAT-h4wA70=/ws
[simctl] FlutterDriver Connected to ws://127.0.0.1:33141/ORAT-h4wA70=/ws
[simctl] FlutterDriver Listing all isolates: [{"type":"@Isolate","id":"isolates/1028156084125559","name":"main","number":"1028156084125559"}]
[simctl] FlutterDriver "ext.flutter.driver" is not found in "extensionRPCs" ["ext.ui.window.scheduleFrame","ext.dart.io.getHttpEnableTimelineLogging","ext.dart.io.setHttpEnableTimelineLogging","ext.dart.io.getSocketProfile","ext.dart.io.startSocketProfiling","ext.dart.io.pauseSocketProfiling","ext.dart.io.clearSocketProfile","ext.dart.io.getVersion"]
[simctl] FlutterDriver Waiting 300 seconds before trying...

i have same issue with You, have any update for this issue?

sometimes i run success, but not much, error happens more regularly!

Reppinger commented 3 years ago

@Trongk58d I am still running appium@1.19.0-beta.0 and the related appium-flutter-driver as seen below:

npm list -g appium-flutter-driver
/usr/local/lib
└─┬ appium@1.19.0-beta.0
  └── appium-flutter-driver@0.0.25 

I have since shortened the retry time in my configuration to: retry_backoff_time: 2000 #2 seconds For me, it almost always works on Attempt 2.

I still get the failed attempt quite often, too.