android gradle

gradle 安装:

1、下载

        http://www.gradle.org/downloads 直接点击下载最新版本(或者choose Version选择历史版本)

2、解压

        放到本地自己的soft目录里,我放在了/usr/localLib/gradle-1.8

3、export gardle path

        vim ~/.bash_profile 添加

        GRADLE_PATH=/usr/localLib/gradle-1.8/bin

        export GRADLE_PATH

        export PATH=$PATH:$GRADLE_PATH


这边安装过程中遇到的问题

一、

* What went wrong:

A problem occurred evaluating project ':**Base'.

Could not create plugin of type 'LibraryPlugin'.

解决:以前安装了1.0的版本,把以前的版本删掉即可


二、

* What went wrong:

A problem occurred evaluating project ':****'.

SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.

解决:如描述,gradle找不到android sdk的目录,那就export就可以了

        ANDROID_HOME=/Applications/Android\ Studio.app/sdk

        export ANDROID_HOME


三、

* What went wrong:

Execution failed for task ':Support-v7:compileReleaseAidl'.

failed to find target android-17

解决:我本地的版本比较高,没有项目指定的android-17,那就用sdk manager下载android-17就可以了


四、

* What went wrong:

A problem was found with the configuration of task ':***:zipalignRelease'.

File '/Applications/Android Studio.app/sdk/tools/zipalign' specified for property 'zipAlignExe' does not exist.

解决:cp /Applications/Android\ Studio.app/sdk/build-tools/19.1.0/zipalign  /Applications/Android\ Studio.app/sdk/tools/

sdk/tools下边找不到zipalign,网上查了一下,发现都说19.1.0里边有,然后查看本地,确实有,cp过去就可以了


五、

* What went wrong:

A problem occurred configuring project ':****'.

Failed to notify project evaluation listener.

 Configuration with name 'default' not found.

解决:每个子模块都瞅一眼,看看是不是缺失gradle文件,或者gradle文件有错,先编译一下子模块


转载:http://blog.csdn.net/daweibayu123/article/details/39397519

你可能感兴趣的:(android gradle)