0

I integrated pinpoint analytics into one of our Android apps. (by following the GettingStarted guide [https://aws-amplify.github.io/docs/android/start] ). I added a few events and they got submitted successfully to pinpoint console after deploying this app. to an Android Phone.

So i committed the changes and asked a teammate to try this out. When he built the app. and ran it, it crashed with the following error:

*java.lang.RuntimeException: Failed to read awsconfiguration.json please check that it is correctly formed*

I was hoping that after committing the amplify files along with the .gitignore suggestions by amplify , the amplify environment and authentication details would get saved , but it doesn't seem so as the code looks for an awsconfiguration.json file but that isn't committed due to .gitignore changes by amplify.

What am i missing here? I am sharing a list of the amplify files that got committed and .gitignore updates below:

Amplify files that got committed:

amplify/.config/project-config.json
amplify/backend/analytics/helixandroid/parameters.json
amplify/backend/analytics/helixandroid/pinpoint-cloudformation-template.json
amplify/backend/auth/cognito*/*-cloudformation-template.yml
amplify/backend/auth/cognito*/parameters.json
amplify/backend/backend-config.json
amplify/team-provider-info.json 

Amplify additions to my .gitignore file.

#amplify
amplify/\#current-cloud-backend
amplify/.config/local-*
amplify/backend/amplify-meta.json
amplify/backend/awscloudformation
build/
dist/
node_modules/
aws-exports.js
awsconfiguration.json
nikel
  • 3,402
  • 11
  • 45
  • 71

1 Answers1

0

This two file aws-exports.js and awsconfiguration.json are the same meaning as .env

So everyone can have their own setting

Create a copy aws-exports.js and name it aws-exports.mysetting.js

When others run your project

cp aws-exports.mysetting.js aws-exports.js

ZedPai
  • 387
  • 2
  • 8