What I am doing
I am trying to use FastLane and plugin firebase_app_distribution to automate the CI process to Firebase App Distribution.
Here is my lane script
lane :distribute do
build_android_app(task: "assemble", build_type: 'Release')
# build_android_app is a built-in fastlane action.
release = firebase_app_distribution(
app: "1:123456789:android:abcd1234",
testers: "[email protected]",
release_notes: "Lots of amazing new features to test out!",
android_artifact_type: "APK",
android_artifact_path: "../build/app/outputs/apk/release/app-release.apk",
service_credentials_file: "/Users/xxx/codes/keys/xxx/solid-memory-9bf9c-c7915024732b.json",
debug: true
)
end
Here is the error I get
/opt/homebrew/Cellar/fastlane/2.227.0/libexec/gems/fastlane-2.227.0/fastlane_core/lib/fastlane_core/ui/interface.rb:129:in 'FastlaneCore::Interface#crash!': [!] The authenticated user does not have the required permissions on the Firebase project (FastlaneCore::Interface::FastlaneCrash)
from /opt/homebrew/Cellar/fastlane/2.227.0/libexec/gems/fastlane-2.227.0/fastlane_core/lib/fastlane_core/ui/ui.rb:17:in 'FastlaneCore::UI.method_missing'
from /Users/jasonching/.local/share/fastlane/3.4.0/gems/fastlane-plugin-firebase_app_distribution-0.10.0/lib/fastlane/plugin/firebase_app_distribution/actions/firebase_app_distribution_action.rb:307:in 'Fastlane::Actions::FirebaseAppDistributionAction.upload_binary'
from /Users/jasonching/.local/share/fastlane/3.4.0/gems/fastlane-plugin-firebase_app_distribution-0.10.0/lib/fastlane/plugin/firebase_app_distribution/actions/firebase_app_distribution_action.rb:60:in 'Fastlane::Actions::FirebaseAppDistributionAction.run'
from /opt/homebrew/Cellar/fastlane/2.227.0/libexec/gems/fastlane-2.227.0/fastlane/lib/fastlane/runner.rb:263:in 'block (2 levels) in Fastlane::Runner#execute_action'
from /opt/homebrew/Cellar/fastlane/2.227.0/libexec/gems/fastlane-2.227.0/fastlane/lib/fastlane/actions/actions_helper.rb:69:in 'Fastlane::Actions.execute_action'
from /opt/homebrew/Cellar/fastlane/2.227.0/libexec/gems/fastlane-2.227.0/fastlane/lib/fastlane/runner.rb:255:in 'block in Fastlane::Runner#execute_action'
from /opt/homebrew/Cellar/fastlane/2.227.0/libexec/gems/fastlane-2.227.0/fastlane/lib/fastlane/runner.rb:229:in 'Dir.chdir'
from /opt/homebrew/Cellar/fastlane/2.227.0/libexec/gems/fastlane-2.227.0/fastlane/lib/fastlane/runner.rb:229:in 'Fastlane::Runner#execute_action'
from /opt/homebrew/Cellar/fastlane/2.227.0/libexec/gems/fastlane-2.227.0/fastlane/lib/fastlane/runner.rb:157:in 'Fastlane::Runner#trigger_action_by_name'
from /opt/homebrew/Cellar/fastlane/2.227.0/libexec/gems/fastlane-2.227.0/fastlane/lib/fastlane/fast_file.rb:159:in 'Fastlane::FastFile#method_missing'
from Fastfile:57:in 'block in Fastlane::FastFile#parsing_binding'
User Roles
The service account has these roles:
Firebase App Distribution API is enabled These roles are added to the service account:
- Editor
- Firebase Admin
- Firebase App Distribution Admin
- Firebase App Distribution Admin SDK Service Agent
- Firebase Test Lab Admin
I am pretty sure the issue is not caused by account permission. I have tried using my Owner account and firebase login without setting the service_credentials_file in above script. It's showing the same error.
I am able to upload the apk to firebase manually.
Would really appreciate if someone can help. Thanks!