Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to build gradle environment under Android Studio

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

Editor to share with you how to build the gradle environment under Android Studio, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's learn about it!

There are authoritative gradle installation tutorials on the W3C page; it says that version 1.5 or later of JDK.Gradle comes with the Groovy library. But appears when gradle is executed.

-bash: gradle: command not found

problem.

If you are using Android Studio for development, you no longer need to download gradle's zip package installation, because Android Studio comes with gradle. We can help computers find gradle commands in the mac environment in the following ways:

1. Right-click Android Studio.app in Finder, and click "Show package contents"

2. Click "Contents"-> "gradle"-> "gradle-2.14.1" (depending on your studio version)-> "bin"

3. Right-click "gradle" and copy the path, such as "* * (your own path) / Android Studio.app/Contents/gradle/gradle-2.14.1/bin".

4. Open "terminal (Terminal)"

5. Execute "cd ~"

6. Execute "touch .bash _ profile"

7. Execute "open-E. bash _ profile"

8. Add at the end of the bash_profile file (pay attention to the red slash, it must be added!)

Export GRADLE_HOME=*** (your own path) / Android\ Studio.app/Contents/gradle/gradle-2.14.1

Export PATH=$ {PATH}: ${GRADLE_HOME} / bin

9. Save and exit, and execute "source .bash _ profile" to apply the modification

10. Execute gradle-v

Appear:

Gradle 2.14.1

Build time: 2016-07-18 06:38:37 UTC

Revision: d9e2113d9fb05a5caabba61798bdb8dfdca83719

Groovy: 2.4.4

Ant: Apache Ant (TM) version 1.9.6 compiled on June 29 2015

JVM: 1.7.079 (Oracle Corporation 24.79-b02)

OS: Mac OS X 10.11.5 x86_64

These are all the contents of the article "how to build a gradle environment under Android Studio". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report