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

[BUG] Problem when try to add package #24

Closed
rupas385 opened this issue Dec 13, 2022 · 3 comments
Closed

[BUG] Problem when try to add package #24

rupas385 opened this issue Dec 13, 2022 · 3 comments

Comments

@rupas385
Copy link

rupas385 commented Dec 13, 2022

ℹ️ Info

Version: 2.0.6

Flutter version: 3.3.9

💬 Description

When add the package I get this error:
Because icons_launcher >=1.1.0 depends on universal_io ^2.0.4 which depends on crypto ^3.0.0, icons_launcher >=1.1.0 requires crypto ^3.0.0.
So, because crypto depends on icons_launcher ^2.0.6 and crypto is 1.0.0+1, version solving failed.
pub get failed (1; So, because crypto depends on icons_launcher ^2.0.6 and crypto is 1.0.0+1, version solving failed.)

@rupas385 rupas385 changed the title [BUG] [BUG] Problem when try to add package Dec 13, 2022
@mrrhak
Copy link
Owner

mrrhak commented Dec 14, 2022

It conflicts with the nested dependency version with your other dependency and you can resolve it by upgrading the dependency that conflicts to the latest version if available or using dependency_overrides.

@rupas385
Copy link
Author

rupas385 commented Dec 16, 2022

I used dependency overrides and clean my proyect. Then I dont have any other dependency. Now compile, but when I call

flutter pub run icons_launcher:create

Get this error:

`

Failed to build icons_launcher:create:
../../../Development/flutter/.pub-cache/hosted/pub.dartlang.org/archive-3.3.5/lib/src/util/adler32.dart:2:8: Error: Error when reading 'lib/crypto.dart': No such file or directory
import 'package:crypto/crypto.dart' as crypto;
       ^
../../../Development/flutter/.pub-cache/hosted/pub.dartlang.org/archive-3.3.5/lib/src/util/crc32.dart:2:8: Error: Error when reading 'lib/crypto.dart': No such file or directory
import 'package:crypto/crypto.dart' as crypto;
       ^
../../../Development/flutter/.pub-cache/hosted/pub.dartlang.org/archive-3.3.5/lib/src/xz_decoder.dart:3:8: Error: Error when reading 'lib/crypto.dart': No such file or directory
import 'package:crypto/crypto.dart';
       ^
../../../Development/flutter/.pub-cache/hosted/pub.dartlang.org/archive-3.3.5/lib/src/util/adler32.dart:32:23: Error: Type 'crypto.Hash' not found.
class Adler32 extends crypto.Hash {
                      ^^^^^^^^^^^
../../../Development/flutter/.pub-cache/hosted/pub.dartlang.org/archive-3.3.5/lib/src/util/adler32.dart:46:50: Error: Type 'crypto.Digest' not found.
  ByteConversionSink startChunkedConversion(Sink<crypto.Digest> sink) =>
                                                 ^^^^^^^^^^^^^
../../../Development/flutter/.pub-cache/hosted/pub.dartlang.org/archive-3.3.5/lib/src/util/adler32.dart:65:14: Error: Type 'crypto.Digest' not found.
  final Sink<crypto.Digest> _inner;
             ^^^^^^^^^^^^^
../../../Development/flutter/.pub-cache/hosted/pub.dartlang.org/archive-3.3.5/lib/src/util/crc32.dart:33:21: Error: Type 'crypto.Hash' not found.
class Crc32 extends crypto.Hash {
                    ^^^^^^^^^^^
../../../Development/flutter/.pub-cache/hosted/pub.dartlang.org/archive-3.3.5/lib/src/util/crc32.dart:47:50: Error: Type 'crypto.Digest' not found.
  ByteConversionSink startChunkedConversion(Sink<crypto.Digest> sink) =>
                                                 ^^^^^^^^^^^^^
../../../Development/flutter/.pub-cache/hosted/pub.dartlang.org/archive-3.3.5/lib/src/util/crc32.dart:66:14: Error: Type 'crypto.Digest' not found.
  final Sink<crypto.Digest> _inner;
             ^^^^^^^^^^^^^
../../../Development/flutter/.pub-cache/hosted/pub.dartlang.org/archive-3.3.5/lib/src/util/adler32.dart:46:57: Error: 'Digest' isn't a type.
  ByteConversionSink startChunkedConversion(Sink<crypto.Digest> sink) =>
                                                        ^^^^^^
../../../Development/flutter/.pub-cache/hosted/pub.dartlang.org/archive-3.3.5/lib/src/util/adler32.dart:65:21: Error: 'Digest' isn't a type.
  final Sink<crypto.Digest> _inner;
                    ^^^^^^
../../../Development/flutter/.pub-cache/hosted/pub.dartlang.org/archive-3.3.5/lib/src/util/adler32.dart:85:23: Error: Method not found: 'Digest'.
    _inner.add(crypto.Digest([
                      ^^^^^^
../../../Development/flutter/.pub-cache/hosted/pub.dartlang.org/archive-3.3.5/lib/src/util/crc32.dart:47:57: Error: 'Digest' isn't a type.
  ByteConversionSink startChunkedConversion(Sink<crypto.Digest> sink) =>
                                                        ^^^^^^
../../../Development/flutter/.pub-cache/hosted/pub.dartlang.org/archive-3.3.5/lib/src/util/crc32.dart:66:21: Error: 'Digest' isn't a type.
  final Sink<crypto.Digest> _inner;
                    ^^^^^^
../../../Development/flutter/.pub-cache/hosted/pub.dartlang.org/archive-3.3.5/lib/src/util/crc32.dart:86:23: Error: Method not found: 'Digest'.
    _inner.add(crypto.Digest([
                      ^^^^^^
../../../Development/flutter/.pub-cache/hosted/pub.dartlang.org/archive-3.3.5/lib/src/xz_decoder.dart:206:15: Error: The getter 'sha256' isn't defined for the class '_XZStreamDecoder'.
 - '_XZStreamDecoder' is from 'package:archive/src/xz_decoder.dart' ('../../../Development/flutter/.pub-cache/hosted/pub.dartlang.org/archive-3.3.5/lib/src/xz_decoder.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'sha256'.
              sha256.convert(data.toBytes().sublist(startDataLength)).bytes;
              ^^^^^^
pub finished with exit code 1
rupas@Mac-mini-de-Rube avatarme % flutter pub run icons_launcher:create
Failed to build icons_launcher:create:
../../../Development/flutter/.pub-cache/hosted/pub.dartlang.org/archive-3.3.5/lib/src/util/adler32.dart:2:8: Error: Error when reading 'lib/crypto.dart': No such file or directory
import 'package:crypto/crypto.dart' as crypto;
       ^
../../../Development/flutter/.pub-cache/hosted/pub.dartlang.org/archive-3.3.5/lib/src/util/crc32.dart:2:8: Error: Error when reading 'lib/crypto.dart': No such file or directory
import 'package:crypto/crypto.dart' as crypto;
       ^
../../../Development/flutter/.pub-cache/hosted/pub.dartlang.org/archive-3.3.5/lib/src/xz_decoder.dart:3:8: Error: Error when reading 'lib/crypto.dart': No such file or directory
import 'package:crypto/crypto.dart';
       ^
../../../Development/flutter/.pub-cache/hosted/pub.dartlang.org/archive-3.3.5/lib/src/util/adler32.dart:32:23: Error: Type 'crypto.Hash' not found.
class Adler32 extends crypto.Hash {
                      ^^^^^^^^^^^
../../../Development/flutter/.pub-cache/hosted/pub.dartlang.org/archive-3.3.5/lib/src/util/adler32.dart:46:50: Error: Type 'crypto.Digest' not found.
  ByteConversionSink startChunkedConversion(Sink<crypto.Digest> sink) =>
                                                 ^^^^^^^^^^^^^
../../../Development/flutter/.pub-cache/hosted/pub.dartlang.org/archive-3.3.5/lib/src/util/adler32.dart:65:14: Error: Type 'crypto.Digest' not found.
  final Sink<crypto.Digest> _inner;
             ^^^^^^^^^^^^^
../../../Development/flutter/.pub-cache/hosted/pub.dartlang.org/archive-3.3.5/lib/src/util/crc32.dart:33:21: Error: Type 'crypto.Hash' not found.
class Crc32 extends crypto.Hash {
                    ^^^^^^^^^^^
../../../Development/flutter/.pub-cache/hosted/pub.dartlang.org/archive-3.3.5/lib/src/util/crc32.dart:47:50: Error: Type 'crypto.Digest' not found.
  ByteConversionSink startChunkedConversion(Sink<crypto.Digest> sink) =>
                                                 ^^^^^^^^^^^^^
../../../Development/flutter/.pub-cache/hosted/pub.dartlang.org/archive-3.3.5/lib/src/util/crc32.dart:66:14: Error: Type 'crypto.Digest' not found.
  final Sink<crypto.Digest> _inner;
             ^^^^^^^^^^^^^
../../../Development/flutter/.pub-cache/hosted/pub.dartlang.org/archive-3.3.5/lib/src/util/adler32.dart:46:57: Error: 'Digest' isn't a type.
  ByteConversionSink startChunkedConversion(Sink<crypto.Digest> sink) =>
                                                        ^^^^^^
../../../Development/flutter/.pub-cache/hosted/pub.dartlang.org/archive-3.3.5/lib/src/util/adler32.dart:65:21: Error: 'Digest' isn't a type.
  final Sink<crypto.Digest> _inner;
                    ^^^^^^
../../../Development/flutter/.pub-cache/hosted/pub.dartlang.org/archive-3.3.5/lib/src/util/adler32.dart:85:23: Error: Method not found: 'Digest'.
    _inner.add(crypto.Digest([
                      ^^^^^^
../../../Development/flutter/.pub-cache/hosted/pub.dartlang.org/archive-3.3.5/lib/src/util/crc32.dart:47:57: Error: 'Digest' isn't a type.
  ByteConversionSink startChunkedConversion(Sink<crypto.Digest> sink) =>
                                                        ^^^^^^
../../../Development/flutter/.pub-cache/hosted/pub.dartlang.org/archive-3.3.5/lib/src/util/crc32.dart:66:21: Error: 'Digest' isn't a type.
  final Sink<crypto.Digest> _inner;
                    ^^^^^^
../../../Development/flutter/.pub-cache/hosted/pub.dartlang.org/archive-3.3.5/lib/src/util/crc32.dart:86:23: Error: Method not found: 'Digest'.
    _inner.add(crypto.Digest([
                      ^^^^^^
../../../Development/flutter/.pub-cache/hosted/pub.dartlang.org/archive-3.3.5/lib/src/xz_decoder.dart:206:15: Error: The getter 'sha256' isn't defined for the class '_XZStreamDecoder'.
 - '_XZStreamDecoder' is from 'package:archive/src/xz_decoder.dart' ('../../../Development/flutter/.pub-cache/hosted/pub.dartlang.org/archive-3.3.5/lib/src/xz_decoder.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'sha256'.
              sha256.convert(data.toBytes().sublist(startDataLength)).bytes;
              ^^^^^^
pub finished with exit code 1

My pubspec:

dependencies:
  flutter:
    sdk: flutter
  cupertino_icons: ^1.0.2
  get: 4.3.8

  icons_launcher: ^2.0.6

dependency_overrides:
  universal_io: ^2.0.4
  image: ^3.2.2
  archive: ^3.1.2

dev_dependencies: 
  flutter_lints: ^1.0.0
  lints: 1.0.1
  flutter_test: 
    sdk: flutter

@mrrhak
Copy link
Owner

mrrhak commented Dec 16, 2022

I think the problem is with your .pub_cache folder I have tested it on my machine it works fine with the latest dependency version no need to use dependency_overrides.

dependencies:
  flutter:
    sdk: flutter
  cupertino_icons: ^1.0.5
  get: ^4.6.5
  icons_launcher: ^2.0.6

dev_dependencies:
  flutter_test:
    sdk: flutter
  flutter_lints: ^2.0.1
  lints: ^2.0.1

Please try to clean your project cache with the command flutter clean and delete your .pub_cache folder and delete pubspec.lock file and run flutter pub get again. Thanks

@mrrhak mrrhak closed this as completed Dec 24, 2022
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

2 participants