{"id":364,"date":"2025-02-11T11:18:36","date_gmt":"2025-02-11T03:18:36","guid":{"rendered":"https:\/\/shounenwind.tw\/blog\/?p=364"},"modified":"2025-02-11T11:18:36","modified_gmt":"2025-02-11T03:18:36","slug":"flutter-%e8%b7%b3%e5%85%a9%e5%80%8b%e7%89%88","status":"publish","type":"post","link":"https:\/\/shounenwind.tw\/blog\/programming\/android\/flutter-%e8%b7%b3%e5%85%a9%e5%80%8b%e7%89%88\/","title":{"rendered":"Flutter \u8df3\u5169\u500b\u7248"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\u6700\u8fd1\u5728\u5347\u7d1a\u5c08\u6848\u4f7f\u7528\u7684 flutter \u5230 3.27\uff0c\u4e5f\u5347\u7d1a\u4e86AGP\uff0c\u9047\u5230\u5404\u7a2e\u554f\u984c\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5148\u662f\u6709\u5957\u4ef6\u662f\u6c92\u6709\u5728 gradle \u653e namespace\uff0c\u4e1f\u4e86 PR \u4e5f\u4e0d\u7406\uff0c\u53ea\u597d\u81ea\u5df1 fork\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u7136\u5f8c\u4e0d\u77e5\u9053\u70ba\u4ec0\u9ebc\uff0c\u6c92\u653e jvmTarget \u7684\u5957\u4ef6\u4e5f\u6703\u6709\u76f8\u5bb9\u6027\u554f\u984c\uff0c\u5c31\u96a8\u4fbf\u7d66\u4ed6\u6307\u5b9a\u4e00\u500b\u4f4e\u7684\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>allprojects {\n    tasks.withType(KotlinCompile).configureEach {\n        kotlinOptions {\n            if (jvmTarget == null) {\n                jvmTarget = JavaVersion.VERSION_1_8.toString()\n            }\n        }\n    }\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u7136\u5f8c\u5176\u4ed6\u7684\u4e8b\u8b93 toolchain \u8655\u7406\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>java {\n    toolchain {\n        languageVersion = JavaLanguageVersion.of(21)\n    }\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u7136\u5f8c\u602a\u4e8b\u5c31\u4f86\u4e86\uff0c<a href=\"https:\/\/pub.dev\/packages\/flutter_statusbarcolor_ns\">flutter_statusbarcolor_ns<\/a> \u9019\u500b\u5957\u4ef6\u4e0d\u77e5\u9053\u70ba\u4ec0\u9ebc\uff0ctoolchain \u6307\u5b9a 21 \u7684\u6642\u5019\u6703\u8ddf\u4f60\u8aaa\u6c92\u8fa6\u6cd5\u8ddf 17 \u76f8\u5bb9\uff0c\u6307\u5b9a 17 \u7684\u6642\u5019\u53c8\u6703\u8df3 class file has wrong version 65.0, should be 61.0\uff0c\u5f8c\u4f86\u5be6\u5728\u641e\u4e0d\u5b9a\uff0c\u6700\u5f8c\u53ea\u597d\u5728 gradle.properties \u52a0\u500b\u8a2d\u5b9a\u5ffd\u7565\u9019\u500b\u6aa2\u67e5\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>kotlin.jvm.target.validation.mode = IGNORE<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u6709\u7a7a\u518d\u7814\u7a76\u70ba\u4ec0\u9ebc\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6700\u8fd1\u5728\u5347\u7d1a\u5c08\u6848\u4f7f\u7528\u7684 flutter \u5230 3.27\uff0c\u4e5f\u5347\u7d1a\u4e86AGP\uff0c\u9047\u5230\u5404\u7a2e\u554f\u984c\u3002 \u5148\u662f\u6709\u5957\u4ef6\u662f\u6c92\u6709\u5728 gra [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,7],"tags":[79,49,78,80,81],"class_list":["post-364","post","type-post","status-publish","format-standard","hentry","category-android","category-flutter","tag-agp","tag-flutter","tag-gradle","tag-kotlin","tag-toolchain"],"_links":{"self":[{"href":"https:\/\/shounenwind.tw\/blog\/wp-json\/wp\/v2\/posts\/364","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/shounenwind.tw\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/shounenwind.tw\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/shounenwind.tw\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/shounenwind.tw\/blog\/wp-json\/wp\/v2\/comments?post=364"}],"version-history":[{"count":1,"href":"https:\/\/shounenwind.tw\/blog\/wp-json\/wp\/v2\/posts\/364\/revisions"}],"predecessor-version":[{"id":365,"href":"https:\/\/shounenwind.tw\/blog\/wp-json\/wp\/v2\/posts\/364\/revisions\/365"}],"wp:attachment":[{"href":"https:\/\/shounenwind.tw\/blog\/wp-json\/wp\/v2\/media?parent=364"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/shounenwind.tw\/blog\/wp-json\/wp\/v2\/categories?post=364"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/shounenwind.tw\/blog\/wp-json\/wp\/v2\/tags?post=364"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}