Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Downgrade Gradle from 3.3 to 2.14.1

Long story short: My android phone keeps disconnecting from ADB. I was told to update android studio, did that. I open my project in Intellij and try to run on android and I get an error:

BUILD FAILED

Total time: 48.986 secs

Error: /Users/me/Desktop/comp/Development/comp-ionic/platforms/android/gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileDebugJavaWithJavac'.
> java.lang.NullPointerException (no error message)

My first thought is that my gradle is the wrong version. For this specific app, I need to use gradle version 2.14.1.

When I type gradle -v I'm getting version 3.3.

Is there a way to delete/downgrade gradle from 3.3 to 2.14.1?

Or is this another problem?

like image 943
ntgCleaner Avatar asked Feb 02 '17 16:02

ntgCleaner


People also ask

How do I download a specific version of Gradle?

I would add that the gradle binary is added to $HOME/. sdkman/candidates/gradle/[version]/bin. Add this to your PATH environment variable, source the file and you're good to go.

How do I change the Gradle version in spring boot?

You are going to need to update gradle, as newer spring boot versions are incompatible with older versions of gradle. You can either download the new gradle manually or use gradle wrapper to set the version for your project.


1 Answers

If you're using the gradle wrapper, then there'll be a folder in your project named "gradle" with a subfolder named "wrapper", inside that, there are 2 files:
- gradle-wrapper.jar
- gradle-wrapper.properties

Open "gradle-wrapper.properties" and change the place where it says "3.3" to "2.14.1". Then sync gradle, and it will automatically download 2.14.1.

If you're using the new 2.3 Android Studio, you HAVE to use gradle wrapper 3.3, as its the minimum supported gradle wrapper version. If so, then you'll have to download Android Studio 2.2, or fix whatever issue you have in your project that needs gradle wrapper version 2.14.1.

To get more information about whatever the issue is, try running this: ./gradlew clean assemble -stacktrace

That will clean your project, try and compile it, and if/when it fails, it will show you a stacktrace of the error.

like image 153
Moonbloom Avatar answered Sep 16 '22 14:09

Moonbloom