After adding Fabric app id in application manifest and initializing fabric in application class file, I am now facing another exception with the following stacktrace.
java.lang.RuntimeException: Unable to create application fibamlscan.app.App: io.fabric.sdk.android.services.concurrency.UnmetDependencyException: The Crashlytics build ID is missing. This occurs when Crashlytics tooling is absent from your app's build configuration. Please review Crashlytics onboarding instructions and ensure you have a valid Crashlytics account.
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6309)
at android.app.ActivityThread.access$1200(ActivityThread.java:241)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1807)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7156)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:975)
Caused by: io.fabric.sdk.android.services.concurrency.UnmetDependencyException: The Crashlytics build ID is missing. This occurs when Crashlytics tooling is absent from your app's build configuration. Please review Crashlytics onboarding instructions and ensure you have a valid Crashlytics account.
at com.crashlytics.android.core.CrashlyticsCore.onPreExecute(CrashlyticsCore.java:243)
at com.crashlytics.android.core.CrashlyticsCore.onPreExecute(CrashlyticsCore.java:211)
at io.fabric.sdk.android.InitializationTask.onPreExecute(InitializationTask.java:44)
at io.fabric.sdk.android.services.concurrency.AsyncTask.executeOnExecutor(AsyncTask.java:611)
at io.fabric.sdk.android.services.concurrency.PriorityAsyncTask.executeOnExecutor(PriorityAsyncTask.java:43)
at io.fabric.sdk.android.Kit.initialize(Kit.java:69)
at io.fabric.sdk.android.Fabric.initializeKits(Fabric.java:466)
at io.fabric.sdk.android.Fabric.init(Fabric.java:410)
at io.fabric.sdk.android.Fabric.setFabric(Fabric.java:368)
at io.fabric.sdk.android.Fabric.with(Fabric.java:339)
at fibamlscan.app.App.onCreate(App.java:28)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1158)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6304)
at android.app.ActivityThread.access$1200(ActivityThread.java:241)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1807)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7156)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:975)
I have tried literally everything possible as suggested in stacktrace. but nothing worked in getting rid of this error.
I have also checked inside my build folder that build id is being generated after every build, but I cannot figure out why Crashlytics cannot use that build id.
This is the build id generated inside res/values of build folder automatically.
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<!--
This file is automatically generated by Crashlytics to uniquely
identify individual builds of your Android application.
Do NOT modify, delete, or commit to source control!
-->
<string tools:ignore="UnusedResources,TypographyDashes" name="com.crashlytics.android.build_id" translatable="false">1f3b35bb-2686-4f3f-91fe-87e8a05e2f71</string>
</resources>
Fabric/Firebaser here -
This is usually due to a issue with configuring the instructions for installing Fabric. Ensure that ext.enableCrashlytics = false isn't set in any build configuration that you're calling the Fabric.with statement in.
Also make sure that apply plugin 'io.fabric' is in your build.gradle after apply plugin: 'com.android.application.
Finally, if you happen to be running much older versions of Fabric or Crashlytics, try updating those dependencies. Complete instructions and information here: https://fabric.io/kits/android/crashlytics/install.
perhaps it's a little bit old, but I had this issue as well. I had to put those plugins IN ORDER at the bottom of build.gradle file:
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics'
I know I took too much time to notify that I found the solution or not, but I found the solution a few weeks after asking the question itself, and the solution is in no way related to Firebase Crashlytics, and also none of he answers I got here worked for me, and I don't know why. I searched the internet for quite a long time after I found the solution, to find out why that silly solution worked despite of the fact that it is unrelated.
So here is the solution, as far as I can remember, since I found solution quite a long time ago, I think I changed the app icon to some custom app icon, and changed the app icon reference in manifest file also. And that worked like a charm!!
I am really sorry If I can't give an explanation for the solution because it was a hit and trial method, but do try it in your end and tell me if it worked or not. And in case if it worked, and you found a convincing explanation of why it worked, please let me know in the comments section.
Same issue I am facing resolved by two step
Step 1 - Enable Crashlatics in firebase consol - select project ->
Quality- > Crashlatics -> Click Enable Button
Step 2 - downgrade the gradle version form
classpath 'com.android.tools.build:gradle:4.1.0-alpha08'
To
classpath 'com.android.tools.build:gradle:3.5.3'
Work Perfectly for me But make sure you use below configuration
in project gradle file
classpath 'io.fabric.tools:gradle:1.31.2'
repositories {
maven {
url 'https://maven.fabric.io/public'
}
}
And app gradle file
apply plugin: 'io.fabric'
and dependency
implementation "com.crashlytics.sdk.android:crashlytics:$FIREBASE_CRASHLATICS_VERSION"
Though it is a older question, adding the answer that worked for us as We got this error today but not of much valid help available in web or even here.
Following are the changes made to remove the error "Crashlytics build ID is missing". Please note, this error appears only when the app is run but not in Gradle Sync, Build, Rebuild.
Add the following line to app\res\strings\strings.xml
<string name="com.google.firebase.crashlytics.mapping_file_id">none</string>
Make sure the following dependencies exists in build.gradle(Project)
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.2'
Make sure following dependencies exists in build.gradle(Module)
// Crashlytics
implementation 'com.google.firebase:firebase-crashlytics:18.3.3'
implementation 'com.google.firebase:firebase-crashlytics-ktx:18.3.2'
Note: Use above lines as applicable (Java and or kotlin), please update the version numbers as applicable.
Sync Gradle, Rebuild, Run the app. Error should disappear.
Thanks to all contributors who indicated various above points.
Related
I have tried everything I even remove the jcenter line. I really do not know what is wrong with my gradle files this error did not show on my last projects, Please help I have a deadline and I cant get past this error.
My Gradle file's Screenshot
Where is this line?:
classpath 'com.google.gms:google-services:4.3.10' // Google Services plugin
See documentation.
I am facing this error
Error:Execution failed for task ':app:processDebugGoogleServices'.
File google-services.json is missing. The Google Services Plugin cannot
function without it.
Searched Location:
C:\Users\Kartik\AndroidStudioProjects\barcode\app\src\debug\google-
services.json
C:\Users\Kartik\AndroidStudioProjects\barcode\app\google-services.json
I have added this path in build.gradle(project:barcode)
classpath 'com.android.tools.build:gradle:2.1.2'
classpath 'com.google.gms:google-services:3.0.0'
and added this in build.gradle(Module:app)
apply plugin: 'com.google.gms.google-services'
I have also added the google-services.json file in project->app folder but then also it is giving the same error.
i faced the same problem before .
check the json file name and make sure that there is no additional spaces
First of all please make sure that you have followed documentation for firebase and not google developers guidelines and alspo generated Google-services.json for firebase project that is running in your firebase-console, you can see all your running projects in your dashboard in firebase
Make sure you have correct json file, this problem is describe here.
You can follow these steps also as per firebase documentaion.
still if you are all correct and getting errors make sure you have updated play services version in your SDK and also put this line in your app module build.gradle file, to make sure that multidex is unable. Hope you will make something out of it.
defaultConfig {
multiDexEnabled true
}
I am using google Maps in my android application. I have created the key and added necessary permissions in manifest file. But soon I start the application I get this message in debugger:
GoogleService failed to initialize, status: 10, Missing an expected
resource: 'R.string.google_app_id' for initializing Google services.
Possible causes are missing google-services.json or
com.google.gms.google-services gradle plugin.
I am not sure whats wrong. The Map is working fine and I can use it without any issues. My gradle file has this entry:
compile 'com.google.android.gms:play-services:8.4.0'
What is it complaining about and how do I alleviate it?
[From Product Manager # Google]
You can fix this issue by downloading and copying the google-services.json file for your Android app by following the steps below:
Select your app/project name and Android packagename from this link and click Continue to Choose and configure services.
Click Continue to Generate Configuration files.
Download google-services.json and copy the file to the app/ or mobile/ module directory in your Android project.
If you have previously imported your Google project into Firebase, you can
get the updated google-services.json from the Firebase console under Project Settings.
DO NOT COPY the PROJECT_NUMBER as suggested by one of the other answers since the google_app_id refers to your app within a Project and not the project itself.
You need to place the configuration file (google-services.json) generated by developer.google.com, as mentioned in the 2nd step of the official docs here
The process is simple
You can select your project or create a new one.
Then after selecting desired services (in this case the maps service), you can generate the configuration file.
For people who have migrated to the Firebase projects they can get the same by going to Firebase Console, selecting your project and under settings you will find the configuration file.
Then as quoted in step 3 of the official docs here
Copy the google-services.json file you just downloaded into the app/ or mobile/ directory of your Android
P.S : For people downvoting this answer, please do leave a comment as to why you are down voting it.
In my case, the cause of this error was that the Google Services plugin for Gradle and the Play Services library were incompatible versions. Instructions for compatible versions:
1) Add the dependency to your project-level build.gradle:
classpath 'com.google.gms:google-services:1.5.0-beta2'
2) Add the plugin to your app-level build.gradle:
apply plugin: 'com.google.gms.google-services'
3) If you're using Android Studio, this is the string to add to the dependency section of your application's build.gradle file:
dependencies {
compile "com.google.android.gms:play-services:8.3.0"
}
Source: https://developers.google.com/cloud-messaging/android/client
I met the same problem and solved it followed the official solution.
Here are the steps:
get the configuration file google-services.json from this link.
Copy the google-services.json file you just downloaded into the app/ or mobile/ directory of your Android Studio project.
Add the dependency to your project-level build.gradle:
classpath 'com.google.gms:google-services:1.5.0-beta2'
Add the plugin to your app-level build.gradle:
apply plugin: 'com.google.gms.google-services'
Add this dependency to your app-level build.gradle:
dependencies {
compile "com.google.android.gms:play-services:8.3.0"
}
For those who face this problem even after correctly setting up play services and placing google-services.json file in project/app folder, the actual solution is to
Build > Rebuild Project
Possibly due to the fact that strings from json file are not integrated into compiled resources until a full rebuild is performed.
For Xamarin/Visual Studio Mac I needed to add this to the bottom of my Droid.csproj
<Target Name="ProcessGoogleServicesJson" Condition=" '#(GoogleServicesJson)' != '' AND '$(AndroidApplication)' == 'True' AND '$(DesignTimeBuild)' != 'True'" BeforeTargets="$(ProcessGoogleServicesJsonBeforeTargets)" AfterTargets="$(ProcessGoogleServicesJsonAfterTargets)">
<Message Text="Using ProcessGoogleServicesJson override" Importance="high" />
<ProcessGoogleServicesJson GoogleServicesJsons="#(GoogleServicesJson)" IntermediateOutputPath="$(IntermediateOutputPath)" MonoAndroidResDirIntermediate="$(MonoAndroidResDirIntermediate)" AndroidPackageName="$(_AndroidPackage)">
<Output ItemName="_AndroidResourceDest" TaskParameter="GoogleServicesGeneratedResources" />
<Output ItemName="FileWrites" TaskParameter="GoogleServicesGeneratedResources" />
</ProcessGoogleServicesJson>
<ItemGroup>
<FileWrites Include="$(IntermediateOutputPath)\ProcessGoogleServicesJson.stamp" />
</ItemGroup>
https://github.com/xamarin/GooglePlayServicesComponents/issues/64
This also happen to me. In my case, it is because Android studio tried to insert some code to my main activity. Removing the code fixes the error
Inserted code is about App Indexing:
https://developers.google.com/app-indexing/android/publish
I had the same issue back then. Was able to solve it by using only the necessary play services library, which in my case GCM.
Instead of com.google.android.gms:play-services:8.4.0, I use com.google.android.gms:play-services-gcm:8.4.0. See here for more info; this also solves multidex problem.
Then I applied both #Radix and #Alexander's approach to remove the message GCM has been output in the logcat regarding the google-services.json.
You can change the versionCode and versionName of your app in your Gradle file.
A quick fix I used is to disable signing. If you aren't wanting to create production code you can set your build variant to debug, localOldDebug or localDebug.
Click on Build Variants on the bottom left in Android Studio.
how-to-disable-generated-signed-apk-android-studio
Just have another solution i'm remove accidentally
SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
.findFragmentById(R.id.map);
mapFragment.getMapAsync(this);
Add this and work, is for new solution
I finally managed to get google app invites working in my app. I enabled them on the developer console and followed this guide. The following steps were giving me problems:
Add the dependency to your project's top-level build.gradle:
classpath 'com.google.gms:google-services:1.3.0-beta1'
Add the plugin to your app-level build.gradle:
apply plugin: 'com.google.gms.google-services'
Copy the google-services.json file you just downloaded into the app/ or mobile/ directory of your Android Studio project.
By adding that classpath I had to use jcenter as my repository, as this package isn't available at mavenCentral. However, even if I built the project with jcenter as a repository, the gradle build failed with an empty error message. I tried to debug the problem but the stacktrace for the crash was enormous.
My solution was to simply ignore these steps. The app invites are working flawlessly since then.
With this in mind, here goes my question. Why were all these steps listed on the official google guide if they are not necessary? Am I missing something here?
When I started official sample for Invite API yesterday, I had problem but just because of version of google-services (1st step -> add the dependency of your project's top-level build.gradle), so I have to change it to the latest version:
classpath 'com.android.tools.build:gradle:1.3.0-beta4'
classpath 'com.google.gms:google-services:1.3.0-beta4'
and this solves all problems. I don't understand your question, which step you exactly skipped of these 3 steps mentioned and made invite api functional?
Finally found the answer. The service was working on my prototype because it doesn't check for credentials on the test device. Once released to public, the keys are needed for the service to work correctly as Ituoke Ajanlekoko said in the comments.
Further information can be found at this topic:
What does google-services.json really do?
I saw all other questions, but none of accepted answers is working for me.
By following integration steps found here https://dev.twitter.com/twitter-kit/android/integrate I have created crashlytics.properties file in module root. File is filled with apiKey and apiSecret values found in my newly created twitter application.
Error occurr on project build. I am using AndroidStudio 1.0
This is my error:
ERROR - Crashlytics Developer Tools error.
java.lang.IllegalArgumentException: Crashlytics found an invalid API key: REAL_APIKEY_VALUE.
Check the Crashlytics plugin to make sure that the application has been added successfully!
Contact support#fabric.io for assistance.
You just forgot to add one line, in app-level gradle file.
apply plugin: 'com.google.gms.google-services'
this happens because when you are adding firebase:crashlytics, firebase document not have this line. so you need to add it manually. see this is firebase:crashlytics document photo.
This happened to me when I updated Android Studio from 3.2 to 3.3, to fix it I just updated the
classpath 'com.google.gms:google-services:4.1.0'
to
classpath 'com.google.gms:google-services:4.2.0'
And it worked again
Works fine added this on fabric.properties like this:
# Fabric properties file: app/fabric.properties
apiSecret=xx68f6074dxxxxxc11dxxx97c172e8ebf0
apiKey=xxxe76c4xxxx97e8cxxxx0135e9d46f5a2xxx
Add on .gitignore (for open source projects)
REMOVE entry on AndroidManifest.xml:
<meta-data
android:name="io.fabric.ApiKey"
android:value="xxx6c41xxx6ec601xxxd4xxxa2" />
Oficial documentation: https://docs.fabric.io/android/fabric/settings/working-in-teams.html
I also experienced this issue and it took a while for me to realize I forgot adding the following line into the app/build.gradle:
apply plugin: 'com.google.gms.google-services'
After adding it, it started working like a charm even without <meta-data> in manifest and/or app/fabric.properties file.
Add the below line in app/build.gradle file
apply plugin: 'com.google.gms.google-services'
Clean The Project and Run.
after adding file fabric.properties, getting error as below.
Crashlytics found an invalid API key: null.
Check the Crashlytics plugin to make sure that the application has been
added successfully!
Contact support#fabric.io for assistance.
We need to register app and verify SHA-1 for same.
Add firebase: add google-services.json file from firebase console to your /app folder of your application.(follow steps given by Firebase Console-> Add Firebase to your Android app )
It's not giving error now
<meta-data android:name="com.crashlytics.ApiKey"
android:value="YOUR_API_KEY"/>
Add this one on Android manifest.xml
here you get the api key
https://www.fabric.io/kits/android/crashlytics/install
If someone is using crashlytics with Android dynamic features module, make sure your fabric and google-services plugins are applied only in your app module. In my case that was the problem.
Changing the below dependency at project build.gradle from :
classpath "com.google.gms:google-services:4.1.0"
to
classpath "com.google.gms:google-services:4.2.0"
has solved the problem for me.