Reputation: 2010
I tried to follow the officiall upgrade documentation, but after I changed every related lines in gradle files I got this error:
A problem occurred evaluating project ':app'. Failed to apply plugin [id 'com.google.firebase.crashlytics'] Could not set unknown property 'obfuscatorVersion' for object of type com.google.firebase.crashlytics.buildtools.gradle.CrashlyticsExtension.
These are the Firebase versions:
firebaseCrashlytics = '17.0.1'
firebaseAnalytics = '17.4.3'
Other related dependencies:
classpath 'com.android.tools.build:gradle:3.6.3'
classpath 'com.google.gms:google-services:4.3.3'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.1.1'
If I comment out this line:
apply plugin: 'com.google.firebase.crashlytics'
everything is working fine... I can't upgrade to gradle 4.0.0 because DexGuard doesn't support it.
Upvotes: 5
Views: 7311
Reputation: 458
FLUTTER DEVELOPMENT:
Just for problem in future with FLUTTER framwork i had the same issue listed here on the question and the problem was in the file build.gradle and it gives me the following issue :
Build file 'C:\Users\MyUserName\AndroidStudioProjects\FlutterX UI\android\app\build.gradle' line: 23
Failed to apply plugin 'com.google.firebase.crashlytics'. Crashlytics was applied to a project without an Android plugin. Please make sure the Crashlytics plugin is applied after the appropriate Android plugin for your project.
AND i am using in pubspec.yaml those plugins : firebase_crashlytics, firebase_core.
So what caused a porblem for me the was in the file build.gradle and specificly in those line :
apply plugin: 'com.google.firebase.crashlytics'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.android.application'
i just rearranged them as following and it worked like a charm :
apply plugin: 'com.android.application'
apply plugin: 'com.google.firebase.crashlytics'
apply plugin: 'com.google.gms.google-services'
I hope it will help someone in the future.
Upvotes: -2
Reputation: 31
Use below configuration if your facing build issues using Android studio 4.1
implementation platform('com.google.firebase:firebase-bom:26.2.0')
implementation 'com.google.firebase:firebase-crashlytics'
classpath 'com.google.gms:google-services:4.3.4'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.4.1'```
Upvotes: 3
Reputation: 2010
Ok, I got it. If anybody using DexGuard them must the Crashlytics plugin should be applied before the DexGuard plugin. This piece of magic linked in the release notes...
Upvotes: 8
Reputation: 11
Looks like gradle version issue.
Use updated gradle version:- classpath "com.android.tools.build:gradle:4.0.0"(latest)
or classpath 'com.android.tools.build:gradle:3.6.3'(old)
and updated gradle-wrapper.properties:- distributionUrl=https://services.gradle.org/distributions/gradle-6.1.1-all.zip(latest)
or distributionUrl=https://services.gradle.org/distributions/gradle-5.6.4-all.zip(old)
Upvotes: 1