Skip to content

Conversation

@salahamassi
Copy link

Description

Firebase CLI will try to get all flavors for the android project and variant build configrations for the ios project
and show a prompt to the ser

? Do you want to create a firebase project for each flavor? (y/n)

if the user selects "y" for each flavor firebase CLI will create a firebase project with selected platforms

  • create firebase_options.dart for each flavor
    For example:
    (lib/firebase_options_development.dart,
    lib/firebase_options_production.dart,
    lib/firebase_options_staging.dart)

  • create firebase_app_id_file.json for each flavor
    For example:
    (ios/firebase_app_id_file_development.json,
    ios/firebase_app_id_file_production.json,
    ios/firebase_app_id_file_staging.json)

  • create google-services.json for each flavor
    For example:
    (android/app/src/development/google-services.json,
    android/app/src/production/google-services.json,
    android/app/src/staging/google-services.json)

  • create GoogleService-Info.plist for each flavor
    For example:
    (ios/Runner/development/GoogleService-Info.plist,
    ios/Runner/production/GoogleService-Info.plist,
    ios/Runner/staging/GoogleService-Info.plist)

For ios Project add shell script to copy the correct GoogleService-Info.plist to the BUILT_PRODUCTS_DIR based on the selected ios schema:

GOOGLE_SERVICE_INFO_PLIST_FROM="${PROJECT_DIR}/Runner/${FLAVOR}/GoogleService-Info.plist"
BUILD_APP_DIR="${BUILT_PRODUCTS_DIR}/${FULL_PRODUCT_NAME}"
GOOGLE_SERVICE_INFO_PLIST_TO="${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app"
cp "${GOOGLE_SERVICE_INFO_PLIST_FROM}" "${GOOGLE_SERVICE_INFO_PLIST_TO}"

Please try it 🙏🚀

Type of Change

  • feat -- New feature (non-breaking change which adds functionality)
  • 🛠️ fix -- Bug fix (non-breaking change which fixes an issue)
  • ! -- Breaking change (fix or feature that would cause existing functionality to change)
  • 🧹 refactor -- Code refactor
  • ci -- Build configuration change
  • 📝 docs -- Documentation
  • 🗑️ chore -- Chore

@salahamassi
Copy link
Author

I opened this PR based on this issue
#14

@Lyokone
Copy link
Contributor

Lyokone commented Jul 18, 2022

I've try the PR using the VGV CLI:

very_good create project --desc "Project" --org "com.lyokone.project" 

It produces the following result:

FileSystemException: Cannot open file, path = 'project/android/app/src/production/google-services.json' (OS Error: No such file or directory, errno = 2)

I feel like matching the name of the flavor with a folder can produce unexpected results on Android 🤔

FileSystemException: Cannot open file, path = 'project/android/app/src/production/google-services.json' (OS Error: No such file or directory, errno = 2)
@salahamassi
Copy link
Author

I've try the PR using the VGV CLI:

very_good create project --desc "Project" --org "com.lyokone.project" 

It produces the following result:

FileSystemException: Cannot open file, path = 'project/android/app/src/production/google-services.json' (OS Error: No such file or directory, errno = 2)

I feel like matching the name of the flavor with a folder can produce unexpected results on Android 🤔

I think Each flavor must have a folder with its name

I tried to fix this by checking if the folder exists before creating androidGoogleServicesJsonFile
any suggestions?

@ulisseshen
Copy link

any news about this PR?

@Lyokone
Copy link
Contributor

Lyokone commented Nov 22, 2022

@ulisseshen, @russellwheatley is currently working on this feature in this PR: #132

@ulisseshen
Copy link

@ulisseshen, @russellwheatley is currently working on this feature in this PR: #132

thanks for response.

@russellwheatley
Copy link
Member

Closing as this is no longer necessary. See #132

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants