Crashlytics Generate Symbols task got stuck - android

Trying to Generate symbols for crashlytics using
./gradlew crashlyticsGenerateSymbolsDebug.
But this process get stuck, even with --debug there is no logs.
Any idea why this is happening?

Mike from Fabric here. This was a bug introduced in 1.24.3 of the Fabric Gradle plugin. It's been fixed in 1.24.4.

The same problem happened to me today when trying to build a release APK of a project I work on.
Like Alkaiser mentioned, it seems to be a problem with the Fabric tools.
Just open the following URL to see the available Fabric tool versions:
https://maven.fabric.io/public/io/fabric/tools/gradle/maven-metadata.xml
And then go to the project level Gradle file, and change the io.fabric.tools classpath to use an earlier version - 1.24.2 should solve the problem.

Related

error -The build failed likely due to AndroidX incompatibilities in a plugin. The tool is about to try using

I am trying to build the android apk. I am facing the below error.
Tried with flutter clean, updated pub get, and I am using flutter 2.2.3
The build failed likely due to AndroidX incompatibilities in a plugin. The tool is about to try using Jetifier to solve the incompatibility.
Building plugin cloud_firestore...
Running Gradle task 'assembleAarRelease'...
Do these steps : 1. Try adding this line In your Project folder > android > app > build.gradle, add the following Line in
multiDexEnabled true
inside defaultConfig
2.Then upgrade gradle dependency in the android/build.gradle file: classpath 'com.android.tools.build:gradle:3.3.1' (previously on version 3.2.1)
3.Run flutter clean and rebuild your project
Based on your other feedback, the basic troubleshooting is
(1) flutter doctor and
(2) to try to build the apk for the sample app. See https://docs.flutter.dev/get-started/test-drive?tab=terminal
If the build works with the sample app, then you know your environment is good but something is up with your app.
(3) if you think your gradle might be corrupted, you might copy your lib/ and pubspec.yaml to a blank project to start.
You mentioned a cloud_firestore issue. There are several things that need to be setup to get cluod_firestore working, including the google-services.json that are easy to mess up.
You might also have version incompatabilities with firebase. There are some breaking changes in the last couple of years.
I always try to run the sample/example code first to see if my tooling is correct. So, try that with flutter fire: https://firebase.flutter.dev/docs/overview

Why is my react navigation not working on android?

Recently I merged some changes from a colleague and these changes have React Native Navigation setup in it. After installing all the dependencies and setting up everything, When I run the app, I get this error that says
com.app.MainActivity cannot be cast to com.reactnativenavigation.NavigationActivity
Apparently, the error is coming from the following file
react-native-navigation\lib\android\app\src\main\java\com\reactnativenavigation\react\NavigationModule.java
How to reproduce
I am not really sure how to reproduce this error because I don't know what's causing it in the first place. However, the only other unexpected behavior was that my Android Studio or react-native run-android both were failing gradle build when I first added all the required dependencies. The reason for failure was kotlin-android and even though I can confirm that from the build.gradle files of the repository that the required settings exist, still I had to add the relevant required config to my main applications android/gradle.build and android/app/gradle.build
Apparently this solved the issue with now react-native run-android running successful gradle build.
The repository has the following dependencies config
classpath 'com.android.tools.build:gradle:3.5.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.61"
Despite the presence of above, my gradle builds were failing and complaining about android-kotlin so I added the following dependencies config to my app's android/gradle.build
classpath('com.android.tools.build:gradle:3.6.2')
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.72"
Notice the difference in versions of the gradle (This gradle version came by default with RN 0.62) and kotlin-gradle-plugin. I don't know, but could this be the cause of the issue?
I am using latest version 5.5.1 for #react-navigation/native
I finally figured this out. Actually the problem was being caused by another package that was just added to the project and wasn't setup and being used. The package that was causing the issue was https://github.com/wix/react-native-navigation which I didn't notice it was there and it apparently wasn't properly configured.

WARNING: API 'variant.getMappingFile()' is obsolete and has been replaced with 'variant.getMappingFileProvider()'

I just updated Android Studio 3.5 to Android Studio 3.6 and replaced previous Gradle plugin with Gradle plugin 3.6.0 when syncing Gradle:
build.gradle: API 'variant.getMappingFile()' is obsolete and has been
replaced with 'variant.getMappingFileProvider()'
Any suggestions on how to debug this warning. Where is it coming from? I don't see any usage of getMappingFile in my code although, might be some library. Suggestions to debug these kind of cases would be helpful
Upgrading
classpath 'io.fabric.tools:gradle:1.29.0'
to
classpath 'io.fabric.tools:gradle:1.31.2'
in my top-level build.gradle fixed the problem for me.
When running the gradle script with the parameter -Pandroid.debug.obsoleteApi=true set, you can get a stack trace of what is causing the issue.
I found out it in my case was related to Crashlytics. There was this issue opened, but it's apparently the legacy-plugin so the issue has been closed again with a suggestion of contacting the Fabric support. So hopefully they will find a solution.
Go to build.gradle under Gradle Scripts
Add this Line: classpath 'io.fabric.tools:gradle:1.31.2'
Rebuild your Project.
If your project uses Firebase: instead of upgrading io.fabric.tools:gradle version it's better to switch to com.google.firebase:firebase-crashlytics-gradle since fabric is deprecated now. See Upgrade to the Firebase Crashlytics SDK guide for detailed instructions.
Maybe it could be of help to someone. In my case, it was:
variant.mappingFile
which was used in build.gradle to backup mapping files. To remove the warning use:
variant.mappingFileProvider

Meaning of "android.enableAapt2 will be removed at the end of 2018"?

Gradle version: 4.4
Android Plugin Version: 3.1.2
Hi.
I'm working on an Android which should be deploy by using a Mobile Device Management called AirWatch.
So since Android Gradle Plugin 3.0.0, even if I update application version code and version name, the MDM thinks that the last deployed version and the current one are the same.
Using dump badging command, I see that the platformBuildVersionName is empty. So when I disable aapt2 from my gradle properties file, platformBuildVersionName is filled. which allow me to deploy on the MDM. The problem is not up to date we don't when they will. So this is the work around I found. I know that the option 'android.enableAapt2' is deprecated and should not be used anymore.
My question is what's the meaning "It will be removed at the end of 2018"? Is that mean, at the end of 2018, my app will not compile anymore?
Thanks
The issue with platformBuildVersionName missing has been fixed recently in AAPT2.
AAPT2 it is now released it in GMaven for faster releases (so you need to have the google() dependency in your build.gradle file), so please try with android gradle plugin 3.2.0 alpha16 or newer which may already contain it. If that still doesn't work, keep an eye out for new versions, it should be released shortly (if it hasn't been yet).
As for the information about AAPT1 deprecation - it means that at some point in the near future, near the end of 2018, there will be a release of Android Gradle Plugin that removes the android.enableAapt2=false flag. AAPT1 will be completely removed then so the hacks with disabling AAPT2 won't work anymore. If you run into any other issues with AAPT2 please file them on issue tracker, so that the team can fix them before everyone will need to move away from AAPT1.
In 2019 New update
From Gradle.properties remove
android.enableAapt2=false this line
it will work now.
1.Projenin gradle.properties:
android.enableAapt2=false
2.File-> settings-Build, Execution > Instant run
unselected all options and rebuild projects

gradle fails with Problems reading data from Binary store error

I have a Gradle file that runs the tests. It does not build anything. All it has is a unzip task that extracts all jars in a Gradle configuration into a particular directory and then runs the task of type Test. This test task points the testClasses directory to the location where the previous copy task has extracted the configuration into.
My build fails with the error message:
Problems reading data from Binary store
When I run 'gradle dependencies' it does not show any error/warning
When I run the copy task individually, it runs very well fine.
Only when I run everything it fails with error :
> Could not resolve all dependencies for configuration ':testConfig'.$
> Problems reading data from Binary store in /tmp/gradle8793563212642185736.bin (exist: false)$
I see the file /tmp/gradle8793563212642185736.bin does not exist. What could be the reason for this?
I solved upgrading following packages to last version (06/02/2021), so:
project app-level build.gradle file:
com.google.firebase:firebase-analytics:17.2.2
to
com.google.firebase:firebase-analytics:18.0.2
Project-level build.gradle file:
com.google.gms:google-services:4.3.3
to
com.google.gms:google-services:4.3.5
In my case setting org.gradle.parallel=false flag fixes the issue, but it's not a solution for my project, flag increase CI build time from ~15min to ~45min.
Turns out it was just a network problem for me. Gradle just needed to connect to the internet.
It happened with Flutter development in my case. Apparently, it is not an actual issue and there is no magic fix. Cleaning build file with "Flutter clean" and restarting the command line executer window solved the issue.
I was working with version 5.x earlier and then I upgraded to 6.0.1 and it resolved the issue.
this is how you can upgrade
cd android
./gradlew clean
./gradlew wrapper --gradle-version 6.0.1
./gradlew -v # to download the new version
cd ..
flutter clean
flutter run # might take 15 - 20mins for the first time
There are mainly a few steps to solve this problem.
Go to gradle.properties and set org.gradle.parallel=false and sync. Make sure your sync gradle offline option is off
Start the build with this option. If it's a big project setting org.gradle.parallel=false will take a long time.
Cancel the build repeat the steps setting org.gradle.parallel=true.
Also do not turn on offline build
This solution worked in my flutter project. I solved it by making these changes:
In android level build.gradle file, replace classpath 'com.android.tools.build:gradle:3.5.4' with classpath 'com.android.tools.build:gradle:4.0.1' (basically upgrade the version from 3.5.4 to 4.0.1)
In gradle-wrapper.properties file, replace distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip with distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip (upgrade from 5.6.2 to 6.1.1)
and if you have added classpath 'com.google.gms:google-services:4.3.3' to android level build.gradle file, replace that too with classpath 'com.google.gms:google-services:4.3.5' (upgrade from 4.3.3 to 4.3.5)
In my case the writing problem was there was no enough storage to build the app so I needed to restart my Mac and it finished building successfully.
I know am too late but it might help someone in the future so
Start by upgrading Gradle to the latest version.
Binary store issues reported to GitHub are often fixed right away, especially if they include a Minimal, Reproducible Example.
If upgrading didn't work, it can be useful to run the task again with Performance options disabled:
--no-parallel
--no-configure-on-demand
Next please find an existing issue or open a new one so it can be fixed in future versions. These things are all helpful:
Minimal, Reproducible Example
Build Scan
Smallest change that introduced the problem (e.g. worked on 5.5, but not 5.6)
I ended up here after publishing an artifact to mavenLocal().
I tried a lot but in the end what helped me was:
Upgrading gradle from 6.3 to 6.9
./gradlew wrapper --gradle-version 6.9
Hope this saves me half an hour next time this occurs.
Thanks to Cedric's hint, stopping gradle offline mode and make it online, fixed the issue for me

Categories

Resources