0

I'm trying to use flutterfire_ui for authentication in a flutter app. The developer (invertase) has committed a pull request 9343 on github that fixes some problems. I have pulled it into a local GIT folder. It includes some reorganization of folders, including a package name change - firebase_ui_auth instead of flutterfire_ui. I have changed my local pubspec.yaml to use all the firebase packages in PR 9343 but I get an error with "pub get" as follows that I am unable to resolve.

Running "flutter pub get" in firebase_with_flutter...
Because every version of firebase_ui_oauth from path depends on firebase_ui_auth from hosted and firebase_with_flutter depends on firebase_ui_auth from path, firebase_ui_oauth from path is forbidden. So, because firebase_with_flutter depends on firebase_ui_oauth from path, version solving failed. pub get failed (1; So, because firebase_with_flutter depends on firebase_ui_oauth from path, version solving failed.)

In pubspec.yaml I have entered an explicit path to all of the PR9343 firebase packages

firebase_core:
  path: C:/GP/project/git-remote/flutterfire/packages/firebase_core/firebase_core/
cloud_firestore:
  path: C:/GP/project/git-remote/flutterfire/packages/cloud_firestore/cloud_firestore/
firebase_auth:
  path: C:/GP/project/git-remote/flutterfire/packages/firebase_auth/firebase_auth/
firebase_ui_auth:
  path: C:/GP/project/git-remote/flutterfire/packages/firebase_ui_auth/
firebase_ui_oauth:
  path: C:/GP/project/git-remote/flutterfire/packages/firebase_ui_oauth/

In main.dart android studio reports "invalid URI" for this import

import 'package:firebase_ui_auth/firebase_ui_auth.dart';

https://github.com/firebase/flutterfire/tree/master/packages/flutterfire_ui

Does anyone have any idea what I am doing wrong?

Alpha
  • 89
  • 7
  • Does this answer your question? [How to add a package from GitHub in Flutter?](https://stackoverflow.com/questions/54022704/how-to-add-a-package-from-github-in-flutter) – Yayo Arellano Aug 25 '22 at 00:37
  • Thanks for the suggestion but it didn't help. I'm wondering if it's something to do with the fact that the pubspec.yaml files in my local git repo specify dependency on the new packages but don't specify any paths - so I tried copying all the new packages etc. into pub.dartlang.org but it didn't help. – Alpha Aug 25 '22 at 03:06

1 Answers1

0

If I add explicit paths to the pubspec.yaml files in my local git repo just as I have for my own pubspec.yaml file then it works and pub get runs without error. So now I have this

      firebase_auth: 
        path: C:\GP\project\git-remote\flutterfire\packages\firebase_auth\firebase_auth\

instead of this firebase_auth: ^3.6.2

How come it works for the Invertase developer without using path settings and not for me. As well as that, the firebase_auth package is in a "deeper folder" C:\GP...\packages\firebase_auth\firebase_auth\ than it was before and if I leave off the inner \firebase_auth from the path it doesn't work.

Maybe I'm supposed to use the git mechanism instead of an explicit path setting.

Alpha
  • 89
  • 7