question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

clean Error:Execution failed for task ':app:mockableAndroidJar'. > java.lang.NullPointerException (no error message) in Android Studio 2.2

See original GitHub issue

Error:

20161004103811

gradle:

··· compileSdkVersion 23 buildToolsVersion “23.0.3” ···

This error comes when using your lib of android-23, and it disappear when using the original android-23.jar.

We know task ':app:mockableAndroidJar' is experimental in Android Studio 2.1.3, and I close this.

Android Studio clean 时产生 Error:Execution failed for task ‘:app:mockableAndroidJar’ > java.lang.NullPointerException (no error message)

but google makes this stable in Android Stuido 2.2, and I can’t this.

This error comes for some days until today I found this may be result from your lib.

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:24 (2 by maintainers)

github_iconTop GitHub Comments

11reactions
IgorEisbergcommented, Dec 8, 2016

Another workaround: In your project’s main build.gradle, inside “allprojects”:

allprojects {
    repositories {
        jcenter()
    }
    gradle.taskGraph.whenReady {
        tasks.each { task ->
            if (task.name.equals('mockableAndroidJar')) {
                task.enabled = false
            }
        }
    }
}
8reactions
IgorEisbergcommented, Dec 3, 2016

I have this issue as well as I’m using a modified android.jar (which has all the hidden API revealed). I don’t use the unit testing and there’s no apparent way to disable it in Android Studio 2.2.2, so I found a workaround for this problem:

  1. Go to File -> Settings -> Build, Execution, Deployment -> Compiler
  2. Add to “Command-line Options”: -x :app:prepareReleaseUnitTestDependencies -x :app:mockableAndroidJar -x :app:compileReleaseUnitTestSources
  3. Press “OK” and try to Rebuild Project again.

Now the unit testing compilation tasks will always be skipped and no errors will be thrown.

Read more comments on GitHub >

github_iconTop Results From Across the Web

java.lang.NullPointerException (no error message)
I've deleted .gradle folder from the project and was able to rebuild it again. N.B: Make a backup, just in case.
Read more >
Android Studio: Fix error "java.lang.NullPointerException (no ...
I try to work with old project that hasn't been updated 3 years ago, I got another bulls**t error without any explanation.
Read more >
Java.Lang.Nullpointerexception And Execution Failed For Task
The best method for handling this type of error is specific to the application and to reach the end of the main() function...
Read more >
Known issues for Android Studio 2.2 and earlier
A bug in preview 5 means that building non-Gradle projects in the IDE is not working well. (Note - this isn't a supported...
Read more >
Kotlin Android Studio plugin error when cleaning project
Android Studio 1.4 ... Go to MainActivity.java and click Code > Convert Java File to Kotlin File. ... Error:Execution failed for task ':app:clean'....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found