flutterdartdependenciesflutter-dependenciespubspec

Flutter | Error: Couldn't resolve the package


I created a package that is a collection of my own helper classes for faster developing...

The package also included firebase_analytics: which requires a native implementation for each platform i want it to run. Even if i dont wanted to use firebase at all, but still wanted to use my package i was forced to create firebase-config files for the app, because the app crashes if the firebase_analytics package does not find a valid file for the specific platform. To avoid those things i splitted my package in two packages.

  1. The Core-Package: All helper classes that run native dart code
  2. Optional extension: Only the classes that need the firebase implementation

So if i want to use the package without firebase i just have to depend on the core. If i want to use the firebase variant i could simply depend the firebase package, because the extension package itself depends on the core-package in its own pubspec.yaml file.

PROBLEM: Since i restructured my package like i described, all my apps that depend on it are not building anymore. The console says that all packages that i depend on in my two packages can not be found. This error occures both ways: With firebase & without.

ERROR: (Scroll down for the complete console output) Console-Error

MY ATTEMPTS:

CORE-PACKAGE Pubspec.yaml: essentials_core

FIREBASE-Extension Pubspec.yaml: essentials_firebase

Plain Console Output: pastebin.com/m14cbqDV

Thanks for any help!!


Solution

  • Sorry, my bad! As you can see i moved my dependencys to the dev section of my pubspec.yaml. They should be placed in the dependency section.