Prime-Holding / rx_bloc

A set of Flutter packages that help implement the BloC (Business Logic Component) design pattern using the power of reactive streams
https://pub.dev/packages/rx_bloc
63 stars 21 forks source link

Failed build using rx_bloc_cli #633

Closed OlegZaimNLT closed 11 months ago

OlegZaimNLT commented 11 months ago

I try to build initial template app but build failed. Any ideas how can be solved it?

flutter --version Flutter 3.16.3 • channel stable • https://github.com/flutter/flutter.git Framework • revision b0366e0a3f (6 days ago) • 2023-12-05 19:46:39 -0800 Engine • revision 54a7145303 Tools • Dart 3.2.3 • DevTools 2.28.4

rx_bloc_cli create . --project-name example Project name: example Organization name: (com.example) com.example Enable login: (Y/n) Yes Enable social logins: (y/N) No Enable OTP authentication: (y/N) Yes Enable Pin Code authentication: (y/N) Yes Enabled auth matrix: (y/N) No Enable change language: (Y/n) Yes Enable counter showcase: (y/N) Yes Enable widget toolkit showcase: (y/N) Yes Enable analytics: (y/N) Yes Select realtime communication type: [ none | sse ] (none) sse Enable deeplink: (y/N) No Enable dev menu: (y/N) Yes Enable Patrol integration tests: (y/N) No Select ci/cd type: [ none | fastlane | github ] (fastlane) fastlane

✓ Bootstrapping done (0.4s) ✓ Generated 409 file(s)

✓ Generated project with package name: com.tokbor.tokbor ✓ Using Firebase Push Notifications ✓ Using Firebase Analytics and Crashlytics ✓ Using Feature Counter Showcase x Not using Feature Deep links Showcase ✓ Using Feature Widget Toolkit Showcase ✓ Using Feature Login x Not using Social Logins [Apple, Google, Facebook] ✓ Using Enable Change Language ✓ Using Dev Menu ✓ Using OTP Feature x Not using Patrol integration tests ✓ Using Realtime communication ✓ Using Pin Code ✓ Using CI/CD x Not using Auth matrix

✓ dart pub get (0.8s) ✓ dart run build_runner build (6.1s) ✗ Could not format because the source could not be parsed:

line 22, column 48 of flutter/packages/flutter/test_fixes/material/app_bar.dart: Expected to find ';'. ╷ 22 │ appBar = AppBar(backwardsCompatibility: false)); │ ^ ╵ line 22, column 49 of flutter/packages/flutter/test_fixes/material/app_bar.dart: Expected an identifier. ╷ 22 │ appBar = AppBar(backwardsCompatibility: false)); │ ^ ╵ line 22, column 49 of flutter/packages/flutter/test_fixes/material/app_bar.dart: Unexpected text ';'. ╷ 22 │ appBar = AppBar(backwardsCompatibility: false)); │ ^ ╵ Could not format because the source could not be parsed:

line 22, column 48 of fvm/versions/stable/packages/flutter/test_fixes/material/app_bar.dart: Expected to find ';'. ╷ 22 │ appBar = AppBar(backwardsCompatibility: false)); │ ^ ╵ line 22, column 49 of fvm/versions/stable/packages/flutter/test_fixes/material/app_bar.dart: Expected an identifier. ╷ 22 │ appBar = AppBar(backwardsCompatibility: false)); │ ^ ╵ line 22, column 49 of fvm/versions/stable/packages/flutter/test_fixes/material/app_bar.dart: Unexpected text ';'. ╷ 22 │ appBar = AppBar(backwardsCompatibility: false)); │ ^ ╵

DDavidPrime commented 11 months ago

Hi @OlegZaimNLT ! Thanks for opening an issue.

I tried reproducing the issue locally with the provided parameters but the project generated successfully. Could you see if the same issue happens with the -no-interactive parameter? Also, since the formatting step failed, did you manage to open and run the project successfully?

Also from the error logs you've got, it seems that there are some issues with the flutter version you're using. I noticed you've been using fvm. Does that happen with a different flutter version?

OlegZaimNLT commented 11 months ago

Hi, So, I've tried rx_bloc_cli create . --project-name example --no-interactive but recieved same error. Project didn't created after all. I've also tried to use different flutter versions using fvm.

DDavidPrime commented 11 months ago

After giving it a second look, I noticed that the issue you're experiencing is coming from the SDK or some of the cached packages. You can try running the flutter pub cache repair to fix any outstanding issues which could have broken your local versions of the packages.

Additionally, you can try deactivating and reactivating the rx_bloc_cli by running dart pub global deactivate rx_bloc_cli then dart pub global activate rx_bloc_cli. This will ensure that you're using the latest version of the CLI.

You can also check if flutter doctor shows any warnings/errors and if your global flutter version is a recent one (for example: 3.16.3).

Hope this helps! 🙌🏼

OlegZaimNLT commented 11 months ago

Hello, thank you for you responses, so, finally I've managed to generate project using cli. Initially I've tried to generate project from terminal in empty folder - here I've got error with formatter. Then I've tried to create new flutter project and inside it run the command for generating and it is generate me needed components.

StanevPrime commented 11 months ago

Dear @OlegZaimNLT you can also can use specify the project folder as shown below:

georgistanev@MacBook-Pro sandbox % rx_bloc_cli create testproject

Project name: testproject
Organization name: (com.example) com.primeholding
Enable login: (Y/n) Yes
Enable social logins: (y/N) Yes
Enable OTP authentication: (y/N) Yes
Enable Pin Code authentication: (y/N) Yes
Enabled auth matrix: (y/N) Yes
Enable change language: (Y/n) Yes
Enable counter showcase: (y/N) Yes
Enable widget toolkit showcase: (y/N) Yes
Enable analytics: (y/N) Yes
Select realtime communication type: [ none | sse ] (none) none
Enable deeplink: (y/N) Yes
Enable dev menu: (y/N) Yes
Enable Patrol integration tests: (y/N) Yes
Select ci/cd type: [ none | fastlane | github ] (fastlane) fastlane

✓ Bootstrapping done (0.5s)
✓ Generated 503 file(s)

✓ Generated project with package name: com.primeholding.testproject
✓ Using Firebase Push Notifications
✓ Using Firebase Analytics and Crashlytics
✓ Using Feature Counter Showcase
✓ Using Feature Deep links Showcase
✓ Using Feature Widget Toolkit Showcase
✓ Using Feature Login
✓ Using Social Logins [Apple, Google, Facebook]
✓ Using Enable Change Language
✓ Using Dev Menu
✓ Using OTP Feature
✓ Using Patrol integration tests
x Not using Realtime communication
✓ Using Pin Code
✓ Using CI/CD
✓ Using Auth matrix

✓ dart pub get (6.5s)
✓ dart run build_runner build (8.1s)
✓ dart format . (0.6s)

This will generate all files in the specified folder

image