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

4:1: Error: A library can't opt out of null safety by default, when using sound null safety. // @dart=2.0 #13

Closed
ADLsourceCode opened this issue Oct 8, 2021 · 8 comments · Fixed by #18
Assignees
Milestone

Comments

@ADLsourceCode
Copy link

ADLsourceCode commented Oct 8, 2021

Give me the below error while building the app:-

package/influxdb-client/lib/model/write_precision.dart:4:1: Error: A library can't opt out of null safety by default, when using sound null safety. // @dart=2.0 ^^^^^^^^^^^^

this error comes in many files on the package... Kindly guide me

@pauldix @brettbuddin @mkmik @stuartcarnie @rockstar

@bednar
Copy link
Contributor

bednar commented Oct 11, 2021

Hi @ADLsourceCode,

thanks for using our client.

Which version of Dart do you use?

Regards

@ADLsourceCode
Copy link
Author

hi @bednar

environment:
sdk: ">=2.12.0 <3.0.0"

Flutter 2.2.2 • channel stable • https://github.com/flutter/flutter.git
Framework • revision d79295af24 (4 months ago) • 2021-06-11 08:56:01 -0700
Engine • revision 91c9fc8fe0
Tools • Dart 2.13.3

@bednar
Copy link
Contributor

bednar commented Oct 11, 2021

@ADLsourceCode thanks for quick response.

How do you build your project? Do you use configured web compilers (https://github.com/dart-lang/build/blob/master/build_web_compilers/README.md#configuring-the-sound-null-safety-mode)?

@ADLsourceCode
Copy link
Author

Hi @bednar ,
I just made a new project with Flutter 2 and used the Influx package and the code from Github. I use the general build with
sound_null_safety: true , it gave the above error and when I used sound_null_safety: false, it ran but querying my DB gives me another error which I mentioned on a different ticket here #14

@bednar
Copy link
Contributor

bednar commented Oct 11, 2021

@ADLsourceCode thanks for detail info, @rhajek will take a look

@rhajek
Copy link
Contributor

rhajek commented Oct 12, 2021

Unfortunately, we generate apis from swagger using openapi-generator that still does not support null safety,
OpenAPITools/openapi-generator#8278

@ADLsourceCode
Copy link
Author

ADLsourceCode commented Oct 12, 2021 via email

@rhajek
Copy link
Contributor

rhajek commented Oct 12, 2021

As a temporary workaround you can disable sound null safety.
I tested a newly created project with Flutter 2.5.2 + influxdb_client (git main branch), flutter run --no-sound-null-safety works form me.

@rhajek rhajek mentioned this issue Oct 21, 2021
6 tasks
@rhajek rhajek closed this as completed in #18 Nov 4, 2021
@bednar bednar added this to the 1.3.0 milestone Nov 4, 2021
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 a pull request may close this issue.

3 participants