1

I've setup Firebase App Distribution for my Flutter Project and it works perfectly local. But if I try to run it on Codemagic I get teh following error:

Error: failed to fetch app information. HTTP Error: 403, Firebase App Distribution API has not been used in project XXX before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/firebaseappdistribution.googleapis.com/overview?project=XXX then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.

The XXX are placeholders for a project ID. But I have no Project with that I. If I open the url I get a message that I'm not justified.

Here is my fastlane command:

  lane :deploy_dev_firebase do
      firebase_app_distribution(
          app: "***330f",
          testers: "***@gmail.com",
          release_notes: "release",
          firebase_cli_path: "/usr/local/bin/firebase",
          apk_path: "../build/app/outputs/apk/dev/release/app-dev-release.apk"
      )
  end

And my codemagic Post-build script:

#!/bin/bash

gem install bundler

cd android

bundle install

bundle exec fastlane deploy_dev_firebase
Dix20
  • 178
  • 2
  • 8
  • 2
    Hi, if project ID ends with `607` your script is conflicting with Codemagic account. Can you update your question with the script or with information how you authenticate in Firebase App Distribution – Mikhail Tokarev May 11 '20 at 15:33
  • Hi, I have added the scripts to my question. My project ID ends with 7bfd8 but my public project name is project-1060553826078. Could that be the problem? – Dix20 May 12 '20 at 05:17
  • 2
    add to your script next command `export GOOGLE_APPLICATION_CREDENTIALS=$FCI_BUILD_DIR/path/to/credentials/file.json` and it should work – Mikhail Tokarev May 12 '20 at 08:04
  • I added it in my codemagic script but I get the following error: Error: Command requires authentication, please run firebase login – Dix20 May 12 '20 at 08:54
  • is path to json file correct? – Mikhail Tokarev May 12 '20 at 16:22
  • hi! were you able to fix the issue? – Mikhail Tokarev May 21 '20 at 17:11
  • 2
    Hey! Yes, I've added the credentials from a wrong project. So after adding the correct credentials it works. Thank you for your help! – Dix20 May 23 '20 at 11:50

0 Answers0