google / google/play-services-plugins

GoogleServicesPlugin::getJsonLocations not returning all expected paths

Open
#280 0 comments 2 reactions 0 assignees View on GitHub
Dominant language
Kotlin
Stars
526
Forks
167
Avg merge
7d 21h
Merged PRs (30d)
2

Description

**Describe the bug**
The current implementation of the `GoogleServicesPlugin::getJsonLocations` concatenates `fileLocation` variable with new flavor values without ever reseting it to the `src` value. So the function with input paramters `('buildType', ['first', 'second'])` only returns `src/first/google-services.json` and not the `src/second/google-services.json` as the location to look for (it'll return `src/first/second/google-services.json` path instead).

**To Reproduce**
Steps to reproduce the behavior:
1. Call `GoogleServicesPlugin::getJsonLocations` with input parameters where flavor list is longer than one
2. Check the contents of the list that's returned from `GoogleServicesPlugin::getJsonLocations`

**Expected behavior**
`GoogleServicesPlugin::getJsonLocations` returns `src/flavorName/google-services.json` for every `flavorName` in the input parameter list.

**Desktop (please complete the following information):**
- Plugin name and version: current HEAD @ `master`

**Additional context**
Here's a small kotlin snippet that tests the returned values for multi flavor input [https://pl.kotl.in/NE02tm42_](https://pl.kotl.in/NE02tm42_)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.