appium-flutter-driver icon indicating copy to clipboard operation
appium-flutter-driver copied to clipboard

Observatory URL Issue

Open AnasAR004 opened this issue 2 years ago • 9 comments

Flutter App in Profile mode Error - No observatory URL matching to '/(Observatory listening on |An Observatory debugger and profiler on\s.+\sis available at: |The Dart VM service is listening on )((http|//)[a-zA-Z0-9:/=_-.[]]+)/' was found in the device log. Please make sure the application under test is configured properly according to https://github.com/appium-userland/appium-flutter-driver#usage and that it does not crash on startup. Appium Server Log.txt

AnasAR004 avatar Nov 09 '23 06:11 AnasAR004

Did the observatory url present on the system log/adb log?

KazuCocoa avatar Nov 12 '23 00:11 KazuCocoa

I am getting below error log in the appium server. [FlutterDriver@6b59 (6c09ecef)] Deleting Flutter Driver session [AppiumDriver@29c0] Event 'newSessionStarted' logged at 1700029668367 (11:57:48 GMT+0530 (India Standard Time)) [AppiumDriver@29c0] Encountered internal error running command: Error: Cannot connect to the Dart Observatory URL ws://127.0.0.1:37623/bYaW_PnSDv0=/ws after 10 retries. Check the server log for more details [AppiumDriver@29c0] at connectSocket (C:\Users\Mozanta.appium\node_modules\appium-flutter-driver\lib\sessions\observatory.ts:155:9) [AppiumDriver@29c0] at processTicksAndRejections (node:internal/process/task_queues:95:5) [AppiumDriver@29c0] at startAndroidSession (C:\Users\Mozanta.appium\node_modules\appium-flutter-driver\lib\sessions\android.ts:31:5) [AppiumDriver@29c0] at FlutterDriver.createSession (C:\Users\Mozanta.appium\node_modules\appium-flutter-driver\lib\sessions\session.ts:40:45) [AppiumDriver@29c0] at AppiumDriver.createSession (C:\Users\Mozanta\AppData\Roaming\npm\node_modules\appium\lib\appium.js:374:35) [HTTP] <-- POST /session 500 38189 ms - 840

AnasAR004 avatar Nov 15 '23 06:11 AnasAR004

Was the url actually the app was listening? Could you share the full log as GIST?

KazuCocoa avatar Nov 24 '23 09:11 KazuCocoa

https://gist.github.com/AnasAR004/f3f72435a803b22faf724eb4efc83cdc

AnasAR004 avatar Nov 24 '23 10:11 AnasAR004

Full log shared in the above GIST

AnasAR004 avatar Nov 24 '23 10:11 AnasAR004

[FlutterDriver] Attempt #1 of 10
[ADB] Forwarding system: 45215 to device: 45215
[ADB] Running 'C:\Users\Mozanta\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 forward tcp:45215 tcp:45215'
[FlutterDriver] Connecting to Dart Observatory: ws://127.0.0.1:45215/3G_iPlgCAzs=/ws
[FlutterDriver] Listing all isolates: [{"type":"@Isolate","id":"isolates/8737269449733095","name":"main","number":"8737269449733095","isSystemIsolate":false,"isolateGroupId":"isolateGroups/3847973082439928"}]
[FlutterDriver] "ext.flutter.driver" is not found in "extensionRPCs" ["ext.ui.window.scheduleFrame","ext.ui.window.reinitializeShader","ext.ui.window.impellerEnabled","ext.dart.io.getHttpEnableTimelineLogging","ext.dart.io.setHttpEnableTimelineLogging","ext.dart.io.httpEnableTimelineLogging","ext.dart.io.getSocketProfile","ext.dart.io.startSocketProfiling","ext.dart.io.pauseSocketProfiling","ext.dart.io.socketProfilingEnabled","ext.dart.io.clearSocketProfile","ext.dart.io.getVersion","ext.dart.io.getHttpProfile","ext.dart.io.getHttpProfileRequest","ext.dart.io.clearHttpProfile"]
[FlutterDriver] Waiting 3000ms before retrying

Probably you haven't done https://github.com/appium/appium-flutter-driver?tab=readme-ov-file#usage-and-requirement especially adding flutter_driver dependency

KazuCocoa avatar Nov 24 '23 21:11 KazuCocoa

yaml

AnasAR004 avatar Nov 30 '23 09:11 AnasAR004

we have added the same but still the same issue is shown

AnasAR004 avatar Nov 30 '23 09:11 AnasAR004

Hm, then I have no idea.

Usually, an error below indicates the flutter_driver dependencies are not in the app package. Then, adding the flutter_driver deps and enableFlutterDriverExtension usually can resolve that. The integration test dependency only could cause the error afaik.

"ext.flutter.driver" is not found in "extensionRPCs" ["ext.ui.window.scheduleFrame","ext.ui.window.reinitializeShader","ext.ui.window.impellerEnabled","ext.dart.io.getHttpEnableTimelineLogging","ext.dart.io.setHttpEnableTimelineLogging","ext.dart.io.httpEnableTimelineLogging","ext.dart.io.getSocketProfile","ext.dart.io.startSocketProfiling","ext.dart.io.pauseSocketProfiling","ext.dart.io.socketProfilingEnabled","ext.dart.io.clearSocketProfile","ext.dart.io.getVersion","ext.dart.io.getHttpProfile","ext.dart.io.getHttpProfileRequest","ext.dart.io.clearHttpProfile"]

I heard that if multiple views were managed by different package, one package could include ext.flutter.driver with the flutter_driver dependency, but another one was not. Such complicated situation could happen as another possible case.

KazuCocoa avatar Dec 01 '23 09:12 KazuCocoa

I found this "ext.flutter.driver" content load could take time. https://github.com/appium/appium-flutter-driver/pull/792 will improve the initial check.

KazuCocoa avatar Apr 29 '25 08:04 KazuCocoa