provided:是指编译的时候依赖这个jar包,但是最终打包APK的时候不打进去。
假如你的jar包存在代码依赖性,但是在编译的时候才用得上,而运行时不需要,就用providedCompile
例如:
providedCompile 'org.springframework.boot:spring'
compile:是指编译内容可以是本地的,也可以是远程(jCenter)中的。如果是本地的包,最好以aar形式给出。编译完成后jar包会被打包进入apk中。
假如你的jar包存在代码依赖性,在编译、运行时候需要依赖代码,那就用compile
例如 :
compile 'org.springframework.boot:spring'