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

Error: Undefined name 'REG_SAM_FLAGS'. readOnly(REG_SAM_FLAGS.KEY_READ) #18

Closed
naeem-shah opened this issue May 2, 2024 · 4 comments
Closed

Comments

@naeem-shah
Copy link

Complete Logs:

../../../../Local/Pub/Cache/hosted/pub.dev/win32_registry-1.1.3/lib/src/models/access_rights.dart:9:12: Error: Undefined name 'REG_SAM_FLAGS'.
  readOnly(REG_SAM_FLAGS.KEY_READ),
           ^^^^^^^^^^^^^
../../../../Local/Pub/Cache/hosted/pub.dev/win32_registry-1.1.3/lib/src/models/access_rights.dart:10:13: Error: Undefined name 'REG_SAM_FLAGS'.
  writeOnly(REG_SAM_FLAGS.KEY_WRITE),
            ^^^^^^^^^^^^^
../../../../Local/Pub/Cache/hosted/pub.dev/win32_registry-1.1.3/lib/src/models/access_rights.dart:11:13: Error: Undefined name 'REG_SAM_FLAGS'.
  allAccess(REG_SAM_FLAGS.KEY_ALL_ACCESS);
            ^^^^^^^^^^^^^
../../../../Local/Pub/Cache/hosted/pub.dev/win32_registry-1.1.3/lib/src/models/registry_value_type.dart:18:10: Error: Undefined name 'REG_VALUE_TYPE'.
  binary(REG_VALUE_TYPE.REG_BINARY),
         ^^^^^^^^^^^^^^
../../../../Local/Pub/Cache/hosted/pub.dev/win32_registry-1.1.3/lib/src/models/registry_value_type.dart:22:9: Error: Undefined name 'REG_VALUE_TYPE'.
  int32(REG_VALUE_TYPE.REG_DWORD),
        ^^^^^^^^^^^^^^
../../../../Local/Pub/Cache/hosted/pub.dev/win32_registry-1.1.3/lib/src/models/registry_value_type.dart:28:20: Error: Undefined name 'REG_VALUE_TYPE'.
  unexpandedString(REG_VALUE_TYPE.REG_EXPAND_SZ),
                   ^^^^^^^^^^^^^^
../../../../Local/Pub/Cache/hosted/pub.dev/win32_registry-1.1.3/lib/src/models/registry_value_type.dart:32:8: Error: Undefined name 'REG_VALUE_TYPE'.
  link(REG_VALUE_TYPE.REG_LINK),
       ^^^^^^^^^^^^^^
../../../../Local/Pub/Cache/hosted/pub.dev/win32_registry-1.1.3/lib/src/models/registry_value_type.dart:37:15: Error: Undefined name 'REG_VALUE_TYPE'.
  stringArray(REG_VALUE_TYPE.REG_MULTI_SZ),
              ^^^^^^^^^^^^^^
../../../../Local/Pub/Cache/hosted/pub.dev/win32_registry-1.1.3/lib/src/models/registry_value_type.dart:40:8: Error: Undefined name 'REG_VALUE_TYPE'.
  none(REG_VALUE_TYPE.REG_NONE),
       ^^^^^^^^^^^^^^
../../../../Local/Pub/Cache/hosted/pub.dev/win32_registry-1.1.3/lib/src/models/registry_value_type.dart:44:9: Error: Undefined name 'REG_VALUE_TYPE'.
  int64(REG_VALUE_TYPE.REG_QWORD),
        ^^^^^^^^^^^^^^
../../../../Local/Pub/Cache/hosted/pub.dev/win32_registry-1.1.3/lib/src/models/registry_value_type.dart:48:10: Error: Undefined name 'REG_VALUE_TYPE'.
  string(REG_VALUE_TYPE.REG_SZ),
         ^^^^^^^^^^^^^^
../../../../Local/Pub/Cache/hosted/pub.dev/win32_registry-1.1.3/lib/src/registry.dart:55:22: Error: Undefined name 'WIN32_ERROR'.
      if (lStatus == WIN32_ERROR.ERROR_SUCCESS) return RegistryKey(phKey.value);
                     ^^^^^^^^^^^
../../../../Local/Pub/Cache/hosted/pub.dev/win32_registry-1.1.3/lib/src/registry.dart:82:42: Error: Undefined name 'REG_SAM_FLAGS'.
      final lStatus = RegOpenCurrentUser(REG_SAM_FLAGS.KEY_ALL_ACCESS, phKey);
                                         ^^^^^^^^^^^^^
../../../../Local/Pub/Cache/hosted/pub.dev/win32_registry-1.1.3/lib/src/registry.dart:83:22: Error: Undefined name 'WIN32_ERROR'.
      if (lStatus == WIN32_ERROR.ERROR_SUCCESS) return RegistryKey(phKey.value);
                     ^^^^^^^^^^^
../../../../Local/Pub/Cache/hosted/pub.dev/win32_registry-1.1.3/lib/src/registry_key.dart:42:22: Error: The getter 'WIN32_ERROR' isn't defined for the class 'RegistryKey'.
 - 'RegistryKey' is from 'package:win32_registry/src/registry_key.dart' ('../../../../Local/Pub/Cache/hosted/pub.dev/win32_registry-1.1.3/lib/src/registry_key.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'WIN32_ERROR'.
      if (retcode == WIN32_ERROR.ERROR_SUCCESS) {
                     ^^^^^^^^^^^
../../../../Local/Pub/Cache/hosted/pub.dev/win32_registry-1.1.3/lib/src/registry_key.dart:63:22: Error: The getter 'WIN32_ERROR' isn't defined for the class 'RegistryKey'.
 - 'RegistryKey' is from 'package:win32_registry/src/registry_key.dart' ('../../../../Local/Pub/Cache/hosted/pub.dev/win32_registry-1.1.3/lib/src/registry_key.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'WIN32_ERROR'.
      if (retcode != WIN32_ERROR.ERROR_SUCCESS) {
                     ^^^^^^^^^^^
../../../../Local/Pub/Cache/hosted/pub.dev/win32_registry-1.1.3/lib/src/registry_key.dart:90:22: Error: The getter 'WIN32_ERROR' isn't defined for the class 'RegistryKey'.
 - 'RegistryKey' is from 'package:win32_registry/src/registry_key.dart' ('../../../../Local/Pub/Cache/hosted/pub.dev/win32_registry-1.1.3/lib/src/registry_key.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'WIN32_ERROR'.
      if (retcode != WIN32_ERROR.ERROR_SUCCESS) {
                     ^^^^^^^^^^^
../../../../Local/Pub/Cache/hosted/pub.dev/win32_registry-1.1.3/lib/src/registry_key.dart:112:13: Error: The getter 'REG_ROUTINE_FLAGS' isn't defined for the class 'RegistryKey'.
 - 'RegistryKey' is from 'package:win32_registry/src/registry_key.dart' ('../../../../Local/Pub/Cache/hosted/pub.dev/win32_registry-1.1.3/lib/src/registry_key.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'REG_ROUTINE_FLAGS'.
          ? REG_ROUTINE_FLAGS.RRF_RT_ANY
            ^^^^^^^^^^^^^^^^^
../../../../Local/Pub/Cache/hosted/pub.dev/win32_registry-1.1.3/lib/src/registry_key.dart:113:13: Error: The getter 'REG_ROUTINE_FLAGS' isn't defined for the class 'RegistryKey'.
 - 'RegistryKey' is from 'package:win32_registry/src/registry_key.dart' ('../../../../Local/Pub/Cache/hosted/pub.dev/win32_registry-1.1.3/lib/src/registry_key.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'REG_ROUTINE_FLAGS'.
          : REG_ROUTINE_FLAGS.RRF_RT_ANY | REG_ROUTINE_FLAGS.RRF_NOEXPAND;
            ^^^^^^^^^^^^^^^^^
../../../../Local/Pub/Cache/hosted/pub.dev/win32_registry-1.1.3/lib/src/registry_key.dart:113:44: Error: The getter 'REG_ROUTINE_FLAGS' isn't defined for the class 'RegistryKey'.
 - 'RegistryKey' is from 'package:win32_registry/src/registry_key.dart' ('../../../../Local/Pub/Cache/hosted/pub.dev/win32_registry-1.1.3/lib/src/registry_key.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'REG_ROUTINE_FLAGS'.
          : REG_ROUTINE_FLAGS.RRF_RT_ANY | REG_ROUTINE_FLAGS.RRF_NOEXPAND;
                                           ^^^^^^^^^^^^^^^^^
../../../../Local/Pub/Cache/hosted/pub.dev/win32_registry-1.1.3/lib/src/registry_key.dart:118:22: Error: The getter 'WIN32_ERROR' isn't defined for the class 'RegistryKey'.
 - 'RegistryKey' is from 'package:win32_registry/src/registry_key.dart' ('../../../../Local/Pub/Cache/hosted/pub.dev/win32_registry-1.1.3/lib/src/registry_key.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'WIN32_ERROR'.
      if (retcode == WIN32_ERROR.ERROR_FILE_NOT_FOUND) return null;
                     ^^^^^^^^^^^
../../../../Local/Pub/Cache/hosted/pub.dev/win32_registry-1.1.3/lib/src/registry_key.dart:160:22: Error: The getter 'WIN32_ERROR' isn't defined for the class 'RegistryKey'.
 - 'RegistryKey' is from 'package:win32_registry/src/registry_key.dart' ('../../../../Local/Pub/Cache/hosted/pub.dev/win32_registry-1.1.3/lib/src/registry_key.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'WIN32_ERROR'.
      if (retcode != WIN32_ERROR.ERROR_SUCCESS) {
                     ^^^^^^^^^^^
../../../../Local/Pub/Cache/hosted/pub.dev/win32_registry-1.1.3/lib/src/registry_key.dart:174:22: Error: The getter 'WIN32_ERROR' isn't defined for the class 'RegistryKey'.
 - 'RegistryKey' is from 'package:win32_registry/src/registry_key.dart' ('../../../../Local/Pub/Cache/hosted/pub.dev/win32_registry-1.1.3/lib/src/registry_key.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'WIN32_ERROR'.
      if (retcode != WIN32_ERROR.ERROR_SUCCESS) {
                     ^^^^^^^^^^^
../../../../Local/Pub/Cache/hosted/pub.dev/win32_registry-1.1.3/lib/src/registry_key.dart:211:22: Error: The getter 'WIN32_ERROR' isn't defined for the class 'RegistryKey'.
 - 'RegistryKey' is from 'package:win32_registry/src/registry_key.dart' ('../../../../Local/Pub/Cache/hosted/pub.dev/win32_registry-1.1.3/lib/src/registry_key.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'WIN32_ERROR'.
      if (retcode != WIN32_ERROR.ERROR_SUCCESS) {
                     ^^^^^^^^^^^
../../../../Local/Pub/Cache/hosted/pub.dev/win32_registry-1.1.3/lib/src/registry_key.dart:251:24: Error: The getter 'WIN32_ERROR' isn't defined for the class 'RegistryKey'.
 - 'RegistryKey' is from 'package:win32_registry/src/registry_key.dart' ('../../../../Local/Pub/Cache/hosted/pub.dev/win32_registry-1.1.3/lib/src/registry_key.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'WIN32_ERROR'.
        if (retcode == WIN32_ERROR.ERROR_SUCCESS) {
                       ^^^^^^^^^^^
../../../../Local/Pub/Cache/hosted/pub.dev/win32_registry-1.1.3/lib/src/registry_key.dart:283:24: Error: The getter 'WIN32_ERROR' isn't defined for the class 'RegistryKey'.
 - 'RegistryKey' is from 'package:win32_registry/src/registry_key.dart' ('../../../../Local/Pub/Cache/hosted/pub.dev/win32_registry-1.1.3/lib/src/registry_key.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'WIN32_ERROR'.
        if (retcode == WIN32_ERROR.ERROR_SUCCESS) yield lpName.toDartString();
                       ^^^^^^^^^^^
../../../../Local/Pub/Cache/hosted/pub.dev/win32_registry-1.1.3/lib/src/registry_value.dart:36:9: Error: Undefined name 'REG_VALUE_TYPE'.
        REG_VALUE_TYPE.REG_SZ => RegistryValue(name, RegistryValueType.string,
        ^^^^^^^^^^^^^^
../../../../Local/Pub/Cache/hosted/pub.dev/win32_registry-1.1.3/lib/src/registry_value.dart:38:9: Error: Undefined name 'REG_VALUE_TYPE'.
        REG_VALUE_TYPE.REG_EXPAND_SZ => RegistryValue(
        ^^^^^^^^^^^^^^
../../../../Local/Pub/Cache/hosted/pub.dev/win32_registry-1.1.3/lib/src/registry_value.dart:42:9: Error: Undefined name 'REG_VALUE_TYPE'.
        REG_VALUE_TYPE.REG_LINK => RegistryValue(name, RegistryValueType.link,
        ^^^^^^^^^^^^^^
../../../../Local/Pub/Cache/hosted/pub.dev/win32_registry-1.1.3/lib/src/registry_value.dart:44:9: Error: Undefined name 'REG_VALUE_TYPE'.
        REG_VALUE_TYPE.REG_MULTI_SZ => RegistryValue(
        ^^^^^^^^^^^^^^
../../../../Local/Pub/Cache/hosted/pub.dev/win32_registry-1.1.3/lib/src/registry_value.dart:48:9: Error: Undefined name 'REG_VALUE_TYPE'.
        REG_VALUE_TYPE.REG_DWORD => RegistryValue(
        ^^^^^^^^^^^^^^
../../../../Local/Pub/Cache/hosted/pub.dev/win32_registry-1.1.3/lib/src/registry_value.dart:50:9: Error: Undefined name 'REG_VALUE_TYPE'.
        REG_VALUE_TYPE.REG_QWORD => RegistryValue(
        ^^^^^^^^^^^^^^
../../../../Local/Pub/Cache/hosted/pub.dev/win32_registry-1.1.3/lib/src/registry_value.dart:52:9: Error: Undefined name 'REG_VALUE_TYPE'.
        REG_VALUE_TYPE.REG_BINARY => RegistryValue(
        ^^^^^^^^^^^^^^
../../../../Local/Pub/Cache/hosted/pub.dev/win32_registry-1.1.3/lib/src/registry_value.dart:54:9: Error: Undefined name 'REG_VALUE_TYPE'.
        REG_VALUE_TYPE.REG_NONE =>
        ^^^^^^^^^^^^^^
Unhandled exception:
Crash when compiling:
Null check operator used on a null value

#0      CfeEnumOperations.getEnumElementValue (package:front_end/src/fasta/kernel/exhaustiveness.dart:395)
#1      EnumInfo._createEnumElements (package:_fe_analyzer_shared/src/exhaustiveness/types/enum.dart:60)
#2      EnumInfo.enumElements (package:_fe_analyzer_shared/src/exhaustiveness/types/enum.dart:47)
#3      EnumStaticType._createEnumElements (package:_fe_analyzer_shared/src/exhaustiveness/types/enum.dart:97)
#4      EnumStaticType.enumElements (package:_fe_analyzer_shared/src/exhaustiveness/types/enum.dart:92)
#5      EnumStaticType.getSubtypes (package:_fe_analyzer_shared/src/exhaustiveness/types/enum.dart:90)
#6      _Checker._unmatched (package:_fe_analyzer_shared/src/exhaustiveness/exhaustive.dart:131)
#7      reportErrors (package:_fe_analyzer_shared/src/exhaustiveness/exhaustive.dart:38)
#8      ConstantsTransformer._checkExhaustiveness (package:front_end/src/fasta/kernel/constant_evaluator.dart:1569)
#9      ConstantsTransformer.visitSwitchExpression (package:front_end/src/fasta/kernel/constant_evaluator.dart:2182)
#10     SwitchExpression.accept1 (package:kernel/src/ast/patterns.dart:1981)
#11     RemovingTransformer.transformOrRemove (package:kernel/visitor.dart:1919)
#12     RemovingTransformer.transformOrRemoveExpression (package:kernel/visitor.dart:1892)
#13     ReturnStatement.transformOrRemoveChildren (package:kernel/ast.dart:10181)
#14     RemovingTransformer.defaultTreeNode (package:kernel/visitor.dart:2166)
#15     TreeVisitor1Default.defaultExpression (package:kernel/visitor.dart:739)
#16     StatementVisitor1DefaultMixin.visitReturnStatement (package:kernel/visitor.dart:2589)
#17     ReturnStatement.accept1 (package:kernel/ast.dart:10163)
#18     RemovingTransformer.transformOrRemove (package:kernel/visitor.dart:1919)
#19     ConstantsTransformer.visitBlock (package:front_end/src/fasta/kernel/constant_evaluator.dart:827)
#20     Block.accept1 (package:kernel/ast.dart:9198)
#21     RemovingTransformer.transform (package:kernel/visitor.dart:1883)
#22     ConstantsTransformer.visitFunctionNode (package:front_end/src/fasta/kernel/constant_evaluator.dart:650)
#23     FunctionNode.accept1 (package:kernel/ast.dart:3890)
#24     RemovingTransformer.transform (package:kernel/visitor.dart:1883)
#25     ConstantsTransformer.visitProcedure.<anonymous closure> (package:front_end/src/fasta/kernel/constant_evaluator.dart:561)
#26     ConstantEvaluator.withNewEnvironment (package:front_end/src/fasta/kernel/constant_evaluator.dart:5484)
#27     ConstantsTransformer.visitProcedure (package:front_end/src/fasta/kernel/constant_evaluator.dart:559)
#28     Procedure.accept1 (package:kernel/ast.dart:3246)
#29     RemovingTransformer.transformOrRemove (package:kernel/visitor.dart:1919)
#30     RemovingTransformer.transformList (package:kernel/visitor.dart:2143)
#31     RemovingTransformer.transformProcedureList (package:kernel/visitor.dart:2035)
#32     ConstantsTransformer.visitClass.<anonymous closure> (package:front_end/src/fasta/kernel/constant_evaluator.dart:514)
#33     ConstantEvaluator.withNewEnvironment (package:front_end/src/fasta/kernel/constant_evaluator.dart:5484)
#34     ConstantsTransformer.visitClass (package:front_end/src/fasta/kernel/constant_evaluator.dart:509)
#35     Class.accept1 (package:kernel/ast.dart:1464)
#36     RemovingTransformer.transformOrRemove (package:kernel/visitor.dart:1919)
#37     RemovingTransformer.transformList (package:kernel/visitor.dart:2143)
#38     RemovingTransformer.transformClassList (package:kernel/visitor.dart:1998)
#39     ConstantsTransformer.convertLibrary (package:front_end/src/fasta/kernel/constant_evaluator.dart:461)
#40     transformLibraries (package:front_end/src/fasta/kernel/constant_evaluator.dart:113)
#41     KernelTarget.runBuildTransformations (package:front_end/src/fasta/kernel/kernel_target.dart:1533)
#42     KernelTarget.buildComponent.<anonymous closure> (package:front_end/src/fasta/kernel/kernel_target.dart:629)
<asynchronous suspension>
#43     withCrashReporting (package:front_end/src/fasta/crash.dart:133)
<asynchronous suspension>
#44     KernelTarget.buildComponent (package:front_end/src/fasta/kernel/kernel_target.dart:579)
<asynchronous suspension>
#45     IncrementalCompiler.computeDelta.<anonymous closure> (package:front_end/src/fasta/incremental_compiler.dart:371)
<asynchronous suspension>
#46     CompilerContext.clear (package:front_end/src/fasta/compiler_context.dart:139)
<asynchronous suspension>
#47     IncrementalCompiler.compile (package:vm/incremental_compiler.dart:77)
<asynchronous suspension>
#48     FrontendCompiler.compile (package:frontend_server/frontend_server.dart:610)
<asynchronous suspension>
#49     listenAndCompile.<anonymous closure> (package:frontend_server/frontend_server.dart:1303)
<asynchronous suspension>
the Dart compiler exited unexpectedly.
the Dart compiler exited unexpectedly.

Flutter doctor

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.19.1, on Microsoft Windows [Version 10.0.22631.3527], locale en-US)
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[√] Chrome - develop for the web
[X] Visual Studio - develop Windows apps
    X Visual Studio not installed; this is necessary to develop Windows apps.
      Download at https://visualstudio.microsoft.com/downloads/.
      Please install the "Desktop development with C++" workload, including all of its default components
[√] Android Studio (version 2023.2)
[√] VS Code (version 1.88.1)
[√] Connected device (4 available)
[√] Network resources

! Doctor found issues in 1 category.
@myyellowshoe
Copy link

Getting this same error now. Apparently flutter flow is using this package and its breaking IOS builds.

@halildurmus
Copy link
Owner

halildurmus commented May 7, 2024

These enums were added in win32 v5.4.0, and the latest version of win32_registry (v1.1.3) requires win32 v5.4.0; Therefore, you shouldn't get these errors unless win32 is overridden in pubspec.yaml.

Could you share your pubspec.yaml files, please?

@myyellowshoe
Copy link

myyellowshoe commented May 7, 2024

Ahhh great to know. Looking at my pubspec yaml its set to the older version.

In my pubspec.yaml:

dependency_overrides:
  http: 1.2.0
  uuid: ^4.0.0
  win32: 5.0.9

I updated this to 5.4.0 and built properly! 🥳

@halildurmus
Copy link
Owner

Nice!

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

No branches or pull requests

3 participants