Task with name 'mockableAndroidJar' not found in project ':app' - android

after changing gradle android plugin version to 3.2.1
classpath 'com.android.tools.build:gradle:3.2.1'
I received such build error:
Task with name 'mockableAndroidJar' not found in project ':app'.
Invalidate cache and restart doesn't help

Happened to me too, fixed by upgrading Android Studio to version 3.2.1
Seems like they've changed the gradle task name from mockableAndroidJar to createMockableJar

Related

What is navigation.json in Android Studio 4.1?

I just tried out Android Studio 4.1 today. I started the Android Studio and created empty activity and I run it using the android virtual device. Then it was failed and this error is shown:
FAILURE: Build failed with an exception.
* What went wrong:
A problem was found with the configuration of task ':app:processDebugManifest' (type 'ProcessMultiApkApplicationManifest').
> File 'E:\Project\AndroidLayout\app\build\intermediates\merged_manifest\debug\out\AndroidManifest.xml' specified for property 'mainMergedManifest' does not exist.
When I rebuild the project, the error message is shown here:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugMainManifest'.
> com.android.manifmerger.ManifestMerger2$MergeFailureException: java.io.FileNotFoundException: E:\Project\AndroidLayout\app\build\intermediates\navigation_json\debug\navigation.json (The system cannot find the path specified)
Note that this is fresh install and fresh project without any modification in the code.
UPDATE 1:
Youtube: https://www.youtube.com/watch?v=g4w_NOA_UVQ
Bug Report: https://issuetracker.google.com/issues/170720311
UPDATE 2:
After I downgrade the Android Gradle Plugin version from 4.1.0 to 4.0.2 and the Gradle version from 6.5 to 6.4.1 now it is working.
So my conclusion is there is a bug in the Android Gradle Plugin 4.1.+ and Gradle 6.5.+.
I find a temporary solution:
After I downgrade the Android Gradle Plugin version from 4.1.0 to 4.0.2 and the Gradle version from 6.5 to 6.4.1 now it is working. So my conclusion is there is a bug in the Android Gradle Plugin 4.1.+ and Gradle 6.5.+.
In order to downgrade, just go to File -> Project Structure.
Had same issue. Moving project files to ntfs drive fixed it.
Downgrading the Android Gradle Plugin version from 4.1.0 to 4.0.2 and the Gradle version from 6.5 to 6.4.1 now it is working; works for me as well. Now app is no longer experiencing building errors.Thanks.
Error message was :
A problem was found with the configuration of task ':app:processDebugManifest' (type 'ProcessMultiApkApplicationManifest').
File 'F:\NietsPastApp\app\build\intermediates\merged_manifest\debug\out\AndroidManifest.xml' specified for property 'mainMergedManifest' does not exist.
Thanks for help, downgrade it's ok. just for other who search the file :
gradle 4.0.2 change here : /build.gradle
dependencies {
classpath 'com.android.tools.build:gradle:4.0.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
gradle 6.4.1 : gradle-wrapper.properties
distributionUrl=https\://services.gradle.org/distributions/gradle-6.4.1-all.zip
File -> Project Structure. reduce your build tools version to 29
i tried it's work
In my case and for kotlin I have downgraded kotlin version from 1.4.32 to 1.4.31

ANDROID STUDIO 3.0 upgrade : Error:Could not resolve all files for configuration ':app:xxxxxxxDebugCompileClasspath'

I found this warning after upgrading the latest android studio stable version
Error:Could not resolve all files for configuration ':app:xxxxxxxDebugCompileClasspath'.
Failed to transform file 'commons-lang-2.4.jar' to match attributes {artifactType=android-classes} using transform JarTransform
Transform output file xxxxxxx/xxxxxxx/xxxxxxx/app/commons-lang-2.4.jar does not exist.
here is gradle and gradle wrapper versions :
gradle : classpath 'com.android.tools.build:gradle:3.0.0'
and
gradle wrapper :
distributionUrl=https\://services.gradle.org/distributions/g‌​radle-4.1-all.zip
change dependency declaration
from
compile files('libs/commons-lang-2.4.jar')
to
implementation files('libs/commons-lang-2.4.jar')
I had the same problem, build -> clean project worked for me.
Change the classpath of Project Gradle to:
classpath 'com.android.tools.build:gradle:3.1.0-alpha01'
OR
change distributionUrl of gradle-wrapper.properties to
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
Hope it helps you
I had same problem , googled a lot but nothing worked. Following worked for me on Android 4.2.1
Go to File -> Manage IDE Settings -> Restore IDE Settings
Then follow the instructions.

Android studio - Gradle version is 2.14.1 . Current version is 2.10

I am not able to build a project in my mac. This was coded by someone else and given to me . I did change my gradle-wrapper.properties as recommended , but still facing the issue
Error:(1, 1) A problem occurred evaluating project ':app'.
Failed to apply plugin [id 'com.android.application'] Minimum supported Gradle version is 2.14.1. Current version is 2.10.
If using the gradle wrapper, try editing the distributionUrl in /Users/*****/Downloads/android_project/gradle/wrapper/gradle-wrapper.properties to gradle-2.14.1-all.zip.
Below is my gradle-wrapper.properties file
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.0-all.zip
Gradle sync output is also showing this error which I am not able to resolve - not sure if it has anything to do with the above
Error:(30, 13) Failed to resolve:
com.android.support.constraint:constraint-layout:1.0.0-alpha4
Install Repository and sync project<br><a
href="openFile:/Users/*****/Downloads/android_project/app/build.gradle">
Show in File</a><br><a href="open.dependency.in.project.structure">
Show in Project Structure dialog</a>
You are using a local gradle distribution. To change that go to
Android Studio -> File -> Settings -> Build, Execution, Deployment -> Gradle -> Use default gradle wrapper
And then you will use the gradle-wrapper.properties which actually should point to the latest version.
You can see them here at gradle distributions
You distributionUrl is wrong. Points to 2.14.0 version. Change it to:
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip

Android Studio Gradle version - Gradle version 2.8 is required

I'm trying to build an Android project but the following error occurred
Error:(10, 1) A problem occurred evaluating project ':app'.
> Failed to apply plugin [id 'com.android.application']
> Gradle version 2.8 is required. Current version is 2.4. If using the gradle wrapper, try editing the distributionUrl in C:\Users\...\gradle\wrapper\gradle-wrapper.properties to gradle-2.8-all.zip
It seem something's wrong with the Gradle version, however I checked the gradle-wrapper-property and it's already 2.10.
Also in File-Project Structure-Project, gradle-version is also 2.10
No idea how this happened, I've also restarted android-studio many times.
For those that still need help, an answer on another post did it for me link.
You need to change Settings > Builds,Execution,Deployment > Build Tools > Gradle >Gradle home path
Or set Use default gradle wrapper and edit Project\gradle\wrapper\gradle-wrapper.properties files field distributionUrl like this
distributionUrl=https://services.gradle.org/distributions/gradle-2.10-all.zip
I don't think that changing Gradle tools to version 1.5.0 is necessary, but if you're using 2.0-snapshot or beta version of gradle, I recommend you to change it to 1.5.0.
This error:
Error:(10, 1) A problem occurred evaluating project ':app'.
> Failed to apply plugin [id 'com.android.application']
> Gradle version 2.8 is required. Current version is 2.4. If using the gradle wrapper, try editing the distributionUrl in
C:\Users...\gradle\wrapper\gradle-wrapper.properties to
gradle-2.8-all.zip
only tells you that your project's Gradle system is a bit outdated and need to be updated to newer version.
Open your project Android Studio and in navigator on the left find file called gradle-wrapper.properties. It should have a content like this:
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip
Change the last line with distributionUrl=https\://services.gradle.org/distributions/gradle-2.8-all.zip
It should work.
Go To Android Preference and Just change Project level Settings to Use default gradle wrapper (recommended).
There is a bug in version checking in older android plugins. To fix this you can either go back to gradle 2.9 or use the newer plugin
buildscript {
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
}
}
But I see from your error message that it tries to run with gradle 2.4 so this is maybe another problem.
Updating the version of android studio from 1.4 to 1.5.1 fixed this problem for me.

After importing eclipse project to android studio 1.4 ,getting Gradle plugin error

Error:(1, 1) A problem occurred evaluating project ':App Lite'.
Failed to apply plugin [id 'com.android.application']
Gradle version 1.10 is required. Current version is 2.4. If using the gradle wrapper, try editing the distributionUrl in /home/AppLite/gradle/wrapper/gradle-wrapper.properties to gradle-1.10-all.zip
You have to update the gradle-plugin for Android and gradle version.
They are different. You can find more info about the android plugin here
With the classpath inside your gradle files, you set the version of the android plugin for Gradle.
Change your classpath using:
classpath 'com.android.tools.build:gradle:1.3.1'
In the gradle/wrapper/gradle-wrapper.properties file you set the version of the Gradle. For example the 2.4 version.
distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip

Categories

Resources