How to upload a mapping file to Firebase? - android

I've been looking around the firebase console for half an hour for a button or menu allowing me to upload a new crash reporting mapping file. And cannot find a way. I've done it in the past, but cannot work out how now. Perhaps something has changed. It would be nice to have a big button on the screen saying "upload a new mapping file" wouldn't it? Can someone put me out of my misery?

Sorry if I'm late, but instead of creating an exception, like some suggest, here is a cleaner official way Firebase docs suggest. This guide will teach you how to automatically push the release apk mapping to Firebase Crash Reporter from your Android Studio IDE.
Go to the Get deobfuscated crash reports section. I'll cover some maybe-hard to follow points in that guide.
Add all gradle lines as suggested in the docs
Download the Private Key file as suggested
Copy this Private Key file to the root folder of your project
In your gradle.properties file, add this line FirebaseServiceAccountFilePath=../name-of-downloaded-file.json
In terminal, at the root of your project, run this line ./gradlew :app:firebaseUploadReleaseProguardMapping.
This will build the release apk and upload it's mappings to Firebase in one shot.
Just keep in mind that if you're using a version control or open sourcing your project, keep your Private Key file ignored or kept safe from other team members.
Note that, you can also assign a shortcut to run this arcane gradle command by clicking on Gradle tab on right-hand-side. Then (root) -> Tasks -> Other -> firebaseUploadReleaseProguardMapping (right-click on this). Then add your favourite shortcut :)

MANUALLY UPLOAD "mapping.txt" WITHOUT GRADLE TASK
Mapping file is Application Based
Mapping files are Application Version Based
So you have to upload mapping.txt file to firebase console after each version release.
After first crash or error is reported for a given app version, you can manually upload mapping.txt file.
You can find the file to upload at a file path that is similar to the following, but specific to your app:
<project root>/<module name>/build/outputs/mapping/<build type>/<appname>-proguard-mapping.txt
Example:
app/build/outputs/mapping/debug/app-proguard-mapping.txt
At Firebase Console,
Go to,
Firebase Console > Select Your App > Select "Crash Reporting" From Left Menu > Navigate To "MAPPING FILES" Tab > Press "UPLOAD" Against Your App Version. > DONE
See screenshot,
READ HERE
Official instruction for manual mapping file upload to firebase console

Try to open newly published app in your phone. It might send the signal to the firebase about new version.

On the screen that you're showing, the dates are showing when you last uploaded a mappings file for that app version. Now, hover the mouse over one of those rows. Notice the three dots menu icon on the right. Click that. Delete the mapping file. Then, then you should have the option to upload a new one.
There will also be a way to upload mappings files using a Gradle plugin coming in the future.

Related

I want to disable android.permission.ACCESS_BACKGROUND_LOCATION in my Xamarin app

I want to disable android.permission.ACCESS_BACKGROUND_LOCATION in my Xamarin app because I dont need it anymore but when I uncheck the checkbox in the Properties tab:
And delete the permission request in the android.manifest file itself:
The permission request still seems to be there according to the manifest file from the archived .aab file and also according to the google play dev console.
I also searched my entire solution and dident find any other references.
Is there anything that causes this request or anything I forgot to delete?
Check the merged AndroidManifest.xml in obj\Release\nnn\.
If it is there, then something in your build process has added it.
If it is not there, then add to your question more details about how you build and launch to google play dev console - what you are seeing at dev console should match what is in the obj version of that file.
It was defined in the AssemblyInfo.cs and after removing it there everything was fixed.

Unity Generation of the Firebase Android resource file google-services.xml from Assets/GoogleService-Info.plist failed

I would like to setup Firebase in Unity 2020.1.14.
I downloaded the GoogleService-Info.plist into my assets folder and set up a project in the Firebase console.
But as soon as I import the FirebaseAnalytics 7.0 package I'm getting this error:
Generation of the Firebase Android resource file google-services.xml from Assets/GoogleService-Info.plist failed.
If you have not included a valid Firebase Android resources in your app it will fail to initialize.
"python" "/Users/joerg/Projekte/UnityTest/FirebaseTest2012042/Assets/Firebase/Editor/generate_xml_from_google_services_json.py" -i "Assets/GoogleService-Info.plist" -l --plist
Could not find key in plist file: [DATABASE_URL]
How do I set the [DATABASE_URL] in GoogleService-Info.plist?
Thanks
Joerg
This was really frustrating. There is no mention on the original setup tutorial about this issue. I'm assuming more people are going to run in to this problem. So here is the solution:
Go to Firebase Console
Choose your project
Go to "Realtime Database"
Create Realtime Database
After database is created.
Go to "Project Settings"
Download google-services.json and GoogleService-Info.plist
Replace these files in you Unity project. (these files should be inside of the Assets folder, or if you've created a Data folder, then you can find them there.)
In the newly generated files there is a "firebase_url":. Which was missing before. This should now fix this particular error message.
Ok, I found the solution: I just had to setup a database in the Firebase Console and then the url is written to the plist file.
This wasn't mentioned in the Google tutorial.
Simple solution, just add those lines:
<key>DATABASE_URL</key>
<string>https://unexisting.fake.database.firebaseio.com</string>
p.s. I would not recommend enabling database service since it's paid. If for some reason, some plugin will attempt to use it in some way, you will be charged. The only reason I am not using those awesome paid services from Google is that they are only POST PAID without ability to set limit (except you wrote some complicated script yourself which will run in real time and will turn off services once you reach certain limit). There are lot of developers stories who woke up with 5-10k bills due to some error in script.

E/FirebaseCrashlytics: Failed to retrieve settings from https://firebase-settings.crashlytics.com/spi/v2/platforms/android/gmp/XXXX/settings

I tried new Firebase Crashlytics SDk after migrating from Fabric and seem to run into a weird issue.
Crash logs are not captured in dashboard after upgrading firebase-crashlytics to 17.0.0 and I get this error in log:
E/FirebaseCrashlytics: Failed to retrieve settings from https://firebase-settings.crashlytics.com/spi/v2/platforms/android/gmp/XXXX/settings
and I followed all instructions from firebase console quickstart guide. Please help me if any one have faced similar issue.
In my case, I had migrated the release version but I guess I never enabled Crashlytics on the Firebase console for the debug variant.
A simple mistake, but putting it here in case it helps out someone else.
If you enabled multiple apps in single project, ensure you choose the correct one (left drop down menu choose the correct project which hold the multiple apps, right drop down menu choose the correct running app). I made such mistake and keep looking on the wrong app page and enabling Crashlytics on the wrong app and of course I get that error "Failed to retrieve settings from https://...:
In my case, There was a legacy firebase project which using same package name of app. When I deleted legacy firebase project and It's works like a charm!
Firebaser here -
We often see these kinds of errors after upgrading due to some sort of configuration error when you were switching out your dependencies. Did you make sure to follow all the steps in this guide?
You may also want to enable Crashlytics debug logging and force a test crash to see if the logs give you any other output. And it may help to edit your original question with your Gradle files and any other relevant Crashlytics setup.
Same problem here with 17.2.1, one of my app flavours didnt't work throwing above error. Removing current apps and re-adding them in firebase project settings solved the problem for me.
We had an issue with the firebase apps and had to re-create the android app on firebase. This meant I had to update the google-services.json file.
After doing this, firebase remote config worked but analytics and crashlytics did not.
Turns out android studio was using-an auto generated file values.xml. This contained
<string name="google_app_id" translatable="false">1:xxxxxxx:android:yyyyyyyy</string>
The yyyyyy part of it was still using the old value from the previous google-services.json file. Deleting this file for all flavors, debug and release builds, coupled with an invalidate caches + restart
might do the trick, but just to be safe, what fixed it for me was:
commenting all the firebase libs from all gradle files
syncing gradle
project will not compile at this points since it cant find Firebase dependencies
invalidate caches + restart
uncomment firebase libs in all gradle files
sync gradle
run app and check if firebase crashlytics works
I am using Android studio 4.1.2
If you have changed the google-services.json file, i.e changed it with a one from a different project, you should do the following:
Comment out all the crashlytics dependencies in the gradle files
Build the app
Invalidate cache and restart
Uncomment crashlytics dependencies and rebuild app
This should fix the problem if it's caused by cached values from the previous json file for crashlytics.

Firebase android distribution won't allow applicationIdSuffix

When running ./gradlew appDistributionUploadDevDebug I get an error saying it can't find the app.
The culprit is having applicationIdSuffix = ".dev" in my dev flavor. Removing it allows the apk to be uploaded, but then the artifact wouldn't be built properly. For the record I plan using only the dev flavor for internal distribution.
I get an error message saying I should enable app distribution, but since this is done on a "firebase project" level and it's done for the main flavor I can't do it again.
* What went wrong:
Execution failed for task ':app:appDistributionUploadDevDebug'.
> App Distribution could not find your app 1:xxxxxxxxx:android:0b3f<xxxxxxxxx>.
Make sure to onboard your app by pressing the "Get started" button on the App Distribution page in the Firebase console:
https://console.firebase.google.com/project/_/appdistribution
Documenting this as a bug, I'll add a reply since I found a workaround.
Edit: expanded name of gradlew task that was shortened. Though it works it may make for easier searching.
Workaround:
To fix open app/google-services.json and look for the mobilesdk_app_id key for the main package name.
For example in my case I noticed that 1:xxxxxxx:android:0b3f<xxxxxxx> was the value for the package with the .dev suffix, while the main package name (without .dev) shows under 1:xxxxxxx:android:7eb88<xxxxxxxx>
So heading to app/build.gradle, the firebaseAppDistribution block would look like this
firebaseAppDistribution {
appId = "1:xxxxxxxx:android:7eb88<xxxxxxxx>"
I still think this is a bug in firebase distribution. Sounds like the distribution gradle code is picking the right value, but the distribution server is not compatible.
BTW When the developer wants/needs to have 2 separate firebase projects you need to download 2 separate google-services.json files, and place them in the appropriate flavor folders. I also have a (2nd and 3rd) app that shares a project with that setup, but haven't added firebase distribution yet to check how it behaves.
For reference, my workaround worked while providing a serviceCredentialsFile. I also tried using the web token authentication but my results were inconclusive.
I thought that would be the case, but it turns out that you have to enable app distribution for each apk (buildType and/or flavor).
When selecting a project on the firebase console, the page automatically selects one of the apps and I was just enabling app distribution for that one.
There's a dropdown at the top where you can select another app (build/flavor), and you have to go to each one individually and enable app distribution.
I hope this helps someone else.

Firebase crash: how programmatically upload mapping file?

Firebase crash is a cool tool but as fair as I know there is not any way to programmatically upload Proguard mapping file via API after a build.
Recently, "automate file uploads" options appairs but no info are actually aviable in the learn more link.
Does anyone know something more?
On 15th December the Crash Reporting plugin was released by google: it will generate a gradle task that performs the upload of ProGuard mappings file to Firebase Crash.
Here the steps to use it:
https://firebase.google.com/docs/crash/android#uploading_proguard_mapping_files_with_gradle
Unfortunately, this looks to be an IOS only feature right now: https://firebase.google.com/docs/crash/ios#upload_symbol_files.
Upload symbol files
In order to view human friendly crash reports, you need to upload symbol files after each build. This can be done automatically by adding a run script to Xcode.
Download a service account key to authenticate your uploads. From the Firebase console, select your project and then click Generate New Private Key.
In Xcode, click on your application target, select Build Phases, and click + to add a phase.
Select Run Script and add the following content, setting appropriate values for your service account path and GOOGLE_APP_ID:
Replace this with the GOOGLE_APP_ID from your GoogleService-Info.plist file
GOOGLE_APP_ID=1:my:app:id
Replace the /Path/To/ServiceAccount.json with the path to the key you just downloaded
"${PODS_ROOT}"/FirebaseCrash/upload-sym "/Path/To/ServiceAccount.json"
Note: If your service account key changes, reset your OAuth credentials by running this command:
rm $HOME/Library/Preferences/com.google.SymbolUpload*

Categories

Resources