< p >的例子:
在Android Studio Install的plugins文件夹中找到gradle-wrapper-1.12.jar文件
我的项目在D:\android_repo\myProject上
创建一个文件夹到D:\android_repo\myProject\gradle
将gradle-wrapper-1.12.jar拷贝到D:\android_repo\myProject\gradle文件夹
-再次导入我的项目,没有更多关于gradle的问题
Step 1: Open terminal :)
Step 2: Open .bash_profile in vim to edit:
> vi ~/.bash_profile
Step 3: Add line:
> export GRADLE_HOME=/usr/local/opt/gradle
(for me it was this location, it can be different for u)
Step 4: Add line:
> export PATH="$PATH:$GRADLE_HOME/bin"
(to export bin directory of gradle)
Step 5: Verify by reopening the terminal or new tab, and check by echoing:
> echo $GRADLE_HOME
所以,我已经在我的~/.bashrc和ionic cordova run android命令中添加了export PATH=/home/maxim/.gradle/wrapper/dists/gradle-4.1-all/bzyivzo6n839fup2jbap0tjew/gradle-4.1/bin:$PATH。