{"id":834,"date":"2023-11-09T20:22:42","date_gmt":"2023-11-09T12:22:42","guid":{"rendered":"http:\/\/gjweb.top\/?p=834"},"modified":"2024-09-25T15:38:20","modified_gmt":"2024-09-25T07:38:20","slug":"flutter-%e8%bf%90%e8%a1%8c%e6%9e%84%e5%bb%ba%e6%97%b6%e9%80%9f%e5%ba%a6%e8%bf%87%e6%85%a2%e4%bb%a5%e5%8f%8a%e8%bf%90%e8%a1%8c%e9%94%99%e8%af%af","status":"publish","type":"post","link":"https:\/\/gjweb.top\/?p=834","title":{"rendered":"flutter \u8fd0\u884c\u6784\u5efa\u65f6\u901f\u5ea6\u8fc7\u6162\u4ee5\u53ca\u8fd0\u884c\u9519\u8bef"},"content":{"rendered":"\n<p>\u91cd\u65b0\u8fd0\u884c\u65f6\u5efa\u8bae\u5148\u6e05\u7a7a\u9879\u76ee\u7684\u7f13\u5b58\u6587\u4ef6<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>flutter clean<\/code><\/pre>\n\n\n\n<p>\u8fd0\u884c\u547d\u4ee4\u67e5\u770b\u4e0b\u8f7d\u8fdb\u5ea6\u8be6\u60c5<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>flutter run -v<\/code><\/pre>\n\n\n\n<p>\u901a\u5e38\u60c5\u51b5\u4e0b\u5728\u4e0b\u8f7d gradle.zip \u5305\u65f6\u4f1a\u8fde\u63a5\u8d85\u65f6\u6216\u8005\u5931\u8d25\uff0c\u56e0 gradle \u7684\u8fdc\u7a0b\u4ed3\u5e93\u5728\u56fd\u5916\u4f1a\u53d7\u5230\u5899\u7684\u5f71\u54cd\uff0c<strong>\u56fd\u5185\u4e00\u4e9b\u6587\u7ae0\u5efa\u8bae\u66f4\u6362\u955c\u50cf\u6e90\u5b9e\u6d4b\u540e\u65e0\u6548<\/strong>\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"\u62a5\u9519\u4fe1\u606f\">\u62a5\u9519\u4fe1\u606f<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91; +152 ms] Downloading https:\/\/services.gradle.org\/distributions\/gradle-7.5-all.zip<br>&#91;+22995 ms] Exception in thread \"main\" java.net.ConnectException: Connection timed out: connect<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"\u89e3\u51b3\u65b9\u6cd5\">\u89e3\u51b3\u65b9\u6cd5<\/h2>\n\n\n\n<p>\u624b\u52a8\u4e0b\u8f7d gradle-7.5-all.zip \u5305\uff0c\u5c06\u538b\u7f29\u5305\u53ef\u653e\u5230 <code>C:\/Users\/15031\/.gradle\/wrapper\/dists\/<\/code> \u76ee\u5f55\u4e0b, <strong>\u9002\u7528\u4e8e\u6240\u6709gradle\u8d85\u65f6\u60c5\u51b5<\/strong><\/p>\n\n\n\n<p>\u5728\u9879\u76ee\u76ee\u5f55\u4e2d\u627e\u5230 <code>android\/dradle\/wrapper\/gradle-wrapper.properties<\/code> \u914d\u7f6e\u6587\u4ef6<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>distributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper\/dists\nzipStoreBase=GRADLE_USER_HOME\nzipStorePath=wrapper\/dists\n#distributionUrl=https\\:\/\/services.gradle.org\/distributions\/gradle-7.5-all.zip\n\/**\u66ff\u6362*\/\ndistributionUrl=file\\:\/\/\/C:\/Users\/UserName\/.gradle\/wrapper\/dists\/gradle-7.5-all.zip<\/code><\/pre>\n\n\n\n<p>\u7136\u540e\u91cd\u65b0\u8fd0\u884c<code>flutter run<\/code> \u4f1a\u9ed8\u8ba4\u4ece\u672c\u5730\u5305\u4e2d\u5c31\u52a0\u8f7d\u76f8\u5e94\u6587\u4ef6<\/p>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"\u62a5\u9519\u4fe1\u606f\u4e8c\">\u62a5\u9519\u4fe1\u606f\u4e8c<\/h2>\n\n\n\n<p>\u5f53\u8fd0\u884c\u65f6\u62a5 <code>Users\/UserName\/.gradle\/wrapper\/dists\/gradlexxx<\/code> \u65f6\uff0c\u53ef\u5c06 <code>.gradle<\/code> \u76ee\u5f55\u5220\u9664\uff0c\u8fd0\u884c flutter \u9879\u76ee\u65f6\u4f1a\u91cd\u65b0\u6784\u5efa\u6539\u6587\u4ef6\uff0c\u4f46\u6784\u5efa\u8be5\u76ee\u5f55\u65f6\u53ef\u80fd\u9700\u8981\u82b1\u8d39\u4e00\u4e9b\u65f6\u95f4<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u573a\u666f\u4e8c \u5b8c\u6210\u4e0a\u65b9\u914d\u7f6e\u540e\u8fd0\u884c\u4ecd\u7136\u8f83\u6162\uff0c\u53ef\u5c1d\u8bd5\u4fee\u6539 gradle \u955c\u50cf<\/h2>\n\n\n\n<p>\u914d\u7f6e\u8def\u5f84 <code>android\/build.gradle<\/code>\uff0c\u5982\u4e0b\u5b8c\u6574\u914d\u7f6e\u793a\u4f8b<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>buildscript {\n    ext.kotlin_version = '1.7.10'\n    repositories {\n    \t\/\/ \u6ce8\u91ca\u6389\n        \/\/ google()\n        \/\/ mavenCentral()\n        \/\/ \u6362\u6210\u963f\u91cc\u955c\u50cf\u6e90\n        maven {\n            allowInsecureProtocol = true\n            url 'https:\/\/maven.aliyun.com\/repository\/google'\n        }\n        maven {\n            allowInsecureProtocol = true\n            url 'https:\/\/maven.aliyun.com\/repository\/jcenter'\n        }\n        maven {\n            allowInsecureProtocol = true\n            url 'http:\/\/maven.aliyun.com\/nexus\/content\/groups\/public'\n        }\n    }\n\n    dependencies {\n        classpath 'com.android.tools.build:gradle:7.3.0'\n        classpath \"org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version\"\n    }\n}\n\nallprojects {\n    repositories {\n    \t\/\/ \u64cd\u4f5c\u540c\u4e0a\n        \/\/ google()\n        \/\/ mavenCentral()\n        maven {\n            allowInsecureProtocol = true\n            url 'https:\/\/maven.aliyun.com\/repository\/google'\n        }\n        maven {\n            allowInsecureProtocol = true\n            url 'https:\/\/maven.aliyun.com\/repository\/jcenter'\n        }\n        maven {\n            allowInsecureProtocol = true\n            url 'http:\/\/maven.aliyun.com\/nexus\/content\/groups\/public'\n        }\n    }\n}\n\nrootProject.buildDir = '..\/build'\nsubprojects {\n    project.buildDir = \"${rootProject.buildDir}\/${project.name}\"\n}\nsubprojects {\n    project.evaluationDependsOn(':app')\n}\n\ntasks.register(\"clean\", Delete) {\n    delete rootProject.buildDir\n}<\/code><\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u91cd\u65b0\u8fd0\u884c\u65f6\u5efa\u8bae\u5148\u6e05\u7a7a\u9879\u76ee\u7684\u7f13\u5b58\u6587\u4ef6 \u8fd0\u884c\u547d\u4ee4\u67e5\u770b\u4e0b\u8f7d\u8fdb\u5ea6\u8be6\u60c5 \u901a\u5e38\u60c5\u51b5\u4e0b\u5728\u4e0b\u8f7d gradle.zip \u5305\u65f6\u4f1a\u8fde [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[63],"tags":[],"class_list":["post-834","post","type-post","status-publish","format-standard","hentry","category-flutter"],"_links":{"self":[{"href":"https:\/\/gjweb.top\/index.php?rest_route=\/wp\/v2\/posts\/834","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gjweb.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gjweb.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gjweb.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gjweb.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=834"}],"version-history":[{"count":5,"href":"https:\/\/gjweb.top\/index.php?rest_route=\/wp\/v2\/posts\/834\/revisions"}],"predecessor-version":[{"id":1010,"href":"https:\/\/gjweb.top\/index.php?rest_route=\/wp\/v2\/posts\/834\/revisions\/1010"}],"wp:attachment":[{"href":"https:\/\/gjweb.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=834"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gjweb.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=834"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gjweb.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=834"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}