Android Studio 中如何引入 layoutlib.jar?
https://www.zhihu.com/question/31811664
**def getLayoutLibPath() {
return “${android.getSdkDirectory().getAbsolutePath()}” + “/platforms/android-25/data/layoutlib.jar”
}**
dependencies {
compile fileTree(dir: ‘libs’, include: [‘*.jar’]),
androidTestCompile(‘com.android.support.test.espresso:espresso-core:2.2.2’, {
exclude group: ‘com.android.support’, module: ‘support-annotations’
})
// compile(name: ‘NetModule-V1.0-release’, ext: ‘aar’)
//引入aar包
// compile(name: ‘ToolsModule-V1.0-release’, ext: ‘aar’)//引入aar包
provided files(getLayoutLibPath())
compile ‘com.android.support:appcompat-v7:25.+’
compile ‘com.android.support.constraint:constraint-layout:1.0.2’
testCompile ‘junit:junit:4.12’
compile ‘com.jakewharton:butterknife:7.0.1’
}