Я добавляю Firebase в существующее приложение с 3-мя buildTypes (отладка, постановка и выпуск). Также есть 2 варианта (живое и ложное), но я включаю имитацию только для отладочных сборок:
android.variantFilter { variant ->
if ((variant.buildType.name.equals('release') || variant.buildType.name.equals('staging'))
&& ((variant.getFlavors().get(0).name.equals('mock')))) {
variant.setIgnore(true);
}
}
Итак, есть 3 идентификатора приложения: me.app (выпуск), me.app.debug (отладка) и me.app.staging (подготовка). Как видно, есть только одно приложение для отладки, хотя есть 2 варианта (debugLive и debugMock)
На Firebase я создал 1 проект и добавил 3 приложения - по 1 для каждого идентификатора приложения. Я не дал ключ SHA1 для любого из этих приложений на данный момент. Я скачал google-services.json и поместил его в корневой каталог модуля базовых функций.
Я не могу синхронизировать проект с Gradle:
More than one variant of project :myapp-base-feature matches the consumer attributes:
- Configuration ':myapp-base-feature:mockDebugApiElements' variant android-aidl:
- Found artifactType 'android-aidl' but wasn't required.
- Required com.android.build.api.attributes.BuildTypeAttr 'debug' and found compatible value 'debug'.
- Found com.android.build.api.attributes.VariantAttr 'mockDebug' but wasn't required.
- Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found compatible value 'Aar'.
- Required mocking 'mock' and found compatible value 'mock'.
- Required org.gradle.usage 'java-api' and found compatible value 'java-api'.
- Configuration ':myapp-base-feature:mockDebugApiElements' variant android-classes:
- Found artifactType 'android-classes' but wasn't required.
- Required com.android.build.api.attributes.BuildTypeAttr 'debug' and found compatible value 'debug'.
- Found com.android.build.api.attributes.VariantAttr 'mockDebug' but wasn't required.
- Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found compatible value 'Aar'.
- Required mocking 'mock' and found compatible value 'mock'.
- Required org.gradle.usage 'java-api' and found compatible value 'java-api'.
- Configuration ':myapp-base-feature:mockDebugApiElements' variant android-manifest:
- Found artifactType 'android-manifest' but wasn't required.
- Required com.android.build.api.attributes.BuildTypeAttr 'debug' and found compatible value 'debug'.
- Found com.android.build.api.attributes.VariantAttr 'mockDebug' but wasn't required.
- Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found compatible value 'Aar'.
- Required mocking 'mock' and found compatible value 'mock'.
- Required org.gradle.usage 'java-api' and found compatible value 'java-api'.
- Configuration ':myapp-base-feature:mockDebugApiElements' variant android-renderscript:
- Found artifactType 'android-renderscript' but wasn't required.
- Required com.android.build.api.attributes.BuildTypeAttr 'debug' and found compatible value 'debug'.
- Found com.android.build.api.attributes.VariantAttr 'mockDebug' but wasn't required.
- Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found compatible value 'Aar'.
- Required mocking 'mock' and found compatible value 'mock'.
- Required org.gradle.usage 'java-api' and found compatible value 'java-api'.
- Configuration ':myapp-base-feature:mockDebugApiElements' variant jar:
- Found artifactType 'jar' but wasn't required.
- Required com.android.build.api.attributes.BuildTypeAttr 'debug' and found compatible value 'debug'.
- Found com.android.build.api.attributes.VariantAttr 'mockDebug' but wasn't required.
- Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found compatible value 'Aar'.
- Required mocking 'mock' and found compatible value 'mock'.
- Required org.gradle.usage 'java-api' and found compatible value 'java-api'.