Problems with realm after gradle update - android-studio

After update AndroidStudio to 3.1 and gradle to 3.1.0 I cannot build my project. I got this error:
Could not determine artifacts for io.realm:realm-android-library:5.0.0: Skipped due to earlier error
I have already tried:
Clean/Rebuild project
Invalidate cache and restart
gradle clean assemble --refresh-dependencies
What should I do to fix this error?

Related

How to fix different versions of dependency error?

I had a application made in 2019.
I recently updated the application with few changes.
Android Studio asked me to update to its latest version, so I did. It also asked me to update Gradle to its latest version, so I did it again.
Android Studio also suggested me to update the dependencies. One of the dependencies was com.google.android.gms:play-services-location I did update it to version 18.0.0.
I selected Build > Clean Project and Build > Rebuild Project.
After that I could not successfully build the application. Android Studio builder reported a lot of issues.
One one of them give me this error:
com.google.android.gms.tasks.RuntimeExecutionException: com.google.android.gms.common.api.ApiException: 17: API: LocationServices.API is not available on this device. Connection failed with: ConnectionResult{statusCode=SERVICE_INVALID, resolution=null, message=null}
Why in the error appears 17 while I updated the dependency to version 18?
What can I do fix this error?

After Android Studio update. Could not parse POM, Could not resolve all files for configuration ':app:_internal_aapt2_binary'

Hello I've been looking to other similar questions about this problem but none has helped me so far, after I updated to android studio to the new version 3.6.2 I have this error when I try to run any project.
Run info:
Execution failed for task ':app:mergeDebugResources'.
Could not resolve all files for configuration ':app:_internal_aapt2_binary'.
Could not resolve com.android.tools.build:aapt2:3.6.2-6040484.
Required by:
project :app
Could not resolve com.android.tools.build:aapt2:3.6.2-6040484.
Could not parse POM https://dl.google.com/dl/android/maven2/com/android/tools/build/aapt2/3.6.2-6040484/aapt2-3.6.2-6040484.pom
Content is not allowed in prolog.
Before the update the project was able to build now none of my projects build.
I tried invalidate cache and restart, I checked that I was not running in offline mode. still have the same failure. Any idea whay this could be and how I could fix it?
if you have problem with gradle
change your android stadio version to 3.6.2 or lower
file>project Strcture>
change to 3.6.2 and OK
I fixed the Error by going to my username and deleting .gradle, .AndroidStudio3.6 and .AndroidStudio3.5 folders. after I restarted android studio to download the folders again and resetting them. It worked.

Unable to find method 'org.gradle.api.tasks.SourceSetOutput.getClassesDir()Ljava/io/File;'

I tried to run an imported project in this repo
but I got this error:
Unable to find method 'org.gradle.api.tasks.SourceSetOutput.getClassesDir()Ljava/io/File;'.
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 used android studio version 3.4.1, and Gradle version 5.1.1.
anyone can help please.
I was getting the same error and fixed it by updating a dependency in the backend module:
classpath 'com.google.cloud.tools:endpoints-framework-gradle-plugin:1.0.2'
to
classpath 'com.google.cloud.tools:endpoints-framework-gradle-plugin:1.0.3'

Unable to load class 'groovy.lang.GroovyObject'

since I upgraded to android studio 3.0.1 I can not continue with my application. Gradle throws the following error: Gradle Sync Issues
Error: Unable to load class 'groovy.lang.GroovyObject'. Possible causes for this unexpected error include: Gradle's
dependency cache may be corrupt (this happens 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 Grade requested by the
project. In the case of corrupt Gradle processes, you
can also try to close the IDE and then killing all Java processes.
Any suggestions? Thank you very much.
If you made an update to Android 3.0+ do not forget to perform the cache invalidation in Android Studio and restart.
File > Invalidate Cache / Restart
You can try doing the compilation by command line, through the terminal that has integrated Android Studio:
./gradlew clean assemble
I have changed the following line in project's grandle.wrapper.properties file:
From:
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
to
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4.1-all.zip
After that i could successfully build my project again.
Not sure why it was not working with version 4.1 since both versions exists in %HOMEPATH%\.gradle\wrapper\dists folder.

Android studio preview 0.4.5: The project is using an unsupported version of the Android Gradle plug-in

I got the following error message when I was importing a project from github:
Failed to refresh Gradle project 'XXX'
The project is using an unsupported version of the Android Gradle plug-in.
Fix plug-in version and re-import project
This is not a duplicate of this because your get thee error message before
gradle/wrapper/gradle-wrapper.properties
is generated.
The problem appeared after updates. The updated Android Gradle plug-in did not support the outdated version of Gradle I had. But the error message is misleading, if you don't attempt different build options you won't see what the problem is.
After downloading a newer version of Gradle, Imported the project again, then:
Use local gradle distribution
Then Gradle home set to the folder where the new version of gradle was downloaded
that solved it
Edit: From Scott (below comments) : It's preferable to use the wrapper and to change the Gradle version in gradle-wrapper.properties instead of downloading and installing Gradle yourself. As for the Android-Gradle plugin, that's set in the dependencies.classpath block in your build file; see this
I get this gradle-errors in 4 Studio updates! My solution: I copy the Studio-folder, and if gralde throws an error, I copy the old version back. It's not a good way, but until google is not able to deliver an update without producing always the same errors (even if mentioned in many forums), I stay on 4.9 and wait for the first final release.

Resources