Gradle Error after updating android studio to 2.3 - android

I'm getting the following error after updating android studio to 2.3;
Error:A problem occurred configuring project ':app'.
Could not resolve all dependencies for configuration ':app:_debugApk'.
org.gradle.api.internal.artifacts.configurations.ConfigurationInternal.getModule()Lorg/gradle/api/internal/artifacts/ModuleInternal;
I already tried this solution,without succes.

I had the similar issue and then run ./gradlew app:dependencies --stacktrace command in the terminal (note stacktrace option). The stacktrace was:
java.lang.NoSuchMethodError: org.gradle.api.internal.artifacts.configurations.ConfigurationInternal.getModule()Lorg/gradle/api/internal/artifacts/ModuleInternal;
at org.gradle.api.plugins.AndroidMavenPlugin$8.execute(AndroidMavenPlugin.java:167)
at org.gradle.api.plugins.AndroidMavenPlugin$8.execute(AndroidMavenPlugin.java:159)
...
That result pointed me to the maven plugin I'm using in the project: com.github.dcendents:android-maven-gradle-plugin. After googling I found the same issue on their Github and the solution is to upgrade to their latest version 1.5 which adds support of Gradle 3.0.
BTW, before all that I cleared my .gradle folder at home directory and relaunch Android Studio with killing java processes but still not sure if these steps were obvious.
P.S. Also, later I had to upgrade Robolectric to the latest version for my tests executing successfully. So, even if your issue isn't related to maven plugin my assumption is that you need to re-check all dependencies you are using if they work with the new Gradle version.

Related

Unable to resolve Gradle sync failure (gradle-4.4) in Android studio 3.1.3

Being new to android studio, I have downloaded android studio version 3.1.3 with gradle build 4.4. Everytime I open android studio, gradle sync starts but never succeeds. This time it throws the following error:
A problem occurred configuring project ':app'.
I have tried disabling instant run, but unfortunately in my system there is no way of checking it out.
Rebuild and clear project did not make any changes.
How to sort out this problem as I have a project to be done with android studio?
gradle-wrapper.properties:
,
build.gradle:
I hope this will work for you.
Change class path 3.1.3 to 3.1.2
classpath 'com.android.tools.build:gradle:3.1.2'
and sync project. as per documentation for gradle version 4.4+ requires plugin version higher than 3.1.0+ and make sure requires internet connection.
Change the gradle version to 3.0.0 and then sync and re build the project. It might help

Android Studio 3.1 Gradle Plugin 4.4 KotlinNullPointerException

Surprisingly, my project is completely written and developed in Java only, it's also not containing any dependencies declared for Kotlin. Yet I'm receiving this weird error:
A problem occurred configuring project ':app'.
Configuration:
When I use the below configuration, it works perfectly fine, builds the project and the app gets installed on my device/emulator:
Android Studio Version: 3.1 Stable release
Gradle Plugin Version: 3.0.1
Gradle Distribution URL:
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
BUT When I use the latest configuration declared below, the error occurs while running the app as shown in the images:
Android Studio Version: 3.1 Stable release
Gradle Plugin Version: 3.1.0
Gradle Distribution URL:
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
Steps I've followed/things I've tried:
Clean Project
Rebuild Project
Sync Project
Deleting build folder from project tree
Checked that project doesn't contain any names, references or declarations missing
Invalidate Caches/Restart
Check the whole dependency tree to make sure any Kotlin dependency is not imported or used as my project doesn't make use of Kotlin language
None of the above have worked!
I think instant run might be creating issue .
Do one thing disable instant run in android studio and try again .I think it might will resolve issue .
Try to update Android Studio. Turn off Instant Run from Settings → Build, Execution, Deployment → Instant Run and uncheck Enable Instant Run.

Gradle 2.2.3 taking too much time to build after update Android Studio 2.3

I have updated Android Studio 2.3 today, after successfully updated, I am getting problem while syncing Gradle with version 2.2.3
Is there any issue with new version of Android Studio 2.3?
What should I do?
After updating Android Studio 2.3, you may have to update gradle plugin too as described here.
I just restarted AndroidStudio and done some process like [MAKE SURE THAT YOUR INTERNET HAVE ENOUGH SPEED]:
If you have set option for gradle as "Use default gradle wrapper" then it will ask as following, otherwise you have to select it.
Update with new gradle plugin:
It will work now for new plugins :) Enjoy with new gradle and Android Studio 2.3.
Exit as after run ./gradlew tasks from your project folder;
work for me.
After completing all the above tasks, Now it shows another error as `Error:Execution failed for task ':app:mergeDebugResources'.
Error: java.util.concurrent.ExecutionException: java.lang.RuntimeException: AAPT process not ready to receive commands`

Ionic Gradle failure "Could not find com.android.tools.build:gradle:2.2.3"

I am attempting, in Windows 7, to compile my Ionic project Android platform using the Ionic CLI. This is something that previously worked, and now does not. The only thing that has changed is that I upgraded Android Studio. However, I am not compiling with Android studio, so I am surprised that I am getting Gradle errors. For:
$ ionic run android
The output is:
A problem occurred configuring root project 'android'.
> Could not resolve all dependencies for configuration ':_debugApk'.
> A problem occurred configuring project ':CordovaLib'.
> Could not resolve all dependencies for configuration ':CordovaLib:classpath'.
> Could not find com.android.tools.build:gradle:2.2.3.
Searched in the following locations:
https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.2.3/gradle-2.2.3.pom
https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.2.3/gradle-2.2.3.jar
Required by:
android:CordovaLib:unspecified
Though the output claims that I can gain additional error info with the --stacktrace and --debug flags, this is untrue.
I have seen threads suggesting that the problem is that one or more of mavenCentral() or jcenter() are missing from the repositories list in the build.gradle. These are both present.
I tried just throwing an HTTP GET at the addresses and it comes back 404. Is there somewhere else that I can direct Gradle to look for these files?
Possibly the strangest thing is that the files that it claims it can't find, actually do get downloaded into the Gradle cache each time (if I clear them, they appear the next time I execute the command). They appear in:
~/.gradle/caches/modules-2/files-2.1/com.android.tools.build/gradle/2.2.3/88b4934c958cfe74ff5559c1a33707a562af59d2/gradle-2.2.3.pom
and
~/.gradle/caches/modules-2/files-2.1/com.android.tools.build/gradle/2.2.3/7b8f79621d95e3ce1e95c0852db14d9d7e1d1951/gradle-2.2.3.jar
Steps I've taken so far:
upgrade Gradle
clear both gradle and Maven repositories
Try it off the company intranet with the --no-proxy flag on
I'm not sure what the next troubleshooting step should be.
I had same issue on mac, what worked for me was fresh install of android studio and ionic.
So probably first uninstall everything, then install android studio update it install whatever tools required, install gradle THEN install cordova and ionic.
This is maybe due to the path.Ionic is not able to find the path of the sdks in the same folder as u are giving there in your environment variables .
Try to change environment variables. Maybe you have given a local path instead of global hence it was not able to find sdks of your android studio.

Eclipse Juno and android maven plugin

I'm having alot of pain getting some of my android projects to run on eclipse 4.2, they run fine in Indigo , but not so much in Juno.
I'm using the android maven plugin, and they also runs fine from the console, using
mvn android:run
But after importing the projects into Juno, I get the following errors
An internal error occurred during: "Importing Maven projects".
com/android/io/StreamException
and
WARNING: unable to write jarlist cache file /path-to-project-bin/jarlist.cache
Then when trying to run the project, I get the following error in the console
R.java was modified manually! Reverting to generated version!
and the application crash on startup.
Have anybody seen similar problems with Juno?
This is a known issue with the m2e-android connector caused by the update for ADT version 20.0.0 that is being worked on:
https://github.com/rgladwell/m2e-android/issues/89
Update: The new 0.4.2 release fixes this issue was released today, please run an Eclipse update (Help -> Check for Updates) and let me know if this resolves your problems.

Categories

Resources