Skip to content

Could not resolve the package 'get_it' in 'package:get_it/get_it.dart #47

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

Closed
nateshmbhat opened this issue Feb 16, 2020 · 1 comment
Closed

Comments

@nateshmbhat
Copy link

I have included the package in pubspec.yaml file :

dependencies:
  flutter:
    sdk: flutter
  core:
   path: ../core

  # The following adds the Cupertino Icons font to your application.
  # Use with the CupertinoIcons class for iOS style icons.
  cupertino_icons: ^0.1.2
  shared_preferences: ^0.5.6
  flutter_bloc: ^3.0.0
  equatable: ^1.0.3
  url_launcher: ^5.4.1
  get_it: ^3.1.0

  flutter_localizations:
    sdk: flutter

I have also tried doing flutter clean and deleting all builds and re running pub get but still same error that it can't resolve get_it.

Compiler message: Error: Could not resolve the package 'get_it' in 'package:get_it/get_it.dart'. core/lib/locator.dart:2:8: Error: Not found: 'package:get_it/get_it.dart' import 'package:get_it/get_it.dart' show GetIt; ^ core/lib/locator.dart:4:1: Error: Type 'GetIt' not found. GetIt locator = GetIt.instance; ^^^^^ core/lib/locator.dart:4:1: Error: 'GetIt' isn't a type. GetIt locator = GetIt.instance; ^^^^^ core/lib/locator.dart:4:17: Error: Getter not found: 'GetIt'. GetIt locator = GetIt.instance; ^^^^^ Unhandled exception: FileSystemException(uri=org-dartlang-untranslatable-uri:package%3Aget_it%2Fget_it.dart; message=StandardFileSystem only supports file:* and data:* URIs) #0 StandardFileSystem.entityForUri (package:front_end/src/api_prototype/standard_file_system.dart:33:7) #1 asFileUri (package:vm/kernel_front_end.dart:604:37) #2 writeDepfile (package:vm/kernel_front_end.dart:799:21) <asynchronous suspension> #3 FrontendCompiler.compile (package:frontend_server/frontend_server.dart:472:15) <asynchronous suspension> #4 _FlutterFrontendCompiler.compile (package:flutter_frontend_server/server.dart:38:22) #5 starter (package:flutter_frontend_server/server.dart:149:27) #6 main (file:///b/s/w/ir/cache/builder/src/flutter/flutter_frontend_server/bin/starter.dart:8:30) #7 _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:305:32) #8 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:174:12) Target kernel_snapshot failed: Exception: Errors during snapshot creation: null build failed. FAILURE: Build failed with an exception. * Where: Script '/Users/nateshmbhat/Apps/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 780 * What went wrong: Execution failed for task ':flutter:compileFlutterBuildDebug'. > Process 'command '/Users/nateshmbhat/Apps/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 34s Finished with error: Gradle task assembleDebug failed with exit code 1

@escamoteur
Copy link
Collaborator

I guess it's because there is no version 3.1.0

try ^3.0.2 or better because it will be the future

get_it: 4.0.0-release-candidate

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