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

Adds Flutter Template #275

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open

Conversation

alberrizwan
Copy link

This is draft release of Flutter template.
Please note:
To manually attach to the device for debugging, follow these steps:

  1. SSH into the device and run docker logs .
  2. Find the Observatory URL in the logs.
  3. Open another SSH terminal and set up port forwarding using this command: ssh -L port:127.0.0.1:port user@deviceIP, where port corresponds to the one in the Observatory URL.
  4. Once port forwarding is established, open the Observatory URL in a web browser.
  5. You can now start debugging using the web debugger.

Signed-off-by: alber.rizwan@crossware.io

##
# Build/Deploy Step
##
FROM crossware.app:5050/toradex/flutter:${SDK_BASE_VERSION} as build
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @alberrizwan,
Sorry for taking a bit of time to the PR review, we are on the process of a new major release of Torizon (Torizon 7).
I created a project form the template and tried to build it, but fell into the following issue:

 *  Executing task: DOCKER_HOST= docker compose build --pull --build-arg SSHUSERNAME=torizon --build-arg APP_ROOT=/home/torizon/app --build-arg IMAGE_ARCH=arm64 --build-arg DEBUG_SSH_PORT= --build-arg GPU=-vivante testflutter-debug 

WARN[0000] The "DOCKER_LOGIN" variable is not set. Defaulting to a blank string. 
WARN[0000] /home/andreriesco/Documents/IDE2.0/test-applications/testFlutter/docker-compose.yml: the attribute `version` is obsolete, it will be ignored, please remove it to avoid potential confusion 
[+] Building 2.6s (3/3) FINISHED                                        docker-container:sharp_murdock
 => [testflutter-debug internal] load build definition from Dockerfile.debug                      0.3s
 => => transferring dockerfile: 1.23kB                                                            0.0s
 => WARN: FromAsCasing: 'as' and 'FROM' keywords' casing do not match (line 26)                   0.3s
 => WARN: FromAsCasing: 'as' and 'FROM' keywords' casing do not match (line 36)                   0.3s
 => ERROR [testflutter-debug internal] load metadata for crossware.app:5050/toradex/flutter:runt  2.1s
 => CANCELED [testflutter-debug internal] load metadata for crossware.app:5050/toradex/flutter:e  2.1s
------
 > [testflutter-debug internal] load metadata for crossware.app:5050/toradex/flutter:runtime_debug:
------
failed to solve: crossware.app:5050/toradex/flutter:runtime_debug: failed to resolve source metadata for crossware.app:5050/toradex/flutter:runtime_debug: failed to authorize: failed to fetch anonymous token: unexpected status from GET request to https://crossware.app/jwt/auth?scope=repository%3Atoradex%2Fflutter%3Apull&service=container_registry: 403 Forbidden

 *  The terminal process "/usr/bin/bash '-c', 'DOCKER_HOST= docker compose build --pull --build-arg SSHUSERNAME=torizon --build-arg APP_ROOT=/home/torizon/app --build-arg IMAGE_ARCH=arm64 --build-arg DEBUG_SSH_PORT= --build-arg GPU=-vivante testflutter-debug'" terminated with exit code: 17. 
 *  Terminal will be reused by tasks, press any key to close it. 

It seems that the base container is not publicly available.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @alberrizwan,
Any updates on this issue?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @andreriesco,
Sorry for the delayed response, I have made the requested changes please check and let us know if any more changes are required.

Copy link
Collaborator

@andreriesco andreriesco Jan 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @alberrizwan,
Thanks, now I was able to get the base images and run the application.
But I have an issue to debug the application. I followed the steps do debug it, but I am falling into the following error:

$ dart devtools http://127.0.0.1:43739/k8IUol2dnPI=/
WebSocketException: Connection to 'http://127.0.0.1:43739/k8IUol2dnPI=/ws#' was not upgraded to websocket, HTTP status code: 403
#0      _WebSocketImpl.connect (dart:_http/websocket_impl.dart:1011:41)
#1      WebSocket.connect (dart:_http/websocket.dart:320:22)
#2      vmServiceConnectUriWithFactory (package:vm_service/vm_service_io.dart:26:44)
#3      vmServiceConnectUri (package:vm_service/vm_service_io.dart:12:10)
#4      DevToolsCommand.maybeStartDDS (package:dartdev/src/commands/devtools.dart:192:29)
#5      DevToolsCommand._performDDSCheck (package:dartdev/src/commands/devtools.dart:106:19)
<asynchronous suspension>
#6      DevToolsCommand.run (package:dartdev/src/commands/devtools.dart:57:21)
<asynchronous suspension>
#7      CommandRunner.runCommand (package:args/command_runner.dart:212:13)
<asynchronous suspension>
#8      DartdevRunner.runCommand (package:dartdev/dartdev.dart:240:18)
<asynchronous suspension>
#9      runDartdev (package:dartdev/dartdev.dart:47:16)
<asynchronous suspension>
#10     main (file:///b/s/w/ir/x/w/sdk/pkg/dartdev/bin/dartdev.dart:13:5)
<asynchronous suspension>

And even if I try to disable-service-auth-codes (and also set a fixed port, as explained in this article), I still get an error (but with error code 200):

dart devtools http://127.0.0.1:12345/k8IUol2dnPI=/
WebSocketException: Connection to 'http://127.0.0.1:12345/k8IUol2dnPI=/ws#' was not upgraded to websocket, HTTP status code: 200
#0      _WebSocketImpl.connect (dart:_http/websocket_impl.dart:1011:41)
#1      WebSocket.connect (dart:_http/websocket.dart:320:22)
#2      vmServiceConnectUriWithFactory (package:vm_service/vm_service_io.dart:26:44)
#3      vmServiceConnectUri (package:vm_service/vm_service_io.dart:12:10)
#4      DevToolsCommand.maybeStartDDS (package:dartdev/src/commands/devtools.dart:192:29)
#5      DevToolsCommand._performDDSCheck (package:dartdev/src/commands/devtools.dart:106:19)
<asynchronous suspension>
#6      DevToolsCommand.run (package:dartdev/src/commands/devtools.dart:57:21)
<asynchronous suspension>
#7      CommandRunner.runCommand (package:args/command_runner.dart:212:13)
<asynchronous suspension>
#8      DartdevRunner.runCommand (package:dartdev/dartdev.dart:240:18)
<asynchronous suspension>
#9      runDartdev (package:dartdev/dartdev.dart:47:16)
<asynchronous suspension>
#10     main (file:///b/s/w/ir/x/w/sdk/pkg/dartdev/bin/dartdev.dart:13:5)
<asynchronous suspension>

Do you know what may be possible issue?

@microhobby microhobby force-pushed the dev branch 22 times, most recently from 97f62c0 to e169b0e Compare January 16, 2025 02:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants