What documentation are you looking at? According to Step 4: Add the Firebase configuration file you should " Add your config file to the same directory as your top-level build.gradle
file." That sounds like the method where the build succeeds should match that, no?
Please post your logs for when onlinesubsystem fails.