generator-jhipster-flutter icon indicating copy to clipboard operation
generator-jhipster-flutter copied to clipboard

Issues from test run

Open mraible opened this issue 3 years ago • 5 comments

I installed this module tonight and tried to create an app and run it. First of all, am I supposed to run yo jhipster-flutter-merlin in a directory next to my JHipster app, or inside my JHipster app?

I'm using Java 8 because I got a NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema when I tried to use Java 11.

$ java -version
openjdk version "1.8.0_242"
OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_242-b08)
OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.242-b08, mixed mode)

I tried to create flutter-app next to my JHipster app. After I created the app, I tried to run it with flutter run on Chrome. The error I received:

$ flutter run
Multiple devices found:
Android SDK built for x86 (mobile) • emulator-5554                        • android-x86    • Android 10 (API 29)
(emulator)
iPhone 11 (mobile)                 • 53F2EA71-5273-40B7-8CCA-329E12B0D3E4 • ios            •
com.apple.CoreSimulator.SimRuntime.iOS-14-4 (simulator)
Chrome (web)                       • chrome                               • web-javascript • Google Chrome 89.0.4389.82
[1]: Android SDK built for x86 (emulator-5554)
[2]: iPhone 11 (53F2EA71-5273-40B7-8CCA-329E12B0D3E4)
[3]: Chrome (chrome)
Please choose one (To quit, press "q/Q"): 3

Launching lib/main.dart on Chrome in debug mode...
Error: Cannot run with sound null safety, because the following dependencies
don't support null safety:

 - package:flutter_bloc
 - package:dart_json_mapper
 - package:bloc
 - package:provider
 - package:formz

For solutions, see https://dart.dev/go/unsound-null-safety
Unhandled exception:
Bad state: Unsupported Null Safety mode NonNullableByDefaultCompiledMode.Invalid, in null.
#0      ProgramCompiler.emitModule (package:dev_compiler/src/kernel/compiler.dart:435:9)
#1      JavaScriptBundler.compile (package:frontend_server/src/javascript_bundle.dart:144:33)
#2      FrontendCompiler.writeJavascriptBundle (package:frontend_server/frontend_server.dart:632:20)
<asynchronous suspension>
#3      FrontendCompiler.compile (package:frontend_server/frontend_server.dart:545:9)
<asynchronous suspension>
#4      listenAndCompile.<anonymous closure> (package:frontend_server/frontend_server.dart:1105:11)
<asynchronous suspension>
the Dart compiler exited unexpectedly.
Waiting for connection from debug service on Chrome...              7.2s
Failed to compile application.

Then, I tried Android. That fails too. I must be doing something wrong.

[1]: Android SDK built for x86 (emulator-5554)
[2]: iPhone 11 (53F2EA71-5273-40B7-8CCA-329E12B0D3E4)
[3]: Chrome (chrome)
Please choose one (To quit, press "q/Q"): 1

Using hardware rendering with device Android SDK built for x86. If you notice graphics artifacts, consider enabling
software rendering with "--enable-software-rendering".
Launching lib/main.dart on Android SDK built for x86 in debug mode...
Error: Cannot run with sound null safety, because the following dependencies
don't support null safety:

 - package:flutter_bloc
 - package:dart_json_mapper
 - package:bloc
 - package:provider
 - package:formz

For solutions, see https://dart.dev/go/unsound-null-safety


FAILURE: Build failed with an exception.

* Where:
Script '/usr/local/Caskroom/flutter/1.22.4/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 991

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command '/usr/local/Caskroom/flutter/1.22.4/flutter/bin/flutter'' finished with non-zero exit value 1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 2m 19s
Running Gradle task 'assembleDebug'...
Running Gradle task 'assembleDebug'... Done                       140.3s
Exception: Gradle task assembleDebug failed with exit code 1

FWIW, here's the backend I created with JHipster 7 main branch.

/*
 * 21-Points (https://github.com/mraible/21-points) as a WebFlux + React app
 */

application {
  config {
    applicationType monolith
    reactive true
    baseName HealthPoints
    packageName com.okta.developer
    authenticationType oauth2
    prodDatabaseType postgresql
    buildTool gradle
    testFrameworks [cypress]
    clientFramework react
    enableTranslation true
    nativeLanguage en
    languages [en, es]
  }
  entities Points, BloodPressure, Weight, Preferences
}

// JDL definition for application 'TwentyOnePoints' generated with command 'jhipster export-jdl'

entity BloodPressure {
  timestamp ZonedDateTime required,
  systolic Integer required,
  diastolic Integer required
}
entity Weight {
  timestamp ZonedDateTime required,
  weight Double required
}
entity Points {
  date LocalDate required,
  exercise Integer,
  meals Integer,
  alcohol Integer,
  notes String maxlength(140)
}
entity Preferences {
  weeklyGoal Integer required min(10) max(21),
  weightUnits Units required
}

enum Units {
  KG,
  LB
}

relationship OneToOne {
  Preferences{user(login)} to User
}
relationship ManyToOne {
  BloodPressure{user(login)} to User,
  Weight{user(login)} to User,
  Points{user(login)} to User
}

paginate BloodPressure, Weight with infinite-scroll
paginate Points with pagination

I'm guessing you don't support OIDC auth yet since there are open issues for Keycloak and Okta. If it helps to create bug bounties for these, I'd be happy to do that.

If I generate a reactive app with JWT for auth, should it work?

mraible avatar Mar 16 '21 07:03 mraible