Crashlytics not working after update Android Studio to 3.3 - android-studio

So also gradle plugin updated to 3.3 and Gradle updated to 4.10. After that, Crashlytics stopped working with error:
Crashlytics found an invalid API key: null
Any ideas? I am forced to revert Gradle to make it working again. Crashlytics configured with Firebase

Updating com.google.gms:google-services to 4.2.0 helped me

Updating
distributionUrl=https://services.gradle.org/distributions/gradle-4.10.2-all.zip
that helped me on gradle-wrapper.properties

Related

Null issue in Android Studio Gradle

After I upgraded the Android Studio to Dolphin my project, which worked perfectly fine in Chipmunk, stopped working by giving me this weird error from Gradle:
There is no explanation of what is wrong except this weird error null.
I tried lots of stuff like:
Invalidating caches and restart
Deleting .gradle files
Upgrading the Gradle and Gradle Plugin. Right now versions are, for Gradle Plugin: 7.3.0 and for Gradle 7.4
Updated google services to the latest version 4.3.14
But none of this helped and I don't know what is wrong so any help is more than welcome. Thanks in advance.
It seems this is an Android Studio bug and is still active on the Google Issuetracker.
Apparently two people have found a workaround by:
Deleting the .idea folder and restarting Android Studio
Deleting the .idea, .gradle, build folders and restarting Android Studio
Hope this helps!

Gradle sync failes after updated to new AndroidStudio

I updated to:
I get the following error:
There is something wrong with gradle sync.
I tried all solutions found in stackoverflow, but nothing works.
I have the following settings.
Any help?
That combination of AGP and Gradle versions are (apparently) not supported by AS Bumblebee (Patch 3).
Updating to latest versions (AGP version 7.1.3, Gradle version 7.2) solves the issue.

groovy lang Missing Property Exception [duplicate]

After updating to Android Studio 4 I got this error:
A problem occurred configuring project ':app'.
groovy.lang.MissingPropertyException: No such property: scope for class: com.android.build.gradle.internal.variant.ApplicationVariantData
My gradle:
classpath 'com.android.tools.build:gradle:4.1.0-alpha10'
gradle-wrapper.properties:
https://services.gradle.org/distributions/gradle-6.5-bin.zip
I had the same issue. Removing all fabric references in build.gradle solved my case.
you can try to remove
apply plugin: 'io.fabric'
and
classpath 'io.fabric.tools:gradle:1.31.2'
lines from your build.gradle file.
Fabrics Crashlytics deprecated. If you are using Fabric Crashlytics you can replace it with Firebase Crashlytics.
I had the same problem, in particular with the the same stack trace as #display name (on the comments).
From there I noticed the reference to Crashlytics. And effectively that was the issue: the old, deprecated, version (from Fabric). Migrating to the new Firebase Crashlytics fixed the issue for me.
Update in OCTOBER 2020 :
Fabric is deprecated, so remove all plugins and dependencies depend on Fabric.io
like :
apply plugin: 'io.fabric'
classpath 'io.fabric.tools:gradle:1.31.2'
maven {
url 'https://maven.fabric.io/public'
}
and after deletaion you must add :
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.3.0'
in your build.gradle.
https://firebase.google.com/docs/crashlytics/upgrade-sdk?platform=android
Just remove or comment it out. it works for me.
apply plugin: 'io.fabric'
and
classpath 'io.fabric.tools:gradle:1.+'
from both gradle file.
Please update your Gradle dependency to:
classpath "com.android.tools.build:gradle:4.0.0"
and in gradle-wrapper.properties
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
This started happening for me when upgrading Android Studio from 4.0.2 to 4.1. Unfortunately, I had to update a branch that still includes fabric, the only way I could get it working was to downgrade android studio and make the fixes and be able to make a new build.
Download old versions here:
Windows: https://android-studio.en.uptodown.com/windows/versions
Mac: https://android-studio.en.uptodown.com/mac/versions
I am using Fabrics Crashlytics and i got the same error after updating my Android plugin for Gradle to version 4.1:
classpath 'com.android.tools.build:gradle:4.1.0-rc01'
I need to upgrade gradle plugin to upload native debug symbols to Google play console as stated in this link.
https://developer.android.com/studio/preview/features#native-crash-symbolization
To use Android plugin for gradle version 4.1,
your minimum gradle version needs to be version 6.5.
I used gradle version 6.5.1
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5.1-all.zip
Upgrading from Fabric Crashlytics to Firebase Crashlytics solved the issue for me, this could be because fabric is not compatible with the newer versions of Android plugin for gradle. For more information on how to upgrade from Fabric crashlytics to Firebase Crashlytics. Check out this link https://firebase.google.com/docs/crashlytics/upgrade-sdk?platform=android
If you are using com.google.firebase:firebase-crashlytics-gradle dependency in your project, just update to version 2.0.0-beta04 it is helped to me.
Remove all that connected with deprecated library such as fabric crashlytics etc.
Updating dependencies in build.gradle (Project level) solved my issue:
classpath 'com.android.tools.build:gradle:4.1.2'
classpath 'com.google.gms:google-services:4.3.5'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.5.0'
I updated the de.mannodermaus.gradle.plugins:android-junit5 to the latest version
I run into this problem with an older project which I was maintaining after a longer period. Problem was that project was still using older gradle scripts, plugins and dependencies.
The biggest problem was fabric.io which is not maintained and compatible with the latest gradle version. Stack trace in build output which contained crashlytics references pointed me to the fabric. I recommend checking it. In your case, it might be related to other plugins.
Stack trace example:
at com.crashlytics.tools.gradle.ProjectVariantState$deriveFrom.call(Unknown Source)
at com.crashlytics.tools.gradle.CrashlyticsPlugin.createTaskBuilder(CrashlyticsPlugin.groovy:301)
at com.crashlytics.tools.gradle.CrashlyticsPlugin.this$2$createTaskBuilder(CrashlyticsPlugin.groovy)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at com.crashlytics.tools.gradle.CrashlyticsPlugin.addPluginTasks(CrashlyticsPlugin.groovy:271)
In Project level build.gradle Just downgrade the version of dependency 'com.android.tools.build:gradle:4.5.0' to your last/lower version was 'com.android.tools.build:gradle:4.0.1' and
In "gradle-wrapper.properties" downgrade the "distributionUrl=https\://services.gradle.org/distributions/gradle-6.5.1-all.zip" to last/lower version like "distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip" .
and sync and run .
On Android Studio simply open build.gradle (Project) and the IDE should suggest an update to crashlytics, accept that and the error will be gone.

Ionic Capacitor app give me lots of errors

I'm on Windows 10 and I've created a Ionic 5.0.7 app with Capacitor 2.0.0.
I use this command to build app:
ionic build
After, I use this command:
npx cap sync
And, to finish, I use this command to open Android Studio:
npx cap open android
The first problem come during building on Android Studio:
org.gradle.api.reflect.ObjectInstantiationException: Could not create
an instance of type
com.novoda.release.internal.compat.gradle5_3.AndroidSoftwareComponentCompat_Gradle_5_3.
Caused by: org.gradle.api.reflect.ObjectInstantiationException: Could not create
an instance of type
com.novoda.release.internal.compat.gradle5_3.AndroidSoftwareComponentCompat_Gradle_5_3.
And...
java.lang.NoClassDefFoundError:
org/gradle/api/internal/java/usagecontext/LazyConfigurationUsageContext
Caused by: java.lang.NoClassDefFoundError:
org/gradle/api/internal/java/usagecontext/LazyConfigurationUsageContext
I've other random errors... It's weird...
Update
Check #Carl Pool 's answer
They fixed it in the new capacitor Version, no need to downgrade anymore
Old Answer
To fix this downgrade Gradle and Gradle plugin in Android Studio.
File -> Project Structure -> Project
If you keep the plugin to 4.0.0 it will require a minimum Gradle version of 6 so put it back to a lower version like 3.6.3
Version 6 of Gradle does not support LazyConfigurationUsageContext as mentionened by #NishaBhat, so use 5.6.4 instead.
This issue currently has a ticket on Github:
https://github.com/ionic-team/capacitor/issues/3003
This issue has been resolved in Capacitor version 2.1.2.
https://github.com/ionic-team/capacitor/issues/3003
Please update the Capacitor dependencies in package.json to version 2.1.2 and then in Android Studio click the button to sync the project with Gradle.
"#capacitor/android": "^2.1.2",
"#capacitor/core": "2.1.2",
Switch to using gradle version 5.6.4. That did the trick for me. LazyConfigurationUsageContext doesn't have support in gradle versions 6.0+
I was getting an error
Cause: org/gradle/api/internal/java/usagecontext/LazyConfigurationUsageContext
I solved by downgraded distributionUrl(gradle/wrapper/gradle-wrapper.properties) to https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
it will give an error if above 6+
Same problem.. had many issues:
Errors and how I solved:
Error 1. Gradle sync failed: Server returned HTTP response code: 403 for URL: http://services.gradle.org/distributions/gradle-5.6.4-all.zip
Solution - Downloaded the zip file and stored in on my local in the \android\gradle\wrapper folder.
Updated the distribution URL to: distributionUrl=./gradle-5.6.4-all.zip
Error 2. java.lang.NoClassDefFoundError & java.lang.NoClassDefFoundError:
Solution - Downloaded Gradle version 5.6.4 and updated the environment variables.
Error 3. Failed to install the following Android SDK packages as some licences have not been accepted.
build-tools;28.0.3 Android SDK Build-Tools 28.0.3
Updated as per the image below
i have not downgraded the gradle version 6.1.1 But what i did is that:
I removed these lines from build.gradle file
apply plugin: 'com.novoda.bintray-release' &
classpath 'com.novoda:bintray-release:0.9.1'
The Issue just gone like Boom !!
I think this Bintray Dependencies just conflicting behind the scene.

android studio, fix Android caching problems

Please help, just updated Android Studio, and build will not complete/sync
error message:
Gradle sync failed: Android plugin 3.1.2 is not supported by Android cache fix plugin. Supported Android plugin versions: 3.1.0-alpha09, 3.0.0, 3.0.1. Override with -Dorg.gradle.android.cache-fix.ignoreVersionCheck=true.
Consult IDE log for more details (Help | Show Log) (616ms)
It would be fixed soon!!
Following is the workaround for now -
You can add systemProp.org.gradle.android.cache-fix.ignoreVersionCheck=true in your gradle.properties file.
Well, try to downgrade Android plugin 3.1.2 to 3.1.0-alpha09
try take a look
here

Resources