环境准备
首先我们要用SDK Manager安装Android SDK 22,也就是5.1,还要Android SDK Build-tools 和 Android Support Repository.如下图勾选的三个组件:
添加local.properties文件
在文件中设置sdk路径,例如我的文件中信息如下:
sdk.dir=/Users/wuxian/Documents/tools/sdk
ANDROID_HOME
你也可以不用添加local.properties文件,直接设置ANDROID_HOME的环境变量就可以.
命令
infer – ./gradlew build
执行的过程又报错了:
localhost:android_hello wuxian$ infer -- ./gradlew build
12:31:18.287 [ERROR] [org.gradle.api.Project] /Users/wuxian/Downloads/infer-osx-v0.1.0/infer/examples/android_hello/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/22.0.0/res/drawable-hdpi-v4/abc_spinner_mtrl_am_alpha.9.png: libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
12:31:36.401 [ERROR] [org.gradle.api.Project] /Users/wuxian/Downloads/infer-osx-v0.1.0/infer/examples/android_hello/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/22.0.0/res/drawable-hdpi-v4/abc_spinner_mtrl_am_alpha.9.png: libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
TODO: print error message
TODO: print error message
There was nothing to analyze, exiting
我JDK为1.7,出现了上面的错误,去Issue上找了一下,有人提了这个问题,等待解决吧.