Fabric crashlytics new implementation not working | fabric.properties - android

The implementation to put the apiSecret and apiKey in the fabric.properties file isn’t working anymore.
Fabric properties file: app/fabric.properties
apiSecret=xx68f6074dxxxxxc11dxxx97c172e8ebf0
apiKey=xxxe76c4xxxx97e8cxxxx0135e9d46f5a2xxx
Add to .gitignore (for open source projects)
Remove the entry at the AndroidManifest.xml:
<meta-data
android:name="io.fabric.ApiKey"
android:value="xxx6c41xxx6ec601xxxd4xxxa2" />
Official documentation: https://docs.fabric.io/android/fabric/settings/working-in-teams.html#android-projects
Does anymore know what have changed or why this isn’t working anymore?

The issue appears to have been fixed (at least for me) with version 1.31.0 (July 24, 2019) of the Fabric Gradle plugin:
classpath 'io.fabric.tools:gradle:1.31.0'
Now when building an App Bundle the AndroidManifest.xml file includes the io.fabric.ApiKey meta-data element.
https://docs.fabric.io/android/changelog.html#july-24-2019

Related

Plugin gradle in android studio don't work

I want use gradle plugin in android studio.
I added classpath in build.gralde:
classpath "com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:2.0.0"
and
id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin'
I put my map api key in local.properties (MAPS_API_KEY = "mykey") and use it on my manifest:
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="${MAPS_API_KEY}" />
My app run succefully But it's don't work for me.
I didn't see you mention it, but when you specify a variable such as ${MAPS_API_KEY}, a value has to be provided that will be substituted later.
For your case, Google recommends using the "local.properties" file. Add an entry there of:
MAPS_API_KEY = your key value
So that the ${MAPS_API_KEY} can be populated with your actual key.

AndroidManifest: resource integer/google_play_services_version not found

I have an android Studio (3.2.1) app, with base module and instantApp feature, Target API is 28. Since when I added Firebase, I started having this maniferst merge error in the title, which I solved adding:
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
In the base app manifest, as mentioned in many answers on this topic.
App runs OK and firebase stuff works, but integration tests (and instant app) are broken with error:
resource integer/google_play_services_version (aka it.future.futureandroid.app:integer/google_play_services_version) not found.
Please notice that I added apply plugin: 'com.google.gms.google-services' in the base app gradle as well, while cloud messaging dependency is only specified inside feature module with:
implementation 'com.google.firebase:firebase-messaging:17.3.4'
while at project-level build.gradle i added:
classpath 'com.google.gms:google-services:4.2.0'
I already tried adding configurations.all as reported in similar questions with no luck. It seems that manifest merger, only with instantApp and integration tests, cannot resolve that integer/google_play_services_version

Problems adding Firebase Crashlytics to Android project - Crashlytics found an invalid API key: null

I am trying to add Firebase crashlytics to our project but just can not get it to work.
I have followed the instructions adding the necessary lines to our gradle file but no success so far.
The main issue I get is this message:
Crashlytics found an invalid API key: null
which seems weird since I thought an API key should not be needed for Firebase.
I use Android studio 3.0.1 with the latest gradle plugin. My project is Ionic based but I have tried to hand modify the gradle file as well with the same results.
I had a similar problem and it turned out that I did not apply google-services plugin in the bottom of build.gradle (in app module)
apply plugin: 'com.google.gms.google-services'
After that it is working
There is an incompatibility with some other Firebase libraries that add the API key in the manifest for you, for example com.firebaseui:firebase-ui-auth:2.3.0
You can check with the Merged Manifest in Android Studio, to see if that is the case:
The issue might be resolve by updating/removing the library if possible, otherwise you can remove the API key by adding a <meta-data> tag with a tools:node="remove" attribute, like this:
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="your.package">
<application
...>
<meta-data
android:name="io.fabric.ApiKey"
tools:node="remove"/>
</application>
</manifest>
This will tell the manifest merger that you don't want this specific meta-data.
# Fabric properties file: app/fabric.properties
apiSecret=x8x6x5x54x4xx8xxxx98 #your api hash
apiKey=xx389xxx8xx7x787x8x7x78x78x9x #api key
if you added api key in manifest remove it

IONIC: unable to build app after installing `cordova-plugin-fcm`

I am new with ionic framework.Currently i am working on ionicsidemenu android app. I want notification in my app for this i have installed cordova-plugin-fcm plugin. After installing plugin when i run ionic run android it gives build failed message with below error
I have configured my app in firebase console. I have plugins in my app :
Please help me.
Your platforms/android/project.properties should be changed like this:
target=android-25
android.library.reference.1=CordovaLib
cordova.gradle.include.1=cordova-plugin-crosswalk-webview/courseur-xwalk.gradle
cordova.gradle.include.2=cordova-plugin-firebase/courseur-build.gradle
cordova.system.library.1=com.google.firebase:firebase-core:+
cordova.system.library.2=com.google.firebase:firebase-messaging:+
cordova.system.library.3=com.google.firebase:firebase-crash:+
cordova.system.library.4=com.google.firebase:firebase-config:+
cordova.system.library.5=com.google.firebase:firebase-core:9.0.0
cordova.system.library.6=com.google.firebase:firebase-messaging:9.0.0
cordova.system.library.7=com.android.support:support-v4:+
cordova.system.library.8=com.google.android.gms:play-services-analytics:+
Make sure you have the The Google Play Services SDK installed.
On my MAC, I use Android Studio -> Configure (at the bottom) -> SDK Manager.
Step 1 (for FCM Plugin)
Comment out these lines in the FCMPlugin.gradle file.
classpath 'com.google.gms:google-services:3.0.0'
apply plugin: com.google.gms.googleservices.GoogleServicesPlugin
Step 2 (for FCM Plugin)
Change the plugin.xml of the FCM plugin to use a different version, in my situation 9.8.0.
<framework src="com.google.firebase:firebase-core:9.8.0" />
<framework src="com.google.firebase:firebase-messaging:9.8.0" />
Step 3 (for Background-Geolocation-Plugin)
Change the plugin.xml of the Geolocation plugin to use a different version, in my situation 9.8.0 instead of "+".
<framework src="com.google.android.gms:play-services-location:9.8.0" />
Step 4
Remove and re-add plattform.
Step 5 (build.gradle file of the android platform folder)
Add this line to the classpath section
classpath 'com.google.gms:google-services:3.1.0'
And add this line below the dependencies, nearly at the bottom of the file
apply plugin: 'com.google.gms.google-services'

Crashlytics found an invalid API key - AndroidStudio build

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.

Categories

Resources