Command in cmd
cd android
gradlew installDebug
It generates a new .apk the problem is that it has an old version
DO gradlew clean first that should totally work
Related
I have different version for command gradlew --version and gradle wrapper --version, why is that?
Gradlew vs Gradle Wrapper
They are two different executables. gradle is the one installed globally and located in your path. Adding the option wrapper to the gradle command did not change anything for it and you are just seeing the output of gradle --version.
gradlew is the wrapper version installed in the current folder. This version can be different to the gradle one.
A user of my repo did not need to install gradle at all, when I add the wrapper directly to the root folder.
And even if you have a newer version, my project still works with the version I tested it with. So it is quit common the gradlew version is different to your gradle version.
You can update the gradlew version with the wrapper option and you can also use the gradlew wrapper command so the wrapper updates itself.
When you are using linux you can check with which gradle, which gradlew where the exeutables are located (or where gradle for a Windows CMD).
More infos can be found in the offcial documentation:
https://docs.gradle.org/current/userguide/gradle_wrapper.html
I am trying to update my local gradle(out of ide) from 6.5.1 to 7.0.0.
I try two commands from gradle website and network in cmd and path is the root of one of my project(there are gradlew.bat and gradlew files):
gradle wrapper --gradle-version=7.0 --distribution-type=all
gradlew wrapper --gradle-version=7.0 --distribution-type all
And, i try those commands to check the version
gradle -v
gradlew -v
The gradlew updates sucessfully. It prints version 7.0.0.
However, the version of gradle is still in v6.5.1.
How can I update it without download the v7.0.0 packet and cover the files in disk(I am worrying about that i should download all of my packages again in new gradle)?
ps: the gradle is locating in D:\gradle in my disk and java environment is openJDK 15
Thanks agains
I had the same problem and, in my case, the problem was a running gradle demon using the previous version. Check running demons with:
gradle --status
Stop the demons with
gradle --stop
Also I restarted the console/terminal.
You cannot update your gradle standalone version without downloading it, and with gradle wrapper you cannot upgrade your gradle installation, it always works on your current project folder (command gradlew) only. To upgrade a standalone gradle installation (command gradle without the wrapper prefix w), you have to manually download the binaries, include the new bin directory in your PATH environment as described in the manual on the gradle homepage, or use a package manager like sdk man, chocolatey, brew etc.
If you are using the gradle wrapper gradlew for your builds, it works completely independent from your gradle installation.
My project Hydrograph-master cloned from Git is not getting build and throwing error "Gradle is not recognized as internal or external command" while building using command line interface, though I had intalled gradle in my C:/Gradle Directory
I guess, you're building this project: https://github.com/BitwiseInc/Hydrograph
It has a Gradle Wrapper. It means, that you should not use your local Gradle installation, but a wrapper, bundled in the repo. It is gradlew.bat for you (Windows). So, just use gradlew.bat instead of gradle in CLI:
gradlew.bat clean
gradlew.bat check
gradlew.bat assemble
The wrapper will download required Gradle version for you and use it. This way you'll be using the same Gradle version that project authors meant to be used.
I download elasticsearch source code from :https://github.com/elastic/elasticsearch,
I found there is a build.gradlefile,and I have install gradle,
how to build source it?
There is a description fo the way you can build it in the readme file in the repo. According to it:
Building from Source
Elasticsearch uses Gradle for its build system. You’ll need to have
version 2.13 of Gradle installed.
In order to create a distribution, simply run the gradle assemble
command in the cloned directory.
The distribution for each project will be created under the
build/distributions directory in that project.
See the TESTING file for more information about running the
Elasticsearch test suite.
So all you need is to get into the root directory and in command line call gradle assemble, if you have Gradle installed properly, you will find all artifacts under build/distributions directory
gradle assemble seems to yield some errors such as cannot find symbol in my macOS environment.
According to the latest description in the repo (as of time writing the answer):
To build a distribution for your local OS and print its output location upon completion, run:
./gradlew localDistro
To build a distribution for another platform, run the related command:
./gradlew :distribution:archives:linux-tar:assemble
./gradlew :distribution:archives:darwin-tar:assemble
./gradlew :distribution:archives:windows-zip:assemble
To build distributions for all supported platforms, run:
./gradlew assemble
Distributions are output to distributions/archives.
How can I run android lint from mac command ? I know how to run it from Android studio platform. But I have no idea to run it through gradle command line.
Thanks.
I'm not sure this is what you need but you can launch ./gradlew lint in the root directory of your project
Go to the root directory of your project.Then type ./gradlew lint
This works for me. Cheerz.