flutter新創(chuàng)建項(xiàng)目報(bào)錯(cuò) A license was specified in podspec `integration_test` but the file does not exist

估計(jì)最近很多新創(chuàng)建flutter項(xiàng)目的小伙伴會(huì)發(fā)現(xiàn),運(yùn)行會(huì)報(bào)錯(cuò)
具體分兩種情況:
iOS報(bào)錯(cuò)

Pod installation complete! There are 2 dependencies from the Podfile and 2 total pods installed.

[!] Automatically assigning platform `iOS` with version `9.0` on target `Runner` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.

[!] A license was specified in podspec `integration_test` but the file does not exist - /Users/pedromassango/Desktop/xyz/ios/.symlinks/plugins/integration_test/LICENSE

[!] Unable to read the license file `../LICENSE` for the spec `integration_test (0.0.1)`

[!] Unable to read the license file `../LICENSE` for the spec `integration_test (0.0.1)`

[!] CocoaPods did not set the base configuration of your project because your project already has a custom config set. In order for CocoaPods integration to work at all, please either set the base configurations of the target `Runner` to `Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig` or include the `Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig` in your build configuration (`Flutter/Release.xcconfig`).
pedromassango@MacBook-Pro-de-MacBook ios % 

怎么處理呢否纬?

Automatically assigning platform `iOS` with version `9.0` on target `Runner`

第一個(gè)問題很好解決仍秤,進(jìn)入ios文件夾打開podfile文件,將 platform :ios, '9.0'取消注釋即可彼宠。

后面三個(gè)問題如何解決呢鳄虱?
多是因?yàn)閞uby版本過低導(dǎo)致的,升級(jí)本機(jī)的ruby即可 ,建議升級(jí)到2.7.1

Hello, I have the same problem.
The problem is caused because the function `Dir.new (configuration_engine_dir).each_child` that is inside the file podhelper.rb was introduced only in ruby ??2.5, while the version of it on my machine for example is still in 2.0

There should be some validation on the side of the flutter to avoid problems in this regard

This bug was introduced in this [pull](https://github.com/flutter/flutter/pull/71495)

升級(jí)ruby可以參考這篇文章 升級(jí)ruby

升級(jí)完成以后凭峡,估計(jì)本地的cocoapods也不可用拙已,此時(shí)也需要重新安裝一下(不一定哦,我的就需要重新安裝)摧冀,重新安裝cocoapods可以參考這篇文章 安裝cocoapods倍踪。

安裝完成以后就??啦,運(yùn)行flutter run沒有任何問題了索昂。具體可以參考
flutter官網(wǎng)issue

Android報(bào)錯(cuò):

Exception in thread "main" java.net.ConnectException: Operation timed out (Connection timed out)
        at java.net.PlainSocketImpl.socketConnect(Native Method)        
        at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
        at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
        at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)   
        at java.net.Socket.connect(Socket.java:607)                     
        at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:666)
        at sun.security.ssl.BaseSSLSocketImpl.connect(BaseSSLSocketImpl.java:173)
        at sun.net.NetworkClient.doConnect(NetworkClient.java:180)      
        at sun.net.www.http.HttpClient.openServer(HttpClient.java:463)  
        at sun.net.www.http.HttpClient.openServer(HttpClient.java:558)  
        at sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:264)
        at sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:367)
        at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:191)
        at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1162)
        at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1056)
        at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:177)
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1570)
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1498)
        at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:268)
        at org.gradle.wrapper.Download.downloadInternal(Download.java:58)
        at org.gradle.wrapper.Download.download(Download.java:44)       
        at org.gradle.wrapper.Install$1.call(Install.java:61)           
        at org.gradle.wrapper.Install$1.call(Install.java:48)           
        at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)
        at org.gradle.wrapper.Install.createDist(Install.java:48)       
        at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:128)
        at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
Running Gradle task 'assembleDebug'...                                  
Running Gradle task 'assembleDebug'... Done                        77.0s
Exception: Gradle task assembleDebug failed with exit code 1

是由于下載gradle配置文件建车,而地址卻是國(guó)外的地址,導(dǎo)致下載失敗椒惨,處理方式如下
打開新建的工程項(xiàng)目文件gradle-wrapper.properties(路徑android/gradle/wrapper/gradle-wrapper.properties)
將該文件里面distributionUrl的地址改為本地已經(jīng)下載下來的路徑
distributionUrl=file:///Users/wuai/Downloads/Flutter/gradle/gradle-6.8.1-all.zip

其中g(shù)radle包是從這個(gè)地址下載下來的缤至,如果后面需要更新gradle,可以從這個(gè)地址下載 gradle6.8.1下載

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
  • 序言:七十年代末框产,一起剝皮案震驚了整個(gè)濱河市凄杯,隨后出現(xiàn)的幾起案子错洁,更是在濱河造成了極大的恐慌秉宿,老刑警劉巖,帶你破解...
    沈念sama閱讀 217,509評(píng)論 6 504
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件屯碴,死亡現(xiàn)場(chǎng)離奇詭異描睦,居然都是意外死亡,警方通過查閱死者的電腦和手機(jī)导而,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 92,806評(píng)論 3 394
  • 文/潘曉璐 我一進(jìn)店門忱叭,熙熙樓的掌柜王于貴愁眉苦臉地迎上來,“玉大人今艺,你說我怎么就攤上這事韵丑。” “怎么了虚缎?”我有些...
    開封第一講書人閱讀 163,875評(píng)論 0 354
  • 文/不壞的土叔 我叫張陵撵彻,是天一觀的道長(zhǎng)。 經(jīng)常有香客問我,道長(zhǎng)陌僵,這世上最難降的妖魔是什么轴合? 我笑而不...
    開封第一講書人閱讀 58,441評(píng)論 1 293
  • 正文 為了忘掉前任,我火速辦了婚禮碗短,結(jié)果婚禮上受葛,老公的妹妹穿的比我還像新娘。我一直安慰自己偎谁,他們只是感情好总滩,可當(dāng)我...
    茶點(diǎn)故事閱讀 67,488評(píng)論 6 392
  • 文/花漫 我一把揭開白布。 她就那樣靜靜地躺著巡雨,像睡著了一般咳秉。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發(fā)上鸯隅,一...
    開封第一講書人閱讀 51,365評(píng)論 1 302
  • 那天澜建,我揣著相機(jī)與錄音,去河邊找鬼蝌以。 笑死炕舵,一個(gè)胖子當(dāng)著我的面吹牛,可吹牛的內(nèi)容都是我干的跟畅。 我是一名探鬼主播咽筋,決...
    沈念sama閱讀 40,190評(píng)論 3 418
  • 文/蒼蘭香墨 我猛地睜開眼,長(zhǎng)吁一口氣:“原來是場(chǎng)噩夢(mèng)啊……” “哼徊件!你這毒婦竟也來了奸攻?” 一聲冷哼從身側(cè)響起,我...
    開封第一講書人閱讀 39,062評(píng)論 0 276
  • 序言:老撾萬榮一對(duì)情侶失蹤虱痕,失蹤者是張志新(化名)和其女友劉穎睹耐,沒想到半個(gè)月后,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體部翘,經(jīng)...
    沈念sama閱讀 45,500評(píng)論 1 314
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡硝训,尸身上長(zhǎng)有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 37,706評(píng)論 3 335
  • 正文 我和宋清朗相戀三年,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了新思。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片窖梁。...
    茶點(diǎn)故事閱讀 39,834評(píng)論 1 347
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡,死狀恐怖夹囚,靈堂內(nèi)的尸體忽然破棺而出纵刘,到底是詐尸還是另有隱情,我是刑警寧澤荸哟,帶...
    沈念sama閱讀 35,559評(píng)論 5 345
  • 正文 年R本政府宣布假哎,位于F島的核電站蛔翅,受9級(jí)特大地震影響,放射性物質(zhì)發(fā)生泄漏位谋。R本人自食惡果不足惜山析,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 41,167評(píng)論 3 328
  • 文/蒙蒙 一、第九天 我趴在偏房一處隱蔽的房頂上張望掏父。 院中可真熱鬧笋轨,春花似錦、人聲如沸赊淑。這莊子的主人今日做“春日...
    開封第一講書人閱讀 31,779評(píng)論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽(yáng)陶缺。三九已至钾挟,卻和暖如春,著一層夾襖步出監(jiān)牢的瞬間饱岸,已是汗流浹背掺出。 一陣腳步聲響...
    開封第一講書人閱讀 32,912評(píng)論 1 269
  • 我被黑心中介騙來泰國(guó)打工, 沒想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留苫费,地道東北人汤锨。 一個(gè)月前我還...
    沈念sama閱讀 47,958評(píng)論 2 370
  • 正文 我出身青樓,卻偏偏與公主長(zhǎng)得像百框,于是被迫代替她去往敵國(guó)和親闲礼。 傳聞我的和親對(duì)象是個(gè)殘疾皇子,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 44,779評(píng)論 2 354

推薦閱讀更多精彩內(nèi)容

  • 本篇為iOS集成flutter學(xué)習(xí)總結(jié)铐维,由flutter官方提供的最新集成方案翻譯而來柬泽。本篇以O(shè)C項(xiàng)目為示例,Sw...
    我亦飄零久93閱讀 1,133評(píng)論 2 1
  • 1嫁蛇、打開終端锨并,cd到用戶根目錄下,執(zhí)行:git clonehttps://github.com/flutter/f...
    Smalla閱讀 735評(píng)論 0 0
  • 最近在做flutter項(xiàng)目棠众,執(zhí)行flutter run 的時(shí)候琳疏,會(huì)在iOS項(xiàng)目中執(zhí)行pod install 這個(gè)命...
    伊路順峰閱讀 1,134評(píng)論 0 0
  • 1有决、當(dāng)誤刪某個(gè)flutter操作文件時(shí)闸拿,運(yùn)行報(bào)錯(cuò)如下The 'Pods-Runner' target has tr...
    桃之_夭夭_閱讀 2,712評(píng)論 0 1
  • 久違的晴天,家長(zhǎng)會(huì)书幕。 家長(zhǎng)大會(huì)開好到教室時(shí)新荤,離放學(xué)已經(jīng)沒多少時(shí)間了。班主任說已經(jīng)安排了三個(gè)家長(zhǎng)分享經(jīng)驗(yàn)台汇。 放學(xué)鈴聲...
    飄雪兒5閱讀 7,523評(píng)論 16 22