I am developing an application using Expo. The application is registered on the Google Play Console, and currently, I have two different environments, Preview and Production. I need to create separate google-services.json files and set them up correctly for each of these environments. Also I use react-native-map but not firebase stuff.
Is there a recommended way to create and manage different google-services.json files for Preview and Production environments? Also, I would appreciate guidance on how to utilize these files in my Expo project and how to set them up on the Google Play Console.
Additionally, when I run the command eas build -e preview -p android --local, I encounter the following error:
FAILURE: Build failed with an exception.
[RUN_GRADLEW] * What went wrong:
[RUN_GRADLEW] Execution failed for task ':app:processReleaseGoogleServices'.
[RUN_GRADLEW] > Malformed root json
app.config.js
import 'dotenv/config'
import dayjs from 'dayjs'
const IS_DEV = process.env.APP_VARIANT === 'development'
const IS_PREVIEW = process.env.APP_VARIANT === 'preview'
export default {
expo: {
name: IS_PREVIEW ? 'a Dev' : 'a',
slug: 'a',
scheme: 'a',
version: '1.0.1',
orientation: 'portrait',
icon: './assets/splash.png',
userInterfaceStyle: 'light',
runtimeVersion: {
policy: 'sdkVersion'
},
splash: {
image: './assets/splash.png',
resizeMode: 'contain',
backgroundColor: '#ffffff'
},
assetBundlePatterns: [
'**/*'
],
extra: {
eas: {
projectId: ''
}
},
owner: 'a',
ios: {
supportsTablet: true,
// jsEngine: 'jsc',
bundleIdentifier: IS_PREVIEW ? 'a.dev' : 'a',
associatedDomains: ['applinks:a.dev'],
buildNumber: dayjs().format('YYYYMMDDHHmm')
},
android: {
package: IS_PREVIEW ? 'a.dev' : 'a',
// jsEngine: 'jsc',
googleServicesFile: IS_PREVIEW ? './google-services-dev.json' : './google-services.json',
adaptiveIcon: {
foregroundImage: './assets/splash.png',
backgroundColor: '#ffffff'
},
config: {
googleMaps: {
apiKey: IS_PREVIEW ? 'a' : 'b'
}
},
intentFilters: [
{
action: 'VIEW',
autoVerify: true,
data: [
{
scheme: 'https',
host: 'a.dev',
pathPrefix: '/a'
}
],
category: ['BROWSABLE', 'DEFAULT']
}
]
},
web: {
favicon: './assets/favicon.png'
},
plugins: [
[
'@stripe/stripe-react-native',
{
merchantIdentifier: '',
enableGooglePay: false
}
]
],
updates: {
url: 'https://a'
},
jsEngine: 'hermes'
}
}
If there are any solutions or information related to this error, I would appreciate it if you could share that as well.
I also have a feeling that creating a new project on the Google Play Console might be the only way to resolve this issue, but I would like to know if there are any other methods.
Thank you for your assistance.