-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[bug]: Failed to write android google-services.json file on CI when using flutterfire reconfigure #365
Comments
@AhmedLSayed9 - Is there a stack trace to go with it? What does your |
{
"flutter": {
"platforms": {
"android": {
"buildConfigurations": {
"src/dev": {
"projectId": "REDACTED_PROJECT_ID",
"appId": "REDACTED_APP_ID",
"fileOutput": "android/app/src/dev/google-services.json"
},
"src/staging": {
"projectId": "REDACTED_PROJECT_ID",
"appId": "REDACTED_APP_ID",
"fileOutput": "android/app/src/staging/google-services.json"
},
"src/prod": {
"projectId": "REDACTED_PROJECT_ID_PRODUCTION",
"appId": "REDACTED_APP_ID_PRODUCTION",
"fileOutput": "android/app/src/prod/google-services.json"
}
}
},
"ios": {
"buildConfigurations": {
"Debug-dev": {
"projectId": "REDACTED_PROJECT_ID",
"appId": "REDACTED_APP_ID",
"uploadDebugSymbols": true,
"fileOutput": "ios/config/dev/GoogleService-Info.plist"
},
"Profile-dev": {
"projectId": "REDACTED_PROJECT_ID",
"appId": "REDACTED_APP_ID",
"uploadDebugSymbols": true,
"fileOutput": "ios/config/dev/GoogleService-Info.plist"
},
"Release-dev": {
"projectId": "REDACTED_PROJECT_ID",
"appId": "REDACTED_APP_ID",
"uploadDebugSymbols": true,
"fileOutput": "ios/config/dev/GoogleService-Info.plist"
},
"Debug-staging": {
"projectId": "REDACTED_PROJECT_ID",
"appId": "REDACTED_APP_ID",
"uploadDebugSymbols": true,
"fileOutput": "ios/config/staging/GoogleService-Info.plist"
},
"Profile-staging": {
"projectId": "REDACTED_PROJECT_ID",
"appId": "REDACTED_APP_ID",
"uploadDebugSymbols": true,
"fileOutput": "ios/config/staging/GoogleService-Info.plist"
},
"Release-staging": {
"projectId": "REDACTED_PROJECT_ID",
"appId": "REDACTED_APP_ID",
"uploadDebugSymbols": true,
"fileOutput": "ios/config/staging/GoogleService-Info.plist"
},
"Debug-prod": {
"projectId": "REDACTED_PROJECT_ID_PRODUCTION",
"appId": "REDACTED_APP_ID_PRODUCTION",
"uploadDebugSymbols": true,
"fileOutput": "ios/config/prod/GoogleService-Info.plist"
},
"Profile-prod": {
"projectId": "REDACTED_PROJECT_ID_PRODUCTION",
"appId": "REDACTED_APP_ID_PRODUCTION",
"uploadDebugSymbols": true,
"fileOutput": "ios/config/prod/GoogleService-Info.plist"
},
"Release-prod": {
"projectId": "REDACTED_PROJECT_ID_PRODUCTION",
"appId": "REDACTED_APP_ID_PRODUCTION",
"uploadDebugSymbols": true,
"fileOutput": "ios/config/prod/GoogleService-Info.plist"
}
}
},
"dart": {
"lib/firebase_options_dev.dart": {
"projectId": "REDACTED_PROJECT_ID",
"configurations": {
"android": "REDACTED_APP_ID",
"ios": "REDACTED_APP_ID"
}
},
"lib/firebase_options_staging.dart": {
"projectId": "REDACTED_PROJECT_ID",
"configurations": {
"android": "REDACTED_APP_ID",
"ios": "REDACTED_APP_ID"
}
},
"lib/firebase_options_prod.dart": {
"projectId": "REDACTED_PROJECT_ID_PRODUCTION",
"configurations": {
"android": "REDACTED_APP_ID_PRODUCTION",
"ios": "REDACTED_APP_ID_PRODUCTION"
}
}
}
}
}
} |
Have you reproducing locally? It's going to be one of these if it is android I think: https://github.com/invertase/flutterfire_cli/blob/main/packages/flutterfire_cli/lib/src/commands/reconfigure.dart#L393 Is the firebase.json in the root of the project? The firebase.json configuration seems correct to me. A local repro would be helpful. |
|
The difference is locally I'm logged in using |
Yes |
I don't think this should make a difference. Not sure what the problem is, It's saying something that is expected to be a map (from those lines I pasted earlier), is You ought to put some debug logs on firebase.json path, content, etc to find out why map is empty. It's clearly a difference between your CI and local environment. |
I was able to reproduce it using a minimal sample: https://github.com/AhmedLSayed9/firebase_test Check the workflow: https://github.com/AhmedLSayed9/firebase_test/actions/runs/12951734235/job/36127428141 To reproduce:
|
Is there an existing issue for this?
CLI Version
1.0.1
Firebase Tools version
13.29.1
Flutter Doctor Output
[✓] Flutter (Channel stable, 3.24.3, on macOS 15.2 24C101 darwin-arm64, locale en-EG)
• Flutter version 3.24.3 on channel stable at /Users/ahmedelsayed/.puro/envs/locals/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 2663184aa7 (4 months ago), 2024-09-11 16:27:48 -0500
• Engine revision 36335019a8
• Dart version 3.5.3
• DevTools version 2.37.3
Description
When using Firebase service account JSON file and use
flutterfire reconfigure
instead offlutterfire configure
on CI, it fails.This was requested before at #232
Steps to reproduce
Add Firebase service account JSON to your secrets and try running the following on CI:
env:
FIREBASE_SERVICE_ACCOUNT: ${{ secrets.FIREBASE_SERVICE_ACCOUNT }}
run: |
echo $FIREBASE_SERVICE_ACCOUNT > /tmp/google-application-credentials.json
env:
GOOGLE_APPLICATION_CREDENTIALS: /tmp/google-application-credentials.json
run: flutterfire configure ...... // Complete your project configurations
It should run successfully, but If you use
flutterfire reconfigure
, it'll fail with the following error:Expected behavior
I expect
flutterfire reconfigure
to work on CI.Screenshots
No response
Additional context and comments
No response
The text was updated successfully, but these errors were encountered: