{"id":642,"date":"2018-07-24T14:01:01","date_gmt":"2018-07-24T06:01:01","guid":{"rendered":"https:\/\/www.dd-home.top:1443\/?p=642"},"modified":"2018-07-24T14:01:01","modified_gmt":"2018-07-24T06:01:01","slug":"android-butterknife-%e5%9c%a8module%e5%92%8capp%e4%b8%ad%e5%ba%94%e7%94%a8","status":"publish","type":"post","link":"https:\/\/www.dd-home.top\/?p=642","title":{"rendered":"Android Butterknife \u5728module\u548cApp\u4e2d\u5e94\u7528"},"content":{"rendered":"<p><!--more--><\/p>\n<p>1.\u5728Application\u4e2d\u7684build.gradle<\/p>\n<pre class=\"lang:xhtml decode:true \" title=\"application build.gradle\">\/\/ Top-level build file where you can add configuration options common to all sub-projects\/modules.\n\nbuildscript {\n    \n    repositories {\n        google()\n        jcenter()\n        mavenCentral()\n        maven { url \"https:\/\/jitpack.io\" }\n    }\n    dependencies {\n        classpath 'com.jakewharton:butterknife-gradle-plugin:8.4.0'\n        classpath 'com.android.tools.build:gradle:3.1.3'\n\n        \/\/ NOTE: Do not place your application dependencies here; they belong\n        \/\/ in the individual module build.gradle files\n    }\n}\n\nallprojects {\n    repositories {\n        google()\n        jcenter()\n    }\n}\n\ntask clean(type: Delete) {\n    delete rootProject.buildDir\n}\n<\/pre>\n<p>2.\u5728Module\u4e2d\u7684build.gradle\u4e2d\u6dfb\u52a0\u914d\u7f6e<\/p>\n<pre class=\"lang:xhtml decode:true \" title=\"Module\u4e2d\u7684build.gradle\u4e2d\u7684\u914d\u7f6e\">apply plugin: 'com.android.library'\napply plugin: 'com.jakewharton.butterknife'\n\nandroid {\n    compileSdkVersion 27\n\n\n\n    defaultConfig {\n        minSdkVersion 15\n        targetSdkVersion 27\n        versionCode 1\n        versionName \"1.0\"\n\n        testInstrumentationRunner \"android.support.test.runner.AndroidJUnitRunner\"\n\n    }\n\n    buildTypes {\n        release {\n            minifyEnabled false\n            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'\n        }\n    }\n\n}\n\ndependencies {\n    implementation fileTree(dir: 'libs', include: ['*.jar'])\n\n    implementation 'com.android.support:appcompat-v7:27.1.1'\n    testImplementation 'junit:junit:4.12'\n    androidTestImplementation 'com.android.support.test:runner:1.0.2'\n    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'\n    api 'com.readystatesoftware.systembartint:systembartint:1.0.4'\n    api 'org.greenrobot:eventbus:3.1.1'\n    api 'com.pnikosis:materialish-progress:1.0'\n    api 'com.jakewharton:butterknife:8.8.1'\n    annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'\n}\n<\/pre>\n<p>3.\u5728app\u4e2d\u7684\u914d\u7f6e<\/p>\n<pre class=\"lang:xhtml decode:true \" title=\"App build.gradle\u4e2d\u7684\u914d\u7f6e\">apply plugin: 'com.android.application'\n\nandroid {\n    compileSdkVersion 27\n    defaultConfig {\n        applicationId \"com.jiaqiang.bodyhealth\"\n        minSdkVersion 21\n        targetSdkVersion 27\n        versionCode 1\n        versionName \"1.0\"\n        testInstrumentationRunner \"android.support.test.runner.AndroidJUnitRunner\"\n    }\n    buildTypes {\n        release {\n            minifyEnabled false\n            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'\n        }\n    }\n}\n\ndependencies {\n    implementation fileTree(include: ['*.jar'], dir: 'libs')\n    implementation 'com.android.support:appcompat-v7:27.1.1'\n    implementation 'com.android.support.constraint:constraint-layout:1.1.2'\n    testImplementation 'junit:junit:4.12'\n    androidTestImplementation 'com.android.support.test:runner:1.0.2'\n    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'\n    api 'com.jakewharton:butterknife:8.8.1'\n    annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'\n    implementation project(':nbad')\n}\n<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[15],"tags":[41],"class_list":["post-642","post","type-post","status-publish","format-standard","hentry","category-android","tag-butterknife"],"_links":{"self":[{"href":"https:\/\/www.dd-home.top\/index.php?rest_route=\/wp\/v2\/posts\/642","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dd-home.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dd-home.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dd-home.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dd-home.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=642"}],"version-history":[{"count":0,"href":"https:\/\/www.dd-home.top\/index.php?rest_route=\/wp\/v2\/posts\/642\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.dd-home.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=642"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dd-home.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=642"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dd-home.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=642"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}