Flutter 打包Android apk報(bào)錯(cuò)榨乎,提示內(nèi)容為
Execution failed for task ':shared_preferences:verifyReleaseResources'.
...
A problem occurred configuring root project 'fluttertoast'.
> SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
根據(jù)提示校驗(yàn)項(xiàng)目衬廷,并沒有發(fā)現(xiàn)什么SDK location配置錯(cuò)誤的問題穿稳,在新的項(xiàng)目中加入Flutter toast也可以打包成功抱婉,對(duì)比一個(gè)新建的Flutter項(xiàng)目來全都一摸一樣宇整,真讓人頭大瓶佳。最后嘗試單獨(dú)打開Android目錄,進(jìn)入純Android工程編譯打包鳞青,可以打包成功霸饲,并且可以正常安裝運(yùn)行。具體問題在哪里真搞不明白臂拓,如果有知道如何從根本上解決問題的老師贴彼,還望指點(diǎn)一二,這里記錄一下臨時(shí)解決方法埃儿,如果能幫到你器仗,那我這幾句話就有存在的意義。