Apr 18 | 7:20 PM |
Mark M. | has entered the room |
Apr 18 | 7:25 PM |
Mark M. | turned on guest access |
Apr 18 | 7:30 PM |
Eric | has entered the room |
Eric |
hey mark
|
Mark M. |
hello, Eric!
|
Mark M. |
how can I help you today?
|
Apr 18 | 7:35 PM |
Mark M. |
so... do you have a question?
|
Eric |
yes hold on
|
Apr 18 | 7:40 PM |
Eric |
I created 2 product flavors, "orig" and "newFeature". newFeature can do additional things. I created a new folder by going to project view and right clicking to create new dir src/newFeature. I added the java files affected for newFeature. The java files contain all the code in the orig flavor + new methods, etc. The resources in the newFeature flavor only contain the additional dimensions and colors. When I attempt to build the debugnewFeature I get an error that it doesn't recognize the package name com.myapp.debugSuffix.newFeature
|
Mark M. |
can you post the relevant portion of the build output?
|
Mark M. |
or, if this message is not a compile error, where is this message appearing?
|
Apr 18 | 7:45 PM |
Eric |
View paste
|
Eric |
it's a build error appearing in Build
|
Mark M. |
is the comma in com.myapp.newFeatureSuffix,debugSuffix a typo in what you posted here?
|
Eric |
yes it is. Here is the detailed error sorry: Execution failed for task ':app:processNewFetureDebugGoogleServices'
|
Mark M. | |
Eric |
yep saw that last night
|
Eric |
here's the kicker
|
Apr 18 | 7:50 PM |
Mark M. |
I don't use the Play Services plugin, mostly because I don't use Play Services very much, but it appears that you need dedicated google-services.json files per flavor, or perhaps per build variant
|
Eric |
in my payments google-services.json the package_name is "com.myapp.newFeature". However I have a debug build type with applicationIdSuffix "debugSuffix". The former works for a release build type while the latter works for a debug build type. How do I change this file if I have a debug and release
|
Mark M. |
you could try having dedicated google-services.json files per build variant, with the applicationId for that build variant in them
|
Mark M. |
so, you would have a newFeatureDebug/google-services.json file that has the full package name for that build variant in it
|
Mark M. |
and so on for any other build variant you want to build
|
Apr 18 | 7:55 PM |
Eric |
debug is a buildType that is a sibling directory to newFeature which is a productFlavor. are you suggesting making another debug directory inside newFeature with the json file
|
Mark M. |
no, I am suggesting making a src/newFeatureDebug/ directory, as a peer of src/debug/ and src/newFeature/
|
Mark M. |
src/debug/ is a source set for all debug builds
|
Mark M. |
src/newFeature/ is a source set for all newFeature builds
|
Mark M. |
src/newFeatureDebug/ is a source set for newFeature debug builds
|
Eric |
where does src/main fit
|
Mark M. |
that is alongside the others, and it contains the code to use for all builds
|
Mark M. | |
Eric |
so would I create src/newFeatureRelease also?
|
Mark M. |
if you plan on building it, presumably yes
|
Eric |
ok I'll give that a shot thanks
|
Mark M. |
basically, my interpretation of what I'm reading is that you need a google-services.json file that contains the applicationId of the build that you're building
|
Eric |
yes
|
Mark M. |
some people only put suffixes on either the flavor or the build type, in which case they would only need customized google-services.json files for the flavor or build type
|
Eric |
but i was confused since I had src/debug, src/release, src/newFeature
|
Mark M. |
you're using both suffixes, so I think you'll need JSON files per build variant
|
Eric |
hmm how would you differentiate between them then
|
Mark M. |
they are each in a separate directory
|
Mark M. |
src/newFeatureDebug/google-services.json
|
Mark M. |
src/newFeatureRelease/google-services.json
|
Mark M. |
src/origDebug/google-services.json
|
Apr 18 | 8:00 PM |
Mark M. |
src/origRelease/google-services.json
|
Mark M. |
and others if you add more build types or more product flavors
|
Eric |
thanks, i was referring to why people wouldnt put suffixes for both buildtype and product flavor.
|
Mark M. |
oh, sorry
|
Eric |
np
|
Mark M. |
for build types, you only need suffixes if you plan on running both types of builds on the same device or emulator
|
Mark M. |
for a solo developer, you might do that
|
Mark M. |
but for a larger project with a development team plus dedicated QA staff and stuff, developers might only ever run debug builds normally
|
Mark M. |
in which case you might not need to add a suffix for the build type
|
Mark M. |
plus, not everybody uses product flavors
|
Apr 18 | 8:05 PM |
Eric |
dang it didnt work
|
Mark M. |
same error?
|
Mark M. |
also, I think you need to configure matching stuff in your Play Developer Console or some such
|
Mark M. | |
Mark M. |
looks like you can do this with one JSON file containing all the configurations, but the Firebase Console needs matching data
|
Eric |
cool thanks I'll check it out. That's all for now!
|
Mark M. |
sorry I didn't have a quick-and-easy solution!
|
Eric |
it's hard to do so without looking at the code :)
|
Mark M. |
that, and Firebase isn't my jam
|
Mark M. |
(strawberry is my jam)
|
Eric |
thank you, this was helpful though
|
Apr 18 | 8:10 PM |
Eric |
oh sorry one last thing. if the only difference between the newFeaturedebug and newFeaturerelease build variants is google-services.json, could I have a src/newFeature folder with code common to both variants, and just put the sole file in src/newFeaturedebug and src/newFeaturerelease?
|
Apr 18 | 8:15 PM |
Mark M. |
yes
|
Eric |
awesome
|
Eric |
goodnight
|
Mark M. |
though, as that blog post indicates, you may not need per-build-variant JSON files -- you may be able to configure all the build variants in one JSON file
|
Eric | has left the room |
Eric | has entered the room |
Eric |
doh sorry left too soon, what
|
Mark M. |
though, as that blog post indicates, you may not need per-build-variant JSON files -- you may be able to configure all the build variants in one JSON file
|
Eric |
ok ill need to read it
|
Eric |
will try
|
Eric |
goodnight
|
Mark M. |
have a pleasant evening!
|
Eric | has left the room |
Apr 18 | 8:25 PM |
Mark M. | turned off guest access |