Munawar Hussian
Munawar Hussian

Reputation: 315

Share Preference package of flutter show error after update

I am using Share Preference package for my flutter application but it show follwoing errors

Plugin path_provider_linux doesn't implement a plugin interface, nor sets a default implementation in pubspec.yaml.

To set a default implementation, use: flutter: plugin: platforms: linux: default_package:

To implement an interface, use: flutter: plugin: implements:

Plugin path_provider_windows doesn't implement a plugin interface, nor sets a default implementation in pubspec.yaml.

To set a default implementation, use: flutter: plugin: platforms: windows: default_package:

To implement an interface, use: flutter: plugin: implements:

Plugin shared_preferences_linux doesn't implement a plugin interface, nor sets a default implementation in pubspec.yaml.

To set a default implementation, use: flutter: plugin: platforms: linux: default_package:

To implement an interface, use: flutter: plugin: implements:

Plugin shared_preferences_macos doesn't implement a plugin interface, nor sets a default implementation in pubspec.yaml.

To set a default implementation, use: flutter: plugin: platforms: macos: default_package:

To implement an interface, use: flutter: plugin: implements:

Plugin shared_preferences_windows doesn't implement a plugin interface, nor sets a default implementation in pubspec.yaml.

To set a default implementation, use: flutter: plugin: platforms: windows: default_package:

To implement an interface, use: flutter: plugin: implements:

/D:/Software/android/flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.4+1/lib/src/structs.dart:1111:7: Error: Struct 'ENUMLOGFONTEX' is empty. Empty structs are undefined behavior. class ENUMLOGFONTEX extends Struct { ^ /D:/Software/android/flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.4+1/lib/src/structs.dart:2835:7: Error: Struct 'BLUETOOTH_PIN_INFO' is empty. Empty structs are undefined behavior. class BLUETOOTH_PIN_INFO extends Struct { ^ /D:/Software/android/flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.4+1/lib/src/structs.dart:2960:7: Error: Struct 'EXCEPINFO' is empty. Empty structs are undefined behavior. class EXCEPINFO extends Struct {} ^ /D:/Software/android/flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.4+1/lib/src/structs.dart:2966:7: Error: Struct 'PROPERTYKEY' is empty. Empty structs are undefined behavior. class PROPERTYKEY extends Struct {} ^ /D:/Software/android/flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.4+1/lib/src/structs.dart:2973:7: Error: Struct 'PROPVARIANT' is empty. Empty structs are undefined behavior. class PROPVARIANT extends Struct {} ^ /D:/Software/android/flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.4+1/lib/src/structs.dart:2978:7: Error: Struct 'SAFEARRAY' is empty. Empty structs are undefined behavior. class SAFEARRAY extends Struct {} ^ /D:/Software/android/flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.4+1/lib/src/structs.dart:2985:7: Error: Struct 'CLSID' is empty. Empty structs are undefined behavior. class CLSID extends Struct {} ^ /D:/Software/android/flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.4+1/lib/src/structs.dart:2992:7: Error: Struct 'STATSTG' is empty. Empty structs are undefined behavior. class STATSTG extends Struct {} ^ /D:/Software/android/flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.4+1/lib/src/structs.dart:2999:7: Error: Struct 'NLM_SIMULATED_PROFILE_INFO' is empty. Empty structs are undefined behavior. class NLM_SIMULATED_PROFILE_INFO extends Struct {} ^ /D:/Software/android/flutter/.pub-cache/hosted/pub.dartlang.org/ffi-0.1.3/lib/src/utf8.dart:23:7: Error: Struct 'Utf8' is empty. Empty structs are undefined behavior. class Utf8 extends Struct { ^ /D:/Software/android/flutter/.pub-cache/hosted/pub.dartlang.org/ffi-0.1.3/lib/src/utf16.dart:16:7: Error: Struct 'Utf16' is empty. Empty structs are undefined behavior. class Utf16 extends Struct { ^ /D:/Software/android/flutter/.pub-cache/hosted/pub.dartlang.org/ffi-0.1.3/lib/src/allocation.dart:47:33: Error: Expected type 'T' to be a valid and instantiated subtype of 'NativeType'. final int totalSize = count * sizeOf(); ^

FAILURE: Build failed with an exception.

Process 'command 'D:\Software\android\flutter\bin\flutter.bat'' finished with non-zero exit value 1

Upvotes: 4

Views: 2281

Answers (2)

AkMax
AkMax

Reputation: 345

Just add this in pubspec.yaml

Just add this in your pubspec.yaml

Link to the latest versions :

shared_preferences https://pub.dev/packages/shared_preferences

path_provider_linux https://pub.dev/documentation/path_provider_linux/latest/

path_provider_macos https://pub.dev/documentation/path_provider_macos/latest/

path_provider_windows https://pub.dev/packages/path_provider_windows

shared_preferences_linux https://pub.dev/documentation/shared_preferences_linux/latest/

shared_preferences_macos https://pub.dev/documentation/shared_preferences_macos/latest/

shared_preferences_windows https://pub.dev/packages/shared_preferences_windows

Its works !!! i hope that is help you !!!

Upvotes: 1

msyagami
msyagami

Reputation: 69

If you're using the Flutter master channel, switch to dev or beta. This is a known issue.

Upvotes: 2

Related Questions