2

I am trying to run the task crashlyticsUploadMappingFileRelease however, it fails with "Google App ID not found"

I do not want to have google play services plugin in my app. How do I make it find the app ID?

Lena Bru
  • 13,521
  • 11
  • 61
  • 126
  • 1
    looking here at step 3 (`https://firebase.google.com/docs/android/setup`) it seems that to use any firebase library, you need to add google Services plugin (ie `'com.google.gms:google-services:4.3.3')` is it what you don't want to add? – benjiii Sep 29 '20 at 09:57
  • yes this is what i do not want to add – Lena Bru Sep 29 '20 at 10:05
  • well, can I ask why you want that? Firebase is owned by Google so I'm pretty sure google forces you to add this in order to use firebase – benjiii Sep 29 '20 at 10:06
  • I am supporting multiple apps in my code, i want to control manually which app does what. However, the mapping file is universal to the apk, and it will no longer upload it because i removed google play services. I removed google play services because it is a requirement for the app to work. (china....) – Lena Bru Sep 29 '20 at 10:11
  • well, most firebase products do not work in China,m because of google and Crashlytics seems to be one of them (`https://github.com/firebase/firebase-ios-sdk/issues/5599`) – benjiii Sep 29 '20 at 10:16
  • You could still use google services and Crashlytics, you app would still work in China, except the part using crashlytics (so you would not receive any crash reports). An app I am working on uses Firebase for outside China and an alternative in China, and having libraries from google doesn't prevent the app from working in China, just the functionalities using google products – benjiii Sep 29 '20 at 10:19
  • @LenaBru: You should be able to pass the necessary configuration data in your code instead of through the `google-services.json`. For an example of this, see: https://firebase.google.com/docs/projects/multiprojects#use_multiple_projects_in_your_application Can you show how you call `FirebaseApp.initializeApp` in your code? – Frank van Puffelen Sep 29 '20 at 13:40

1 Answers1

0

I got the same problem and spent a lot of time to solve it. Finally I got success result. So, you have to add this

firebaseCrashlytics {
    mappingFileUploadEnabled false
}

to release (or every) build type in your project - module level build.gradle. See this for details.

Later in the code you have to initialize the firebase app by calling

FirebaseApp.initializeApp(context, options);

FirebaseCrashlytics will be initialized as well.

NOTE:

This approach has one disadvantage. If you use obfuscation, crashes in the firebase console will also be obfuscated

Hope this will help you or anyone else.

Dmitriy Mitiai
  • 1,112
  • 12
  • 15
  • That is exactly what i want to avoid. I want to invoke the upload manually. How do I upload the mapping file manually? – Lena Bru Nov 05 '20 at 17:09
  • According to this answer: https://stackoverflow.com/a/47291552/4730040 There is no way to upload mapping file manually. – Dmitriy Mitiai Nov 06 '20 at 07:07