Error:Execution failed for task ':app:processDebugGoogleServices'. in Android Studio - process

I have got following error while adding dependency in build.gradle
Error:Execution failed for task ':app:processDebugGoogleServices'.
> Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available at https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 8.3.0.
I have added following dependency and plugin to build.gradle(app level) to integrate GCM 3:-
apply plugin: 'com.google.gms.google-services'
compile "com.google.android.gms:play-services:8.3.0"
build.gradle(Top Level):-
classpath 'com.google.gms:google-services:1.5.0-beta2'
Your advice will be appreciated.
Thank you!

After debug and search in google I came to know that I have added dependency of google play service in build.gradle with two different versions.
Remove the older one solves this issue
Thank you

Related

gradle issues details in discription

Unable to find method 'org.gradle.api.artifacts.result.ComponentSelectionReason.getDescription()Ljava/lang/String;'.
Possible causes for this unexpected error include:
Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
Re-download dependencies and sync project (requires network)
The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem.
Stop Gradle build processes (requires restart)
Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project.
In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.
I resolved the error by downgrading gradle.
To do so, in the gradle-wrapper.properties file, I made the following changes.
It was:
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
It is now:
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-all.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
If you are using IntelliJ Community Edition, upgrading the IDE to IntelliJ IDEA 2021.1.2 (Community Edition) solved the problem for me. Previously I was using the 2019 version and I was getting the same error.
I had the same problem. I solved it, when I update Android Studio with Gradle.
Upgrading IntelliJ version from 2019 to 2021 fixed the issue for me
org.gradle.internal.exceptions.LocationAwareException:
'java.lang.String
org.gradle.api.tasks.SourceSet.getCompileConfigurationName()'
Caused by: java.lang.NoSuchMethodError: 'java.lang.String
org.gradle.api.tasks.SourceSet.getCompileConfigurationName()'
I got the same error mentioned in the question with the above exceptions.
As mentioned above, upgrading the intellij version from from 2019 to 2021 helped me.
Upgrading Intellij version worked.
Either upgrade or downgrade your IntelliJ idea. Stupid but that's the way to go. I jumped between 2021.3.2, 2019.3.1, 2021.1.2 and some version of 2022 however, downgrading to 2021.1.3 fixed my issue. It all started after I changed my hdd and downloaded the latest version intellij idea.

React Native "Could not open settings remapped class cache"

I received this error:
FAILURE: Build failed with an exception.
* What went wrong:
Could not open settings remapped class cache for 1a8j0dwq37525yzi9alfmzw3 (C:\Users\Username\.gradle\caches\5.4.1\scripts-remapped\settings_7z9efzwj1mz1b0w35o6u5p4ep\1a8j0dwq37525yzi9alfmzw3\settingsdcd040730888da95d185715568c9cc57).
> Could not open settings generic class cache for settings file 'PATH\android\settings.gradle' (C:\Users\Username\.gradle\caches\5.4.1\scripts\1a8j0dwq37525yzi9alfmzw3\settings\settingsdcd040730888da95d185715568c9cc57).
> BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 57
Yesterday I tried to add the Google Login Package and received similar errors. Then I pulled a working version from my Github Repository and now I get this error. Already cleaned Gradle, reinstalled Java, deleted Cache, "Restart and delete" with Android Studio... Has anybody an idea?
Thanks in advance
Had the same problem. Here's how i solved this.
Go to android > gradle > > wrapper > gradle-wrapper.properties file and find distributionUrl and at the end of that line you'll find gradle-5.2-all.zip kind of gradle version. This version can be diffrent in your case. just change it to latest gradle version. In my case latest version is 6.7 so i changed version like this.
Before
distributionUrl=https\://services.gradle.org/distributions/gradle-5.2-all.zip
After
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
Goto this directory :C:\Users\your username.gradle\caches
Rename the gradle in question and then go and run 'react-native run-android' again your problem should be resolved!
For me, the removal of the cache didn't solve the problem.
I opened Android Studio and ran the Gradle build process. It downloaded the correct libraries and then react-native run-android ran flawlessly.
Please Change your distributionUrl (android > gradle > > wrapper > gradle-wrapper.properties) to:
Depend on ion your JDK version(your jdk version and Gradle version should related)...
My JDK: 18
👉 distributionUrl=https://services.gradle.org/distributions/gradle-7.3.3-all.zip
(: Worked :)
Required:
JDK 18+
If you have a low version of JDK downgrade your gradle version. (ex, distributionUrl=https://services.gradle.org/distributions/gradle-6.3-all.zip)

Robolectric 4 AndroidX NoClassDefFoundError MonitoringInstrumentation with IntelliJ 2018.3.4

Problem
after switching to androidX
with a multi-module Android library
using IntelliJ 2018.3.4 #IC-183.5429.30
using Robolectric 4.1 with android gradle plugin 3.3.1
when executing Robolectric tests, I receive:
java.lang.NoClassDefFoundError: androidx/test/runner/MonitoringInstrumentation
No duplicate question:
I read the other topics which pop up when using google or stackoverflow search but they are about a more specific error which is worked-around via adding specific dependencies. In my case I was not able to determine which dependency to add.
I add dependencies to androidx.test:core
for the build type under test.
In my case it was debug so in the build.gradle I add
debugImplementation 'androidx.test:core:1.2.0'
I read that no workaround should be required with Android Studio 3.3 and Robolectric 4.0.
Use Android Studio 3.3.1+ with Robolectric 4.0+
This works for me.

Dexguard mapping files not being uploaded for Android Plugin for Gradle 3.0+

We are using Dexguard and the latest Fabric Gradle Plugin version 1.25.2. However, when we run the build with Android Plugin for Gradle 2.3.3, we see the gradle task run for '{namespace}:crashlyticsUploadDeobs{flavor + buildvariant}, but with Android PLugin for Gradle 3.0.1, we don't see this gradle task run and the logs in Crashlytics are not de-obfuscated.
My assumption is that this is the task that uploads the Dexguard mapping files up to Crashlytics.
I see the Fabric Gradle Plugin version 1.24.0 changelog indicates that it addressed this very issue for Proguard. Could there be another issue for Dexguard that needs to be addressed in the Fabric Gradle Plugin?
With help from GuardSquare I was able to identify the issue. Dexguard 8.1 provides a 'dexguard-partial' plugin that let's you exclude dexguard for certain buildTypes. By excluding dexguard on debug builds, you get faster build times. However, this 'dexguard-partial' plugin does not appear to be recognized by Fabric's plugin for Gradle. Therefore, those tasks for uploading the Dexguard mapping files to Crashlytics, never run.
I was able to resolve this issue by switching from the 'dexguard-partial', back over to the 'dexguard' plugin and adding the following conditional check to ensure the plugin is only included for Release builds:
getGradle().getStartParameter().getTaskRequests().toString().contains("Release")
This keeps our build times down for debug builds, by excluding dexguard for those builds. And resolves the Crashlytics issue by including dexguard for release builds.

Gradle settings error

Error:The project is using an unsupported version of Gradle. Please use version 1.10.
Please point to a supported Gradle version in the project's Gradle settings or in the project's Gradle wrapper (if applicable.)
Gradle settings
how to resolve above qouery ?
Duplicate of a question raised at Gradle forum - http://forums.gradle.org/gradle/topics/gradle_settings_error
It is not a query but an error statement and it tells you what to do.