bernardpumped / ped

Flutter in-vehicle Fuel Station app
GNU General Public License v3.0
1 stars 1 forks source link

ivi-homescreen support #6

Closed jwinarske closed 9 months ago

jwinarske commented 2 years ago

I was looking to add a recipe for this app to meta-agl-flutter. Looks like it will only run on web right now.

[ERROR:flutter/lib/ui/ui_dart_state.cc(198)] Unhandled Exception: Unsupported operation: DefaultFirebaseOptions have not been configured for linux - you can reconfigure this by running the FlutterFire CLI again.
#0      DefaultFirebaseOptions.currentPlatform (package:pumped_end_device/firebase_options.dart:38:9)
#1      main (package:pumped_end_device/main.dart:72:37)
#2      _runMainZoned.<anonymous closure>.<anonymous closure> (dart:ui/hooks.dart:130:25)
#3      _rootRun (dart:async/zone.dart:1426:13)
#4      _CustomZone.run (dart:async/zone.dart:1328:19)
#5      _runZoned (dart:async/zone.dart:1861:10)
#6      runZonedGuarded (dart:async/zone.dart:1849:12)
#7      _runMainZoned.<anonymous closure> (dart:ui/hooks.dart:126:5)
#8      _delayEntrypointInvocation.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:297:19)
#9      _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:192:12)

Can we get this app into a state that builds and runs on Linux? Then after which I will implement recipe for AGL.

For secure storage you want: https://pub.dev/packages/flutter_secure_storage ivi-homescreen has default support for the native side of flutter_secure_storage.

Cheers, Joel

jwinarske commented 9 months ago

AGL is currently at 3.13.9. Stable is currently at 3.16.x After CES I will move AGL to 3.16.x

bernardcraddock commented 9 months ago

excellent thankyou

3.13.x broke our custom design of TextScaler textScaleFactor that's why PED -b agl does not work in workspace-automation -b main. Note It did work in -b jw/impeller_gl using impeller but flutter main is too wild for me

Have now written a pedTextScaler workaround in 3.16 that's working ok and will start pushing to other branches over the weekend We have a new improved Scaling design in mind using new widgets etc, will implement later

regards

Bernard Craddock Co-founder Pumped Fuel www.pumpedfuel.com L2, 11 York Street Sydney 2000

On Fri, Dec 8, 2023 at 11:00 AM Joel Winarske @.***> wrote:

AGL is currently at 3.13.9. Stable is currently at 3.16.x After CES I will move AGL to 3.16.x

— Reply to this email directly, view it on GitHub https://github.com/bernardpumped/ped/issues/6#issuecomment-1846288275, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABCJ6O3VMEIBQ33JBOBIN7LYIJKC5AVCNFSM5YK3XEAKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOBUGYZDQOBSG42Q . You are receiving this because you were mentioned.Message ID: @.***>

bernardcraddock commented 9 months ago

@jwinarske

Oh yes please I'm very excited at the possibility you may show PED at CES as a Firebase example and between now and then will do whatever it takes to make that happen.

I'm also a little confused perhaps you can advise.

  1. main is portrait specifically designed for handhelds we've restricted firebase configuration to android and ios
  2. in its current state main won't run on Linux-desktop.
  3. If you still want to demo main it needs to be android as we're still registering ios on Apple's side
  4. I assume you're aware of the build changes you need to make for firebase as per README. If not just search for YOUR

Other

  1. We're very close to releasing a new drop that includes firebase changes that when done I'll push to PED -b next_main (early next week) that when passes all tests will merge too main and then will freeze main so use that.
  2. This drop we're also planning to be our initial Play Store worldwide developers release. So would be great if during demo you can mention so anyone interested can download.
  3. We will release on the App Store just as soon as we can.
  4. Once you have firebase sorted in meta-flutter, I'll configure same in the PED IVI branches including AGL
  5. Lastly, I'm looking at integrating generative AI in PED "ai journey concierge" and have written a couple of draft documents you may find interesting and happy to share if you're interested a) pitch deck, b) Architecture design.

regards

bernardcraddock commented 9 months ago

@jwinarske
@jwinarske referring above Main Plugin status nice to see you're extending homescreen and linux-gtk to support these plugins and in next drop we're adding firebase_crashlytics which is super helpful.

jwinarske commented 9 months ago

Crashalytics is not supported on Linux in any format. Sentry is supported on ivi-homescreen. It uses the sentry-native library found on GitHub. Essentially a Crashpad port that connects to sentry.io's backend. Sentry has two tiers, one is free.

For the firebase stuff in options return android when platform.linux. No other change should be required. It works in flutter-desktop today. Will be adding to ivi-homescreen soon.

I'm not supporting linux-gtk for any plugins at this time.

jwinarske commented 9 months ago

For main I was thinking it could be common for all platforms. That would require some refactoring on your end.

For location on Linux use the geoclue plug-in. https://pub.dev/packages/geoclue

bernardcraddock commented 9 months ago

@jwinarske -

My original intention was main would be common for all platforms, but it proved very difficult ensuring both Portrait and Landscape looked good using material. At the time General consensus was that IVI would/should be landscape.

So, I instead created portrait and landscape branches.

  1. Portrait -b main / next_main, android and ios includes firebase.
  2. Landscape -b agl / ivi_, linux-desktop, hopefully AGL - firebase not officially supported on Linux

I am so caught up with Google and Apple getting ped published, but as soon as that is done, I'd really appreciate your help getting -b agl released to AGL on ivi-homescreen with sentry, geoclue and whatever else is important for demo

jwinarske commented 8 months ago

Following up here.

I have an internal branch that implements a desktop registrar. I have the following plugins ported:

The way one uses firebase with ivi-homescreen in my upcoming release is to change firebase options to return type of "android" when it is linux. This works for all the associated firebase functional test cases as well as for the Super Dash game.

next_main:

diff --git a/lib/firebase_options.dart b/lib/firebase_options.dart
index 00c12d7..3e779ef 100644
--- a/lib/firebase_options.dart
+++ b/lib/firebase_options.dart
@@ -24,6 +24,7 @@ class DefaultFirebaseOptions {
     }
     switch (defaultTargetPlatform) {
       case TargetPlatform.android:
+      case TargetPlatform.linux:
         return android;
       case TargetPlatform.iOS:
         return ios;
@@ -37,11 +38,6 @@ class DefaultFirebaseOptions {
           'DefaultFirebaseOptions have not been configured for windows - '
           'you can reconfigure this by running the FlutterFire CLI again.',
         );
-      case TargetPlatform.linux:
-        throw UnsupportedError(
-          'DefaultFirebaseOptions have not been configured for linux - '
-          'you can reconfigure this by running the FlutterFire CLI again.',
-        );
       default:
         throw UnsupportedError(
           'DefaultFirebaseOptions are not supported for this platform.',
jwinarske commented 8 months ago

@bernardcraddock

Running next_main with above change on my internal branch and not updating firebase credentials I see:

DEBUG: Creating Firebase App [DEFAULT] for Firebase C++ 11.6.0
DEBUG: Validating semaphore creation.
DEBUG: Added app name=[DEFAULT]: options, api_key=YOUR_android_apiKey, app_id=YOUR_android_appId, database_url=, messaging_sender_id=YOUR_messagingSenderId, storage_bucket=YOUR_storageBucket, project_id=YOUR_projectId (0x98007000)
[17:45:41.934168] [D] [secure_storage] read
[17:45:41.934180] [D] secure_storage: [Read] key: ped_ui_settings_coll-ped_ui_settings
[17:45:41.948478] [I] [2024-01-03 17:45:41.930963]: DEBUG: UiSettingsDao : Retrieving SecureStorage instance of UiSettings
[17:45:41.980603] [I] [2024-01-03 17:45:41.964650]: DEBUG: PumpedApp : Registering instance of geoLocationWrapper
[17:45:41.980612] [I] [2024-01-03 17:45:41.965869]: DEBUG: PumpedApp : Registering instance of locationDataSource
[17:45:41.980615] [I] [2024-01-03 17:45:41.966460]: DEBUG: PumpedApp : Registering instance of firebaseService
[17:45:41.980619] [I] [2024-01-03 17:45:41.967086]: DEBUG: FirebaseService : platformSupport is null
[17:45:41.980622] [I] [2024-01-03 17:45:41.967111]: DEBUG: FirebaseService : Platform does not yet support firebase
[17:45:41.980626] [I] [2024-01-03 17:45:41.967143]: DEBUG: PumpedApp : Registering instance of underMaintenanceService
[17:45:41.980629] [I] [2024-01-03 17:45:41.971466]: DEBUG: main : Value of textScale found as 1.0
[17:45:42.039060] [D] selectSingleEntryHistory
[17:45:42.049500] [I] [go_router] Route Information Updated
    uri: / 
    replace: false
[17:45:42.240516] [D] (0) SetWindowSize: width=800, height=600, pixel_ratio=1
[17:45:42.240556] [I] [2024-01-03 17:45:42.227064]: DEBUG: PumpedApp : {name: Fedora Linux, version: 39 (Workstation Edition), id: fedora, idLike: null, versionCodename: , versionId: 39, prettyName: Fedora Linux 39 (Workstation Edition), buildId: null, variant: Workstation Edition, variantId: workstation, machineId: 4aa152898c774426807777c2ceeba836}
WARNING: WatchStream (7fff280373f8) Stream error: 'Permission denied: Permission denied on resource project YOUR_projectId.'
WARNING: Could not reach Cloud Firestore backend. Connection failed 1 times. Most recent error: Permission denied on resource project YOUR_projectId.
 This typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.
[17:45:42.243514] [D] [secure_storage] read
[17:45:42.243529] [D] secure_storage: [Read] key: ped_ui_settings_coll-ped_ui_settings
[17:45:42.253638] [I] [2024-01-03 17:45:42.242824]: DEBUG: SplashScreen : Error happened in querying Firestore [cloud_firestore/unavailable] Failed to get document because the client is offline., still making attempt
[17:45:42.253646] [I] [2024-01-03 17:45:42.243397]: DEBUG: UiSettingsDao : Retrieving SecureStorage instance of UiSettings
[17:45:42.253649] [I] [2024-01-03 17:45:42.244257]: DEBUG: LocationDataSource : Developer Options not turned on
[17:45:42.253653] [I] [2024-01-03 17:45:42.244276]: DEBUG: LocationDataSource : Checking Location Service Enabled
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: MissingPluginException(No implementation found for method isLocationServiceEnabled on channel flutter.baseflow.com/geolocator)
#0      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:320:7)
<asynchronous suspension>
#1      MethodChannelGeolocator.isLocationServiceEnabled.<anonymous closure> (package:geolocator_platform_interface/src/implementations/method_channel_geolocator.dart:70:13)
<asynchronous suspension>
#2      LocationDataSource.getLocationData (package:pumped_end_device/data/local/location/location_data_source.dart:56:27)
<asynchronous suspension>
#3      _SplashScreenState._getLocationFromOnDeviceLocationService.<anonymous closure> (package:pumped_end_device/user-interface/splash/screen/splash_screen.dart:167:32)
<asynchronous suspension>

[17:45:42.269728] [I] [2024-01-03 17:45:42.258224]: DEBUG: SplashScreen : Error happened in querying Firestore [cloud_firestore/unavailable] Failed to get document because the client is offline., still making attempt
WARNING: WatchStream (7fff280373f8) Stream error: 'Permission denied: Permission denied on resource project YOUR_projectId.'

If next_main implements geoclue for the linux platform it should then just work work provided the credentials were plugged in. If you want to make that change and create a sandbox set of credentials I can test further. If it works I will show as one of the apps at my station on the CES floor.

Screenshot from 2024-01-03 17-56-23

jwinarske commented 8 months ago

@bernardcraddock I take that back the tip of tree flutter-geolocator functional test case (example) is working on my branch. It requires creating a file: ~/.config/flutter/dconf/user

I added contents of:

user-db:user
system-db:local
system-db:ibus
jwinarske commented 8 months ago

I copied latest geolocator linux release to local filesystem then modified pubspec.yaml:

diff --git a/pubspec.yaml b/pubspec.yaml
index d2f1a3a..537145c 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -34,7 +34,10 @@ dependencies:
   flutter_signin_button: ^2.0.0
   flutter_svg: ^2.0.9
   fluttertoast: ^8.2.1
-  geolocator: ^10.1.0
+  geolocator:
+    path: geolocator_linux_v0.2.0-1/geolocator
+  geolocator_linux:
+    path: geolocator_linux_v0.2.0-1/geolocator_linux
   get_it: ^7.2.0
   google_sign_in: ^6.1.6
   http: ^1.1.0

Screenshot from 2024-01-04 08-15-00

https://github.com/Baseflow/flutter-geolocator/tags

next_main

jwinarske commented 8 months ago

I got it. I created an Android Firebase app, and then pinned to Fishburners. No errors in the log. Good to go! Screenshot from 2024-01-04 11-38-43

jwinarske commented 8 months ago

Only remaining issue is to get firebase-cpp-sdk to cross compile for aarch64. That's not supported today

jwinarske commented 8 months ago

Added recipe back in for next_main: https://github.com/meta-flutter/meta-flutter/blob/kirkstone/recipes-graphics/flutter-apps/pumpedfuel-ped_git.bb

bernardcraddock commented 8 months ago

@jwinarske - sorry for late reply been away on family matters.

thank you for researching this, I was very pleasantly surprised this morning and please give me some time to come up to speed, as I need to ensure I don't break anything else. I'm still battling with Apple and then need to do some pumped AWS backend stuff so may take a little while before I circle back to this. If you can showcase your branch that is working at CES that would be awesome

Also, back in Nov on jw/impller_gl branch you added commit "Add missing packages" which enables libsecret and secure storage as part of ivi-homescreen make which worked fine, however I stopped using jw/impller_gl as it's too unstable for me and I switched back to main.

Therefore, can you please merge that commit back into main so as my AGL and ivi_secure_storage branches (hardcoded location) work in main branch, instead of just failing.

regards

jwinarske commented 8 months ago

My work will be released early February. We have to circle back on unit tests, and test the current very large test matrix.

Today after porting the 11.6.0 firebase packages I am seeing. Not sure if it's you or me.

/home/joel/ivi-homescreen/cmake-build-debug-clang/shell/homescreen --b=/home/joel/workspace-automation/app/ped/.desktop-homescreen --w=1280 --h=980
[21:42:51.205986] [I] jw/registrar @ 10b2cea
[21:42:51.206017] [I] **********
[21:42:51.206019] [I] * Global *
[21:42:51.206022] [I] **********
[21:42:51.206024] [I] Application Id: .......... homescreen
[21:42:51.206027] [I] Disable Cursor: .......... false
[21:42:51.206030] [I] Debug Backend: ........... false
[21:42:51.206033] [I] ********
[21:42:51.206035] [I] * View *
[21:42:51.206036] [I] ********
[21:42:51.206039] [I] Bundle Path: .............. /home/joel/workspace-automation/app/ped/.desktop-homescreen
[21:42:51.206043] [I] Window Type: .............. NORMAL
[21:42:51.206058] [I] Output Index: ............. 0
[21:42:51.206063] [I] Size: ..................... 1280 x 980
[21:42:51.206067] [I] Fullscreen: ............... false
[21:42:51.206071] [I] Accessibility Features: ... 0
[21:42:51.456019] [I] Pointer Present
[21:42:51.456033] [I] Keyboard Present
[21:42:51.498155] [I] (0) Runtime=debug
DEBUG: Creating Firebase App [DEFAULT] for Firebase C++ 11.6.0
DEBUG: Validating semaphore creation.
DEBUG: Added app name=[DEFAULT]: options, api_key=xxxxxxxxxxxxxxxxxxxxxxxxxxxx, app_id=xxxxxxxxxxxxxxxxxxx, database_url=, messaging_sender_id=xxxx, storage_bucket=xxxx, project_id=ivi-homescreen (0x88007230)
[21:42:51.838756] [I] [go_router] Route Information Updated
    uri: / 
    replace: false
WARNING: Listen for query at pumped-documents/under-maintenance failed: Missing or insufficient permissions.
WARNING: Listen for query at pumped-documents/under-maintenance failed: Missing or insufficient permissions.
WARNING: Listen for query at pumped-documents/under-maintenance failed: Missing or insufficient permissions.
WARNING: Listen for query at pumped-documents/under-maintenance failed: Missing or insufficient permissions.
WARNING: Listen for query at pumped-documents/under-maintenance failed: Missing or insufficient permissions.
[21:43:03.834011] [I] [go_router] Route Information Updated
    uri: /ped/fuel-stations/nearby  
    replace: false
WARNING: Listen for query at pumped-documents/under-maintenance failed: Missing or insufficient permissions.
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: [cloud_firestore/permission-denied] Missing or insufficient permissions.
#0      EventChannelExtension.receiveGuardedBroadcastStream (package:_flutterfire_internals/src/exception.dart:67:43)
#1      MethodChannelDocumentReference.snapshots.<anonymous closure> (package:cloud_firestore_platform_interface/src/method_channel/method_channel_document_reference.dart:132:18)
<asynchronous suspension>

[21:43:11.938957] [I] [go_router] Route Information Updated
    uri: /ped/settings 
    replace: false
WARNING: Listen for query at pumped-documents/under-maintenance failed: Missing or insufficient permissions.
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: [cloud_firestore/permission-denied] Missing or insufficient permissions.
#0      EventChannelExtension.receiveGuardedBroadcastStream (package:_flutterfire_internals/src/exception.dart:67:43)
#1      MethodChannelDocumentReference.snapshots.<anonymous closure> (package:cloud_firestore_platform_interface/src/method_channel/method_channel_document_reference.dart:132:18)
<asynchronous suspension>

[21:43:17.586435] [I] [go_router] Route Information Updated
    uri: /ped/settings/mocklocation 
    replace: false
[21:43:27.140698] [I] [go_router] Route Information Updated
    uri: /ped/settings 
    replace: false
[21:43:29.492346] [I] [go_router] Route Information Updated
    uri: /ped/fuel-stations/nearby 
    replace: false
WARNING: Listen for query at pumped-documents/under-maintenance failed: Missing or insufficient permissions.
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: [cloud_firestore/permission-denied] Missing or insufficient permissions.
#0      EventChannelExtension.receiveGuardedBroadcastStream (package:_flutterfire_internals/src/exception.dart:67:43)
#1      MethodChannelDocumentReference.snapshots.<anonymous closure> (package:cloud_firestore_platform_interface/src/method_channel/method_channel_document_reference.dart:132:18)
<asynchronous suspension>
bernardcraddock commented 8 months ago

@jwinarske, I haven't touched next_main so suspect issue is yours

Concerning ivi_secure_storage and agl branches I just now manually updated configs/desktop-homescreen.json on my local in main to include the libsecret and -DBUILD_PLUGIN_SECURE_STORAGE changes you did, deleted ped and ivi-homescreen then

flutter_workspace.py --flutter-version=3.16.5 source ./setup_env.sh cd app/ped flutter run -d desktop-homescreen

and both branches working fine just switch branch in app/ped, i even tried ivi_localstore also working fine. if you can confirm, demo this, and let them know we'll soon have it working with firebase next_main or other?

wa-vm > git branch

wa-vm > git checkout ivi_localstore Switched to branch 'ivi_localstore' Your branch is up to date with 'origin/ivi_localstore'.

I'm happy to stick around if you need more input from me, to get this working - happy to have Googe Hangout if you want.

bernardcraddock commented 8 months ago

wa-vm > gitd configs/desktop-homescreen.json diff --git a/configs/desktop-homescreen.json b/configs/desktop-homescreen.json index 88ba0dc..d6977c9 100644 --- a/configs/desktop-homescreen.json +++ b/configs/desktop-homescreen.json @@ -13,7 +13,7 @@ "env": { "HOMESCREEN_SRC_DIR": "${FLUTTER_WORKSPACE}/app/ivi-homescreen", "HOMESCREEN_BUILD_DIR": "${FLUTTER_WORKSPACE}/app/ivi-homescreen/build",

bernardcraddock commented 8 months ago

that was a bit ugly hopefully to can see the .png attachment ok

Untitled 2
jwinarske commented 8 months ago

I'm sticking with next_main. Not focused on anything else. Way too much work and not enough time to do it

bernardcraddock commented 8 months ago

ok

Bernard Craddock Co-founder Pumped Fuel www.pumpedfuel.com L2, 11 York Street Sydney 2000

On Mon, Jan 8, 2024 at 6:13 PM Joel Winarske @.***> wrote:

I'm sticking with next_main. Not focused on anything else. Way too much work and not enough time to do it

— Reply to this email directly, view it on GitHub https://github.com/bernardpumped/ped/issues/6#issuecomment-1880483820, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABCJ6O4SYZ3SHTIHGW4EAW3YNOMCZAVCNFSM5YK3XEAKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOBYGA2DQMZYGIYA . You are receiving this because you were mentioned.Message ID: @.***>

jwinarske commented 8 months ago

PXL_20240108_194809064

bernardcraddock commented 8 months ago

Oh my Goodness, you got it working yippee thank you very much! Pity it looks so ugly, and that's why we created the IVI (landscape) branch as looks so much nicer. If anyone is curious, please pass on my details.

We originally didn't include firebase within IVI, because if you recall way back when, I did mention it and you said you weren't going to use/adopt it. Do you plan on bringing it to AGL?

next_main/main branches have considerable firebase functionality that we're constantly adding to. We develop on macOS as mandatory requirement for iOS and CarPlay currently running firebase 12.9.1. If you're happy to continue demo for us, we'll figure out how we can share everything with you without comprising keys.

As soon as I've finished with iOS and AWS, will switch back and review the tweaks you did to get this working.

on a separate note, I'm going to submit an application on Converge-2 OpenAI Startup Fund https://openai.fund/news/converge-2. and I'm going to mention our collaboration meta-flutter/PED

In addition to this I have friends who work in AI/LLM Persona Modulation, who feel this technology could potentially be a good candidate for an In-vehicle AI system in the context of a Personalised journey concierge, that is combined with robust critical safety/security and privacy concerns.

thoughts?