0

I got the following error when trying to run a cloud function::


Error: Failed to load function definition from source: Failed to generate manifest from function source: Error: Missing expected firebase config value databaseURL, config is actually{"projectId":"mynotes-b58d2","storageBucket":"mynotes-b58d2.appspot.com","locationId":"us-east4"}
 If you are unit testing, please set process.env.FIREBASE_CONFIG

I was told I need to add the following::

  "databaseURL":"https://xxxxx.firebaseio.com"

but I dont know where to add it, or what my baseURL is or where to find it

any help is welcomed

update::

i found where to add the info firebase_options.dart>DefaultFirebaseOptions.

now i need to kmwo what my base url should be

update. i think i got it but i wanna tripple check with somone

I added in two places::

  static const FirebaseOptions android = FirebaseOptions(
    apiKey: 'XXXX,
    appId: 'AAAA',
    messagingSenderId: '333333',
    projectId: 'mynotes-flutter-project',
    storageBucket: 'mynotes-flutter-project.appspot.com',
    databaseURL: "https://mynotes-b58d2-default-rtdb.firebaseio.com/",
  );

  static const FirebaseOptions ios = FirebaseOptions(
    apiKey: 'XXXX,
    appId: 'AAAA',
    messagingSenderId: '333333',
    projectId: 'mynotes-flutter-project',
    storageBucket: 'mynotes-flutter-project.appspot.com',
    iosClientId:
        '877208178211-pkk6a4dfdsmh1tfm4ffhdss9lmmjl0mc.apps.googleusercontent.com',
    iosBundleId: 'se.pixolity.mynotes',
    databaseURL: "https://mynotes-b58d2-default-rtdb.firebaseio.com/",
  );

is this correct?

update: its not working :(

1 Answer 1

0

I recommend letting the flutterfire CLI generate firebase_options.dart for you, instead of trying to update it manually.

If the file doesn't contain a database URL, that's because you hadn't initialized the database in the Firebase console when you ran flutterfire. After creating the database in the console, run flutterfire again to update the firebase_options.dart.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.