1. 程式人生 > >Android Studio 中如何引入 layoutlib.jar?

Android Studio 中如何引入 layoutlib.jar?

dependencies {
    provided files(getLayoutLibPath())

    compile 'com.android.support:appcompat-v7:23.1.1'
}


tasks.withType(JavaCompile) {
    options.encoding = "UTF-8"
}


def getLayoutLibPath() {
    return "${android.getSdkDirectory().getAbsolutePath()}" + "/platforms/" + android.compileSdkVersion + "/data/layoutlib.jar"
}