日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

2、Flutter 填坑记录篇

發布時間:2023/12/10 编程问答 26 豆豆
生活随笔 收集整理的這篇文章主要介紹了 2、Flutter 填坑记录篇 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

?1、前言

之前寫了一篇文章關于 flutter 初體驗的一篇,https://www.cnblogs.com/niceyoo/p/9240359.html,當時一頓騷操作,然后程序就跑起來了。

隔了好一段時間,換了個電腦,重新裝了個AndroidStudio,繼續搭建 Flutter ,然后哐哧哐哧用了一會就把需要配置弄好了,然后用 AS 創建了個項目,好家伙,直接報錯。

Launching lib\main.dart on ONEPLUS A5010 in debug mode... Initializing gradle... Resolving dependencies... * Error running Gradle: Exit code 1 from: F:\android_studio_workspace\flutter_app2\flutter_app2\android\gradlew.bat app:properties: NDK is missing a "platforms" directory. If you are using NDK, verify the ndk.dir is set to a valid NDK directory. It is currently set to E:\AndroidSDK\ndk-bundle. If you are not using NDK, unset the NDK variable from ANDROID_NDK_HOME or local.properties to remove this warning.Project evaluation failed including an error in afterEvaluate {}. Run with --stacktrace for details of the afterEvaluate {} error.FAILURE: Build failed with an exception.* Where: Build file 'F:\android_studio_workspace\flutter_app2\flutter_app2\android\app\build.gradle' line: 25* What went wrong: A problem occurred evaluating project ':app'. > Could not resolve all files for configuration 'classpath'. > Could not find lint-gradle-api.jar (com.android.tools.lint:lint-gradle-api:26.1.2). Searched in the following locations: https://jcenter.bintray.com/com/android/tools/lint/lint-gradle-api/26.1.2/lint-gradle-api-26.1.2.jar* 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.* Get more help at https://help.gradle.org BUILD FAILED in 2sFinished with error: Please review your Gradle project setup in the android/ folder.

2、問題分析

先看最后一條信息:

finished with error: please review your gradle project setup in the android/ folder.

說,讓我檢查 gradle,然后各種找,發現沒錯啊。

還是從第一條錯誤開始看吧:

NDK is missing a "platforms" directory. If you are using NDK, verify the ndk_ ......

好家伙,這又是個什么鬼.

NDK缺少一個“platforms”目錄。如果您正在使用NDK,請驗證NDK。將dir設置為有效的NDK目錄。
目前它被設置為D: AndroidSDK\ndk-bundle。
如果不使用NDK,請從ANDROID_NDK_HOME或local中卸載NDK變量。屬性刪除此警告。

2.1 解決第一個問題

既然說少了就裝個吧。

下載鏈接:https://developer.android.google.cn/ndk/downloads/

?下載,解壓zip文件 得到一個 android-ndk-rXXb 的文件夾,直接解壓,然后把該文件夾下的所有文件都移動到你的,sdk,ndk-bundle 文件夾下。

再配置個環境變量,重啟 AS 解決問題。

2.2 解決第二個問題

Build file 'F:\android_studio_workspace\flutter_app2\flutter_app2\android\app\build.gradle' line: 25

找到 flutter SDK 路徑下的 \flutter\packages\flutter_tools\gradle\flutter.gradle 文件。

把 gradle 版本改低一點。

?

?博客地址:https://www.cnblogs.com/niceyoo

總結

以上是生活随笔為你收集整理的2、Flutter 填坑记录篇的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。